[Libav-user] multiple flushes, extended_data is not set, streamable mp4

Bartosz Putrycz bputrycz at gmail.com
Thu Oct 25 10:58:38 CEST 2012


I have a few questions.

It would be a little difficult to provide a short piece of example of my 
so, some initial data:
I am trying to use ffmpeg libraries to encode/mux to a few formats,
but for questions 1-2 below, it is enough to say it is mp3 (libmp3lame).
I use my own non-seekable AVIO.
Version of ffmpeg: 0.11.1.

It happens that when samples are finished,
I have to "flush" (by sending an empty frame to avcodec_encode_audio2() 
) _more than once_.
I am doing it a few times until I don't get return packet.
Is it a standard behaviour or am I doing something wrong?

Looking into avcodec.h it says
that AVFrame.extended_data is unused in encoding.
But without touching it, I am getting a lot of annoying warnings 
"extended_data is not set".
Could I / Should I handle it with something like:
frame->extended_data = frame->data;

About: mp4 does not support not seakable output.
Here is some discussion:
The workaround is something implemented only in ffmpeg, or is it a 
feature specified in standard?
Is here an another thread or some site with more explanation of this issue?
Is somewhere an example of code with implementation of fragmentation 
and/or streaming of mp4 using libav libraries.


More information about the Libav-user mailing list