[FFmpeg-user] Different FrameMD5 when converting between loss-less encodings

Dave Rice dave at dericed.com
Mon Nov 7 15:29:35 EET 2022



> On Nov 7, 2022, at 6:32 AM, Paul B Mahol <onemda at gmail.com> 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

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 at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>> 
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list