[Ffmpeg-devel] [PATCH] VP6 to flv muxing
Benjamin Larsson
banan
Thu Nov 30 21:31:33 CET 2006
Benjamin Larsson wrote:
>M?ns Rullg?rd wrote:
>
>
>
>>Benjamin Larsson <banan at student.ltu.se> writes:
>>
>>
>>
>>
>>
>>>Hi,
>>>
>>>Michael Niedermayer wrote:
>>>
>>>
>>>
>>>
>>>
>>>>if you add a byte during flv muxing, shouldnt you remove i during flv
>>>>demuxing?
>>>>
>>>>[...]
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>That could be done or define a new codec id and let that decoder handle
>>>the extra byte.
>>>
>>>
>>>
>>>
>>I don't like that idea at all. If one container requires some extra
>>stuff, then it's the responsibility of the demuxer to deal with it.
>>It's unfortunate when this happens, but there is no other sensible way
>>to handle it.
>>
>>
>>
>>
>>
>Ok, point taken. This patch adds the vp6 in flv demuxer part. But as
>long as we don't have a native vp6 decoder and mplayer refuses to use
>the lavf demuxer to demux vp6 files with the binary decoder, the patch
>is quite useless. And currently mencoder with the binary vp6 encoder
>only encodes vp6 content with default settings so it's quite useless.
>Based on that I'm holding of the muxer commit until the it's possible to
>set quality properly. And the decoder commit will have to wait until
>lavf flv demuxing is possible or a native decoder is presented. A native
>decoder should be able to detect that extra byte so the patch might be
>useless anyway.
>
>MvH
>Benjamin Larsson
>
>
Now that there is a patch for mencoder for vfw encoder settings. How
about committing the following part or some code with the same
functionality.
MvH
Benjamin Larsson
>
>
>Index: libavformat/flvenc.c
>===================================================================
>--- libavformat/flvenc.c (revision 5466)
>+++ libavformat/flvenc.c (working copy)
>@@ -141,7 +141,10 @@
>
> if (enc->codec_type == CODEC_TYPE_VIDEO) {
> put_byte(pb, 9);
>- flags = 2; // choose h263
>+ if (enc->codec_id == CODEC_ID_VP6)
>+ flags = 4;
>+ else
>+ flags = 2; // choose h263
> flags |= pkt->flags & PKT_FLAG_KEY ? 0x10 : 0x20; // add keyframe indicator
> flv->hasVideo = 1;
> } else {
>@@ -155,11 +158,15 @@
> // We got audio! Make sure we set this to the global flags on closure
> flv->hasAudio = 1;
> }
>-
>- put_be24(pb,size+1); // include flags
>+ if (enc->codec_id == CODEC_ID_VP6)
>+ put_be24(pb,size+2);
>+ 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);
> put_buffer(pb, pkt->data, size);
> put_be32(pb,size+1+11); // previous tag size
>
>
>
--
new tiny signature
More information about the ffmpeg-devel
mailing list