Search code examples
ffmpegx264libx264

How to limit the backward dependency between coded frames in ffmpeg/x264


I am currently playing with ffmpeg + libx264, but i couldn't find a way to limit the backward dependency between coded frames.

Let me explain what i mean: I want the coded frames to only contain references to at most, let's say, 5 frames in the future. As a result, no frame has to "wait" for more than 5 frames to be coded (makes sense for low latency applications).

I am aware of the -tune zerolatency option, but that's not what i want; I still want bidirectional prediction.


Solution

  • If you mean to limit the number of consecutive B-frames then you can use the --bframes <integer> x264 option or the -bf <integer> FFmpeg option.

    See also: Diary Of An x264 Developer - x264: the best low-latency...