I have digitalized a set of old family VHS tapes. As you know, VHS relied on chroma subsampling. And the capture device creates files with the 4:2:2 tag. Now, when I encode again with ffmpeg to get smaller files but for archival purposes, should I specify '-pix_fmt yuv444p' to make sure the chroma images do not get further degradation, or by using the same subsampling scheme as the source (i.e. yuv422p) the chroma images are not difuminated further due to subsampling?

I am looking for a technical, objective answer. I don't mind if the degradation is subjectively small or something.

To better explain the question, let's say we are transcoding video A into B, where A was done originalyy with a 4:2:2 subsampling and we specify the same 4:2:2 scheme to create B. Then, which one of the following possibilities is true?

  • Ffmpeg reads some tags inside video A and "knows" it was done using a 4:2:2 subsampling. Then, since the destination image has the same 4:2:2 scheme, it translates directly the chroma images into the destination video without performing any subsampling.
  • Ffmpeg reads the original chroma image blindly and applies a 4:2:2 subsampling, no matter where the original material comes from.

The first option seems more logical but in that case, what would happen if the subsampling scheme we ask for in the destination video is different than the original? How do you "translate" consistently from, say, 4:2:0 to 4:2:2?

Edit: From my own tests, the accepted answer, and a little bit of thinking about it, it seems clear that using the same chroma scheme does not produce degradation, as long as the resolution and size of the image is kept unchanged. It's difficult to explain without doing some drawings, but there is an analog working with audio. A signal sampled at 44.1 kHz for instance, can be resampled at the same frequency without losing information. If, e.g. a square cluster of 4 luma pixels corresponds to one unique color value (4:2:0), then resampling that image will assign the same color value to that 4 pixels.

  • VHS does not use sub-sampling. It is an analog format and doesn't sample at all. It does use a form of analog compression by creating color difference channels, then bandwidth limiting them, and frequency shifting the chroma signal below the wider-band luminance signal. Dec 3 '18 at 4:32
  • @MichaelLiebman Strictly speaking, yes, but VHS encodes luminance and color with different sampling frequencies, which results in quite a lower resolution for the color image. Both the intended purpose of doing that, and the resulting visual effect in the stored images, are equivalent to what chroma subsampling achieves in digital video.
    – Mephisto
    Dec 6 '18 at 12:35

If the target chroma subsampling is the same as the source subsampling, then any ffmpeg scaling will be a no-op in that regard, so it's not subsampling 'further'.

FFmpeg does not determine chroma sampling scheme from a tag. It is a basic property of the decoded bitstream. If it's 4:2:0, then the decoder will emit chroma planes of half-width and height with respect to the luma plane; for 4:2:2, half-width and full-height. A scaling operation will be carried out if the input and output schemes are different. A scaler will resize each row of the chroma plane to the target width of the output chroma plane and then rescale the resized rows to obtain the target height of the chroma planes. The "translation" is done as per the choice of scaling algorithm - see list at https://ffmpeg.org/ffmpeg-scaler.html#Scaler-Options


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.