[FFmpeg-devel] [PATCH] VP6 in avi to flv stream copy fix

Aurelien Jacobs aurel
Thu Jul 19 00:09:54 CEST 2007


On Wed, 18 Jul 2007 22:15:21 +0200
Benjamin Larsson <banan at ludd.ltu.se> wrote:

> $topic
> 
> This seems to be needed for the muxing to work.

Seems ??

> Index: libavformat/flvenc.c
> ===================================================================
> --- libavformat/flvenc.c	(revision 9741)
> +++ libavformat/flvenc.c	(working copy)
> @@ -281,8 +281,11 @@
>  
>      if (enc->codec_type == CODEC_TYPE_VIDEO) {
>          put_byte(pb, FLV_TAG_TYPE_VIDEO);
> +        if (enc->codec_id == CODEC_ID_VP6) {
> +            flags = FLV_CODECID_VP6;
> +        } else
> +            flags = enc->codec_tag;
>  
> -        flags = enc->codec_tag;

The flv_video_codec_ids table contains an entry for CODEC_ID_VP6
so I suppose FLV_CODECID_VP6 should be selected automatically...
There may be a problem somewhere else, but I didn't even gave it
a try so I can't really tell.

> @@ -310,7 +313,11 @@
>      if (enc->codec_id == CODEC_ID_VP6F)
>          put_byte(pb, enc->extradata_size ? enc->extradata[0] : 0);
>      put_buffer(pb, pkt->data, size);
> -    put_be32(pb,size+1+11); // previous tag size
> +    // previous tag size
> +    if ((enc->codec_id == CODEC_ID_VP6) || (enc->codec_id == CODEC_ID_VP6F))
> +        put_be32(pb,size+2+11);
> +    else
> +        put_be32(pb,size+1+11);

It may be simplified with something like this:

vp6 = (enc->codec_id == CODEC_ID_VP6) || (enc->codec_id == CODEC_ID_VP6F);
put_be32(pb,size+1+vp6+11);

(and note that the vp6 variable could be used in the same situation
just a few lines upper)

And my proposed simplification may very well belong to a separate patch.

Aurel




More information about the ffmpeg-devel mailing list