[FFmpeg-user] Different FrameMD5 when converting between loss-less encodings
Tobias Rapp
t.rapp at noa-archive.com
Mon Nov 7 14:29:52 EET 2022
On 07/11/2022 12:31, Paul B Mahol wrote:
> On 11/7/22, Tobias Rapp <t.rapp at noa-archive.com> wrote:
>> On 07/11/2022 10:56, Paul B Mahol wrote:
>>> On 11/7/22, Tobias Rapp <t.rapp at 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#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG7-SCHEME_B___VIDEO_RANGE__MAPPING_WITH_UNSIGNED_Y____OFFSET_BINARY_CB__CR
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
More information about the ffmpeg-user
mailing list