Page 1 of 1

FFmpeg: "Too many packets buffered for output stream"

Posted: Tue Mar 17, 2020 3:43 pm
by peter_b
[PROBLEM]
With some files, I get the following error when transcoding from FFV1/PCM/MKV to H.264/AAC/MP4:
Too many packets buffered for output stream 0:0
The original camera source was DV (PAL), then converted to FFV1/PCM/MKV.

[SOLUTION]
In most cases, adding the following argument solved the issue:

Code: Select all

-max_muxing_queue_size 1024
In some rare cases it doesn't.

Possibly related FFmpeg issue #6375: "Too many packets buffered for output stream"

Re: FFmpeg: "Too many packets buffered for output stream"

Posted: Tue Mar 17, 2020 4:12 pm
by peter_b
I've encountered a case where increasing "-max_muxing_queue_size" up to 9999 didn't help.

It was actually so that the audio stream seemed to be broken or contain no data? (not silence)
It turned out that the DV camera original was already faulty.

Trying to extract the source audio (just to check), returned this:
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Command used to do this:

Code: Select all

$ ffmpeg -i DV_ORIGINAL.mov -vn -c:a copy -map 0:a archive/audio.wav
Technical metadata of the source file:

Code: Select all

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'DV-013201.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2016-05-30T20:24:18.000000Z
  Duration: 02:03:41.84, start: 0.000000, bitrate: 30512 kb/s
    Stream #0:0(und): Video: dvvideo (dvcp / 0x70637664), yuv420p(smpte170m/bt470bg/bt709, bottom coded first (swapped)), 720x576 [SAR 16:15 DAR 4:3], 28800 kb/s, SAR 59:54 DAR 295:216, 25 fps, 25 tbr, 25k tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2016-05-30T20:24:18.000000Z
      handler_name    : Core Media Data Handler
      encoder         : DV - PAL
      timecode        : 00:00:01:02
    Stream #0:1(und): Audio: pcm_s16le (lpcm / 0x6D63706C), 32000 Hz, stereo, s16, 1024 kb/s (default)
    Metadata:
      creation_time   : 2016-05-30T20:24:18.000000Z
      handler_name    : Core Media Data Handler
    Stream #0:2(und): Data: none (tmcd / 0x64636D74), 0 kb/s
    Metadata:
      creation_time   : 2016-05-30T20:24:18.000000Z
      handler_name    : Core Media Data Handler
      reel_name       : Untitled Tape
      timecode        : 00:00:01:02