4

I have a tool that converts videos of various formats to mp4 in baseline profile. It uses ffmpeg under the hood. The profile is explicitly specified as baseline. However pixel format is not specified. Once I stumbled upon a video in the avi container with this format:

Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 32:27 DAR 16:9], 25000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc

When I try to convert it it says that by default it will choose the yuv422p pixel format. Then it says that baseline profile is not compatible with this pixel format. If I specify the pixel format as yuv420p explicitly then it works fine.

What are the implications of converting all videos into this same pixel format? What is the practical difference between different pixel formats? Are other pixel formats for baseline profile different?

Gherman
  • 6,768
  • 10
  • 48
  • 75

1 Answers1

6

The question is moot. Since H264 baseline profile supports only yuv420p, there's nothing to decide.

The difference, between the various pixel formats relevant to this topic, is chroma subsampling. The short of it, is that encoders trade density of color information for greater compressibility. Since the human eye is more sensitive to gradations of brightness than to gradations of hue, the tradeoff is usually worth it.

Gyan
  • 85,394
  • 9
  • 169
  • 201
  • 1
    I was not aware that baseline profile does not support other pixel formats. ffpeg makes me specify pixel format even though only one will work. It misled me into thinking that there are others – Gherman Jan 22 '19 at 15:40
  • 3
    The media transcoding pipeline is complex in an app like ffmpeg which handles hundreds of formats and codecs. The encoder presents a list of globally acceptable formats which ffmpeg uses to vet the input format and that is the source of the first message you received (about format selection). The error about yuv422p not being acceptable is produced by the external library x264 and not ffmpeg, and it would not be good design for ffmpeg, in general, to second guess what the library would do, even though in this case the standard is clear. – Gyan Jan 22 '19 at 16:06