Different FrameMD5 when converting between loss-less encodings
Hi, recently when testing I stumbled over the situation that a specific 10-bit YUV input file was encoded separately using two different loss-less encoders V210 and FFV1. When comparing the FrameMD5 checksum of both output files most of the checksums did match, but some of them where different (approx. 3% of the frames). When trying to reproduce the scenario with the attached batch script using a video source filter the resulting files even differ in every frame. My assumption would have been that the FrameMD5 checksums of both files would be the same, as they originate from the same input file and the intermediate encoding should be loss-less. Can someone give a hint where the differences come from? Is there some command-line option for bit-exactness missing, or is there something going wrong in the decoder/encoders? Regards, Tobias
On 11/7/22, Tobias Rapp <t.rapp@noa-archive.com> wrote:
Hi,
recently when testing I stumbled over the situation that a specific 10-bit YUV input file was encoded separately using two different loss-less encoders V210 and FFV1. When comparing the FrameMD5 checksum of both output files most of the checksums did match, but some of them where different (approx. 3% of the frames).
When trying to reproduce the scenario with the attached batch script using a video source filter the resulting files even differ in every frame. My assumption would have been that the FrameMD5 checksums of both files would be the same, as they originate from the same input file and the intermediate encoding should be loss-less.
Can someone give a hint where the differences come from? Is there some command-line option for bit-exactness missing, or is there something going wrong in the decoder/encoders?
The v210 encoder or decoder is buggy. Strange that both C and asm is buggy. The first pixels at start and end of each scanline are wrong.
Regards, Tobias
On 07/11/2022 10:56, Paul B Mahol wrote:
On 11/7/22, Tobias Rapp <t.rapp@noa-archive.com> wrote:
Hi,
recently when testing I stumbled over the situation that a specific 10-bit YUV input file was encoded separately using two different loss-less encoders V210 and FFV1. When comparing the FrameMD5 checksum of both output files most of the checksums did match, but some of them where different (approx. 3% of the frames).
When trying to reproduce the scenario with the attached batch script using a video source filter the resulting files even differ in every frame. My assumption would have been that the FrameMD5 checksums of both files would be the same, as they originate from the same input file and the intermediate encoding should be loss-less.
Can someone give a hint where the differences come from? Is there some command-line option for bit-exactness missing, or is there something going wrong in the decoder/encoders?
The v210 encoder or decoder is buggy. Strange that both C and asm is buggy. The first pixels at start and end of each scanline are wrong.
When I replace "-vcodec v210" in the shell script with "-vcodec ffvhuff" it matches the output of FFV1. So yes, there seems to be an issue with v210 encoding or decoding in FFmpeg. Looking into the bugtracker, could this be related to ticket #8195 "v210 encoding clips to 4-1019"? Regards, Tobias
On 11/7/22, Tobias Rapp <t.rapp@noa-archive.com> wrote:
On 07/11/2022 10:56, Paul B Mahol wrote:
On 11/7/22, Tobias Rapp <t.rapp@noa-archive.com> wrote:
Hi,
recently when testing I stumbled over the situation that a specific 10-bit YUV input file was encoded separately using two different loss-less encoders V210 and FFV1. When comparing the FrameMD5 checksum of both output files most of the checksums did match, but some of them where different (approx. 3% of the frames).
When trying to reproduce the scenario with the attached batch script using a video source filter the resulting files even differ in every frame. My assumption would have been that the FrameMD5 checksums of both files would be the same, as they originate from the same input file and the intermediate encoding should be loss-less.
Can someone give a hint where the differences come from? Is there some command-line option for bit-exactness missing, or is there something going wrong in the decoder/encoders?
The v210 encoder or decoder is buggy. Strange that both C and asm is buggy. The first pixels at start and end of each scanline are wrong.
When I replace "-vcodec v210" in the shell script with "-vcodec ffvhuff" it matches the output of FFV1. So yes, there seems to be an issue with v210 encoding or decoding in FFmpeg.
Looking into the bugtracker, could this be related to ticket #8195 "v210 encoding clips to 4-1019"?
Ah, probably yes, and yuvtestsrc gives you 0-1023 ramp
Regards, Tobias
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
On 07/11/2022 12:31, Paul B Mahol wrote:
On 11/7/22, Tobias Rapp <t.rapp@noa-archive.com> wrote:
On 07/11/2022 10:56, Paul B Mahol wrote:
On 11/7/22, Tobias Rapp <t.rapp@noa-archive.com> wrote:
Hi,
recently when testing I stumbled over the situation that a specific 10-bit YUV input file was encoded separately using two different loss-less encoders V210 and FFV1. When comparing the FrameMD5 checksum of both output files most of the checksums did match, but some of them where different (approx. 3% of the frames).
When trying to reproduce the scenario with the attached batch script using a video source filter the resulting files even differ in every frame. My assumption would have been that the FrameMD5 checksums of both files would be the same, as they originate from the same input file and the intermediate encoding should be loss-less.
Can someone give a hint where the differences come from? Is there some command-line option for bit-exactness missing, or is there something going wrong in the decoder/encoders?
The v210 encoder or decoder is buggy. Strange that both C and asm is buggy. The first pixels at start and end of each scanline are wrong.
When I replace "-vcodec v210" in the shell script with "-vcodec ffvhuff" it matches the output of FFV1. So yes, there seems to be an issue with v210 encoding or decoding in FFmpeg.
Looking into the bugtracker, could this be related to ticket #8195 "v210 encoding clips to 4-1019"?
Ah, probably yes, and yuvtestsrc gives you 0-1023 ramp
Found some related information in Technote 2162 from Apple, chapter "Scheme B: 'Video-Range' Mapping with Unsigned Y´, Offset Binary Cb, Cr": https://developer.apple.com/library/archive/technotes/tn2162/_index.html#//a... There it mentions that these component values are "reserved as synchronization signals and must not appear in a buffer". But is this document normative for anything besides QuickTime? From what I can find the v210 encoder is the only one that follows this value restriction, others like the v410 encoder do not. Regards, Tobias
On Nov 7, 2022, at 6:32 AM, Paul B Mahol <onemda@gmail.com> wrote:
On 11/7/22, Tobias Rapp <t.rapp@noa-archive.com> wrote:
On 07/11/2022 10:56, Paul B Mahol wrote: On 11/7/22, Tobias Rapp <t.rapp@noa-archive.com> wrote:
Hi,
recently when testing I stumbled over the situation that a specific 10-bit YUV input file was encoded separately using two different loss-less encoders V210 and FFV1. When comparing the FrameMD5 checksum of both output files most of the checksums did match, but some of them where different (approx. 3% of the frames).
When trying to reproduce the scenario with the attached batch script using a video source filter the resulting files even differ in every frame. My assumption would have been that the FrameMD5 checksums of both files would be the same, as they originate from the same input file and the intermediate encoding should be loss-less.
Can someone give a hint where the differences come from? Is there some command-line option for bit-exactness missing, or is there something going wrong in the decoder/encoders?
The v210 encoder or decoder is buggy. Strange that both C and asm is buggy. The first pixels at start and end of each scanline are wrong.
When I replace "-vcodec v210" in the shell script with "-vcodec ffvhuff" it matches the output of FFV1. So yes, there seems to be an issue with v210 encoding or decoding in FFmpeg.
Looking into the bugtracker, could this be related to ticket #8195 "v210 encoding clips to 4-1019"?
Ah, probably yes, and yuvtestsrc gives you 0-1023 ramp
This works in ffvhuff and not v210 because ffvhuff is a lossless codec and v210 is lossy (when certain sample values exist) as a selection of the highest and lowest values are rounded up or down. This is what the Apple spec for QuickTime says to do with v210. IMO the v210 encoder is working to spec and giving you a valid file rather than an invalid, lossless file. Dave Rice
Regards, Tobias
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
participants (3)
-
Dave Rice -
Paul B Mahol -
Tobias Rapp