[FFmpeg-devel] [PATCH 2/2] avformat/md5enc: add format, version and column headers

James Almer jamrial at gmail.com
Mon Oct 21 00:51:36 CEST 2013


On 20/10/13 6:02 PM, Michael Niedermayer wrote:
> See Ticket2280
> 
> @@ -1,4 +1,7 @@
> +#format: framemd5
> +#version: 1
>  #tb 0: 1/25
> +#stream#, dts,        pts, duration,     size, MD5
>  0,          0,          0,        1,   195264, 5869dee2126d98ecc1fab1e69720906a
>  0,          1,          1,        1,   195272, 1bd08dcde1061b0d9273bdc6dd901382
>  0,          2,          2,        1,   195892, 2b3fc3632bcd1cc44f777fb97a56f79b
> 
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavformat/md5enc.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/md5enc.c b/libavformat/md5enc.c
> index 270d9fb..5df257b 100644
> --- a/libavformat/md5enc.c
> +++ b/libavformat/md5enc.c
> @@ -117,7 +117,11 @@ static int framemd5_write_header(struct AVFormatContext *s)
>      int res = av_hash_alloc(&c->hash, c->hash_name);
>      if (res < 0)
>          return res;
> -    return ff_framehash_write_header(s);
> +    avio_printf(s->pb, "#format: framemd5\n");
> +    avio_printf(s->pb, "#version: 1\n");
> +    ff_framehash_write_header(s);
> +    avio_printf(s->pb, "#stream#, dts,        pts, duration,     size, MD5\n");

This uses AVHash, so instead of "MD5" it might be a better idea to use 
av_hash_get_name(c->hash).

> +    return 0;
>  }
>  
>  static int framemd5_write_packet(struct AVFormatContext *s, AVPacket *pkt)
> 



More information about the ffmpeg-devel mailing list