H.264 配置文件之间有什么区别?

Jam*_*mes 85 h.264

我在 After Effects CS5 中渲染了一个视频,当我格式化它时,我选择了 H.264 编解码器,在这种格式中,它有一个包含基线、主要和高的配置文件。

所以我做了一个小测试——用 Baseline 和 High 渲染这两个文件。我唯一注意到的是视频大小较小,高提供较小的文件大小。

我只是想知道有什么区别,哪个对质量最好,对文件大小最好。

slh*_*hck 110

什么是个人资料?

H.264 配置文件或多或少定义了编码器在压缩视频时可以使用的“花里胡哨”——编码器可以启用许多 H.264 功能。允许启用哪些由配置文件定义。配置文件确保具有不同解码功能的设备之间的兼容性。通过配置文件,编码器和解码器就他们都可以处理的功能集达成一致。

不同的配置文件有什么作用?

有关详细列表,请参阅维基百科上的H.264 配置文件

通常,基线配置文件仅将编码器限制为某些基本功能。即使在计算能力较低的设备(例如较旧的智能手机)上,也可以轻松播放使用基线配置文件编码的视频。例如,Android 和 iOS 手机官方只播放使用基线配置文件编码的视频,而不播放HighMain。这在过去几年发生了一些变化,越来越多的手机实际上可以播放主要配置文件,但不能播放高配置文件。

Primarily for low-cost applications, this profile is most typically used in videoconferencing and mobile applications. It corresponds to the subset of features that are in common between the Baseline, Main, and High Profiles

Main and High just add features to that. Especially the high profile is often used in broadcasting:

The primary profile for broadcast and disc storage applications, particularly for high-definition television applications (for example, this is the profile adopted by the Blu-ray Disc storage format and the DVB HDTV broadcast service).

B slices are for example only allowed in the Main profile and above. They can be used to save on bandwidth, but are harder to decode, which is why some devices might not support them.

What does that have to do with quality?

The profile only indirectly influences the quality. Some features of higher profiles may enable you to get the same quality with lower file sizes as compared to lower profiles.

For example, CABAC entropy coding (Main and High) is more efficient than CAVLC (Baseline). It is also computationally more intensive. Thus, if you give the encoder a certain bit rate to spend, it'll be able to create a better quality video with CABAC than with CAVLC because it achieves much better compression.

这也解释了为什么您使用配置文件获得更小的文件大小——显然,您以某种方式设置了恒定的质量级别,编码器可以使用更高级的压缩技术来创建与基线配置文件具有相同质量但更小的视频文件尺寸。

那么……你应该使用哪一个?

一些基本规则:

  • 如果您的目标是旧移动设备,则为基准配置文件
  • 网络流媒体的主要配置文件
  • 适用于长期存储、PC 或 Mac、蓝光创作等的配置。

  • 自从写这篇文章以来,几乎所有的智能手机,包括 Android 和其他设备,现在都在播放主配置文件,而且很多都玩得很high。例如,大多数声称播放高清内容的设备都支持高配置支持。您几乎可以肯定依赖于 main 或更高。Baseline 是 H.264 的高度残缺版本,专为过去几十年的有限设备而设计。 (14认同)
  • @jarno“Main@L4”表示“4 级主要配置文件”。如果解码器支持特定级别,则意味着它支持特定的最大比特率以及帧大小和帧速率的各种组合。请参阅同一维基百科页面的[级别部分](https://en.wikipedia.org/wiki/Advanced_Video_Coding#Levels)。如果您要对视频进行编码以在特定设备上播放,则最好的选择是查找它支持的配置文件和级别(这可能在用户手册中提供)并编码最高的(或者,当然,不更高)比那些。 (2认同)