[libav-api] H264 and FLV

Mark Kenna mark.kenna at sureviewsystems.com
Mon Jun 20 13:10:29 CEST 2011


On 17/06/2011 16:46, Ronald S. Bultje wrote:
> Hi Mark,
>
> On Fri, Jun 17, 2011 at 10:08 AM, Mark Kenna
> <mark.kenna at sureviewsystems.com>  wrote:
>> On 17/06/2011 14:38, Ronald S. Bultje wrote:
>>> On Fri, Jun 17, 2011 at 8:54 AM, Mark Kenna
>>> <mark.kenna at sureviewsystems.com>    wrote:
>>>> In my application I take various video data formats and transcode them to
>>>> FLV (H264/AAC). My question is this:
>>>>
>>>> If the input format were H264, is there any way that I can just put this
>>>> into an FLV container (using av_write_frame/av_interleaved_write_frame)
>>>> without having to decode and then re-encode it?
>>> ffmpeg-the-commandlinetool has the -vcodec copy option for that. It's
>>> a little more complex because H264 can be annexB or MP4 (see the
>>> bitstream filter), so you may have to convert between the two, but
>>> other than that it pretty much "just works", yes.
>>>
>>> Ronald
>> Hi Ronald
>>
>> Assuming that the the H264 is in the correct format for FLV, would I have to
>> know exactly how much data to pass av_write_frame each time or can I just
>> pass it whatever I have available at the time?
> Not sure what you mean, is your source a network packetizer a la RTP
> or so? In that case, yes I do think you need packetized input, the
> H264 frame AVParser should be able to do that for you.
>
> Ronald

Hi Ronald

Thanks for the information - I was able to get something working but the 
CPU usage was nearly the same as if I just decoded the frame using 
avcodec_decode (so I stuck with the decode option).

Mark


More information about the libav-api mailing list