Programster's Blog

Tutorials focusing on Linux, programming, and open-source

FFmpeg - Too many packets buffered for output stream

When I was trying to convert a very large 2160p HEVC video, I got the error message:

Too many packets buffered for output stream 0:1 

Luckily, one can work around this issue by simply adding

-max_muxing_queue_size 1024 the end of your command (just before specifying the output). E.g.

ffmpeg \
  -i "My.Movie.2160p.x265.mkv" \
  -c:a copy  \
  -c:v libx264  \
  -preset medium \
  -x264-params \
  crf=18 \
  -max_muxing_queue_size 1024 \

The manual for FFmpeg states:

-max_muxing_queue_size packets (output,per-stream)

When transcoding audio and/or video streams, ffmpeg will not begin writing into the output until it has one packet for each such stream. While waiting for that to happen, packets for other streams are buffered. This option sets the size of this buffer, in packets, for the matching output stream.

The default value of this option should be high enough for most uses, so only touch this option if you are sure that you need it.


Last updated: 19th September 2021
First published: 19th September 2021