[FFmpeg-devel] [PATCH 3/8] libavformat/flacdec: Export samples md5 as metadata

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Feb 12 14:27:11 EET 2025


Tomas Härdin:
> ons 2025-02-12 klockan 12:14 +0100 skrev Andreas Rheinhardt:
>> Tomas Härdin:
>>>
>>>
>>> _______________________________________________
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel at ffmpeg.org
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>>
>> This will forward wrong/outdated metadata if only part of a file is
>> copied.
> 
> No? lavc/flacenc computes md5 from the actual samples and puts it in
> the extradata. If you mean incomplete file copy (cp) rather then ffmpeg
> -acodec copy then this will output what the user is likely interested
> in: the MD5 of the original data. This allows them to check that the
> file decodes correctly. This also applies to incomplete remuxing, which
> also won't recompute the MD5 as it is, AFAICT. But, this patch concerns
> the demuxer side, not transcoding or remuxing.
> 

I mean e.g. -c copy -t <whatever>. And even without the -t, this mostly
pointless metadata will be forwarded by default with your patch and may
get embedded into other files (as the aiff FATE reference file changes
show).
And given that the md5 is wrong for an incomplete file, it does not
allow the user to check that the file decodes correctly.

>> Apart from that, is it really necessary to export the md5 as
>> metadata given that it is very easily obtainable from the extradata?
> 
> I'm not sure if our users know that. But yes metadata can be dumped and
> then cut can be used to extract the MD5. But as Michael points out,
> flac isn't the only codec with MD5 hashes.
> 


More information about the ffmpeg-devel mailing list