[Ffmpeg-devel] [PATCH] support for VP6 and FLASHSV in the flv muxer

Michael Niedermayer michaelni
Sat Dec 16 01:30:01 CET 2006


Hi

On Fri, Dec 15, 2006 at 11:45:43PM +0100, Benjamin Larsson wrote:
[...]
> Revised patch.
> 
> MvH
> Benjamin Larsson
> 
> -- 
> new tiny signature
> 

> Index: libavformat/flvenc.c
> ===================================================================
> --- libavformat/flvenc.c	(revision 7320)
> +++ libavformat/flvenc.c	(working copy)
> @@ -235,7 +235,17 @@
>  
>      if (enc->codec_type == CODEC_TYPE_VIDEO) {
>          put_byte(pb, FLV_TAG_TYPE_VIDEO);
> -        flags = FLV_CODECID_H263;
> +
> +        switch (enc->codec_id) {
> +            case CODEC_ID_FLV1:     flags = FLV_CODECID_H263; break;
> +            case CODEC_ID_FLASHSV:  flags = FLV_CODECID_SCREEN; break;
> +            case CODEC_ID_VP6F:
> +            case CODEC_ID_VP6:      flags = FLV_CODECID_VP6; break;
> +
> +            default:
> +                av_log(s, AV_LOG_INFO, "Unsupported video codec (%x)\n", enc->codec_id);
> +                return -1;
> +        }

wasnt there a CODEC_ID <-> FLV_CODECID table somewhere? if no it should be
added and used in muxer and demuxer


>          flags |= pkt->flags & PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER;
>      } else {
>          assert(enc->codec_type == CODEC_TYPE_AUDIO);
> @@ -246,10 +256,15 @@
>          put_byte(pb, FLV_TAG_TYPE_AUDIO);
>      }
>  
> -    put_be24(pb,size+1); // include flags
> +    if (enc->codec_id == CODEC_ID_VP6)
> +        put_be24(pb,size+2); // include the extra byte needed for VP6 in flv and flags
> +    else
> +        put_be24(pb,size+1); // include flags
>      put_be24(pb,pkt->pts);
>      put_be32(pb,flv->reserved);
>      put_byte(pb,flags);
> +    if (enc->codec_id == CODEC_ID_VP6)
> +        put_byte(pb,0);

shouldnt that rather be extradata[0] ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali




More information about the ffmpeg-devel mailing list