Answers.Body: <p>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'.</p>
  
  <p>FFmpeg does not determine chroma sampling scheme from a <em>tag</em>. 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 <a href="https://ffmpeg.org/ffmpeg-scaler.html#Scaler-Options" rel="nofollow noreferrer">https://ffmpeg.org/ffmpeg-scaler.html#Scaler-Options</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-02T04:47:28.447Z
Answers.LastActivityDate: 2018-12-02T15:32:51.803Z
Answers.LastEditDate: 2018-12-02T15:32:51.803Z
Answers.UserDisplayName: Gyan
Body: <p>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?</p>
  
  <p>I am looking for a technical, objective answer. I don't mind if the degradation is subjectively small or something.</p>
  
  <p>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, <strong>which one of the following possibilities is true?</strong></p>
  
  <ul>
  <li>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.</li>
  <li>Ffmpeg reads the original chroma image blindly and applies a 4:2:2 subsampling, no matter where the original material comes from.</li>
  </ul>
  
  <p>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?</p>
  
  <p><strong>Edit:</strong> 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.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-03T04:32:34.717Z
Comments.Text: 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.
Comments.UserDisplayName: Michael Liebman
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-06T12:35:02.383Z
Comments.Text: @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.
Comments.UserDisplayName: Mephisto
Tags: <ffmpeg><video-capture>
Title: Is there image degradation when you apply the same chroma subsampling iteratively?
UserDisplayName: Mephisto
ThreadText: # Is there image degradation when you apply the same chroma subsampling iteratively?
  
  (Asked by: username_0 on 2018-12-01)
  
  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.
  
  **Tags:** ffmpeg, video-capture
  
  > **Comments:**
  > **username_1**: 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.  
  > **username_0**: @username_1 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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-12-02. Score: 1 | Accepted answer
  
  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>
  
  
  ---
  
  