[FFmpeg-devel] Can BSF delay packets?

Ronald S. Bultje rsbultje at gmail.com
Mon Feb 6 14:42:31 EET 2017


Hi Aleksey,

On Mon, Feb 6, 2017 at 5:18 AM, Aleksey M <hex000 at gmail.com> wrote:

> Hi dear FFMPEG contributors,
>
> Does the bitstream filter (BSF) interface allow to delay packets?
>
> From Luca's description
> https://blogs.gentoo.org/lu_zero/2016/03/21/bitstream-filtering/
> it looks like it can produce any number of output packets or consume any
> number of input packets.
>
> But any attempt to return AVERROR(EAGAIN) results in FFMPEG interrupting
> processing saying 'Timestamps are unset in a packet...H.264 bitstream
> malformed".
>
> Could anyone point me in the right direction? Or give a working example of
> just delaying by a single packet?
>
> For example, should this filter consume all input packets without producing
> output?
>
>     AVPacket* in = NULL;
>     int result = ff_bsf_get_packet(ctx, &in);
>
>     if (result < 0)
>         return result;
>
>     av_packet_free(&in);
>     return AVERROR(EAGAIN);
>
> But it interrupts processing.


Just return 0, not EAGAIN. Delay is allowed, yes.

Ronald


More information about the ffmpeg-devel mailing list