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

Benjamin Larsson banan
Tue Jan 2 00:10:38 CET 2007


Benjamin Larsson wrote:

>Michael Niedermayer wrote:
>
>  
>
>>[...]
>>
>>    
>>
>>>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
>>
>> 
>>
>>    
>>
>
>Commited the pending patch and used the table.
>
>
>  
>
>>>        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] ?
>>
>>[...]
>> 
>>
>>    
>>
>
>Added the code suggestion from Aurel. Regressions passed. Ok to commit ?
>
>MvH
>Benjamin Larsson
>  
>

Applied.

MvH
Benjamin Larsson

-- 
new tiny signature





More information about the ffmpeg-devel mailing list