[FFmpeg-devel] [PATCH] add md5 muxer

Baptiste Coudurier baptiste.coudurier
Mon May 24 00:30:10 CEST 2010


Hi Reimar,

On 5/23/10 6:28 AM, Reimar D?ffinger wrote:
> On Sun, May 23, 2010 at 01:38:21PM +0100, M?ns Rullg?rd wrote:
>> Reimar D?ffinger<Reimar.Doeffinger at gmx.de>  writes:
>>
>>> Hello,
>>> we have -f crc, but IMO 32 bit crc are a bit little for a whole file and
>>> also we use md5sum in the regression tests, so I'd propose to add a -f
>>> md5 as in attached patch.
>>
>> And as usual, people adding so much to the list of requirements that
>> nothing at all got done in the end.
>>
>> Just apply this so we can use it.
>
> Applied.
> Attached would extend this by a framemd5 muxer in addition.
>

Great, thanks !

>
> Index: libavformat/md5enc.c
> ===================================================================
> --- libavformat/md5enc.c	(revision 23257)
> +++ libavformat/md5enc.c	(working copy)
> @@ -24,6 +24,23 @@
>
>   #define PRIVSIZE 512
>
> +static void md5_finish(struct AVFormatContext *s, char *buf)
> +{
> +    uint8_t md5[16];
> +    int i, offset = strlen(buf);
> +    av_md5_final(s->priv_data, md5);
> +    for (i = 0; i<  sizeof(md5); i++) {
> +        snprintf(buf + offset, 3, "%02"PRIx8, md5[i]);
> +        offset += 2;
> +    }
> +    buf[offset] = '\n';
> +    buf[offset+1] = 0;

Nitpick, but you can put_buffer(s->pb, "\n", 1);

[...]

Btw, I'm having hard time getting same results for:
mplayer test.y4m -vo md5sum:outfile=/dev/stdout
and ffmpeg -i test.y4m -f framemd5 -

This is weird.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list