Opened 5 months ago

Last modified 3 weeks ago

#6472 open defect

Conversion failed! by Too many packets buffered for output stream 0:0. in wmv

Reported by: ponpon Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Thank you for the good commands.

I have Conversion failed in wmv.
Its source is http://www.encode-service.jp/sample/000_3M_60fps_CBR.wmv.

ffmpeg -i 000_3M_60fps_CBR.wmv -f null -
ffmpeg version N-86499-g1edbf5e20c Copyright (c) 2000-2017 the FFmpeg developers
  built with clang version 3.9.1 (tags/RELEASE_391/final)
  configuration: --prefix=/sw --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --cc=clang-mp-3.9 --cxx=clang++-mp-3.9 --extra-cflags=' -march=native -I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldlibflags='-L/sw/lib -L/opt/local/lib -static' --target-os=darwin --arch=x86_64 --cpu=corei7-avx --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-openssl --enable-gnutls --enable-gcrypt --enable-gmp --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-libsmbclient --enable-libcdio --enable-opengl --enable-opencl --disable-vda --pkg-config-flags=' --libs --static'
  libavutil      55. 66.100 / 55. 66.100
  libavcodec     57. 99.100 / 57. 99.100
  libavformat    57. 73.100 / 57. 73.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 92.100 /  6. 92.100
  libavresample   3.  6.  0 /  3.  6.  0
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, asf, from '000_3M_60fps_CBR.wmv':
  Metadata:
    WMFSDKNeeded    : 0.0.0.0000
    DeviceConformanceTemplate: L2
    WM/WMADRCPeakReference: 32767
    WM/WMADRCAverageReference: 6147
    WMFSDKVersion   : 10.00.00.3802
    IsVBR           : 0
    title           : 動画サンプル -桜- 3Mbps 59.94fps
    copyright       : アイ・ビー・アイ株式会社
  Duration: 00:00:34.83, start: 0.000000, bitrate: 3091 kb/s
    Stream #0:0(jpn): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x480, 2936 kb/s, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc
    Stream #0:1(jpn): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, stereo, fltp, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (wmv3 (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (wmav2 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Too many packets buffered for output stream 0:0.
Conversion failed!

Change History (6)

comment:1 Changed 5 months ago by ponpon

This issue don't happen under the git master.
I don't know which commit improve.
If noboby reproduce this issue, please close this ticket.

ffmpeg -i 000_3M_60fps_CBR.wmv -f null -
ffmpeg version N-86691-gc8853568b1 Copyright (c) 2000-2017 the FFmpeg developers
  built with clang version 3.9.1 (tags/RELEASE_391/final)
  configuration: --prefix=/sw --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --cc=clang-mp-3.9 --cxx=clang++-mp-3.9 --extra-cflags=' -march=native -I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldlibflags='-L/sw/lib -L/opt/local/lib -static' --target-os=darwin --arch=x86_64 --cpu=corei7-avx --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-openssl --enable-gnutls --enable-gcrypt --enable-gmp --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-libsmbclient --enable-libcdio --enable-opengl --enable-opencl --disable-vda --pkg-config-flags=' --libs --static'
  libavutil      55. 67.100 / 55. 67.100
  libavcodec     57.100.103 / 57.100.103
  libavformat    57. 75.100 / 57. 75.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 94.100 /  6. 94.100
  libavresample   3.  6.  0 /  3.  6.  0
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, asf, from '000_3M_60fps_CBR.wmv':
  Metadata:
    WMFSDKNeeded    : 0.0.0.0000
    DeviceConformanceTemplate: L2
    WM/WMADRCPeakReference: 32767
    WM/WMADRCAverageReference: 6147
    WMFSDKVersion   : 10.00.00.3802
    IsVBR           : 0
    title           : 動画サンプル -桜- 3Mbps 59.94fps
    copyright       : アイ・ビー・アイ株式会社
  Duration: 00:00:34.83, start: 0.000000, bitrate: 3091 kb/s
    Stream #0:0(jpn): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x480, 2936 kb/s, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc
    Stream #0:1(jpn): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, stereo, fltp, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (wmv3 (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (wmav2 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    WMFSDKNeeded    : 0.0.0.0000
    DeviceConformanceTemplate: L2
    WM/WMADRCPeakReference: 32767
    WM/WMADRCAverageReference: 6147
    WMFSDKVersion   : 10.00.00.3802
    IsVBR           : 0
    title           : 動画サンプル -桜- 3Mbps 59.94fps
    copyright       : アイ・ビー・アイ株式会社
    encoder         : Lavf57.75.100
    Stream #0:0(jpn): Video: wrapped_avframe, yuv420p, 640x480, q=2-31, 200 kb/s, 59.94 fps, 59.94 tbn, 59.94 tbc
    Metadata:
      encoder         : Lavc57.100.103 wrapped_avframe
    Stream #0:1(jpn): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      encoder         : Lavc57.100.103 pcm_s16le
frame= 2088 fps=915 q=-0.0 Lsize=N/A time=00:00:34.86 bitrate=N/A speed=15.3x    
video:1077kB audio:6544kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

comment:2 Changed 6 weeks ago by ponpon

This error happens since commit 1daacba91f7c8a29858fb2de58f8695f33308fa7, again.
A sample is https://web.archive.org/web/20161110194857/http://encode-service.jp/sample/000_3M_60fps_CBR.wmv.

ffmpeg -i "000_3M_60fps_CBR.wmv" -f null /dev/null
ffmpeg version N-86889-g1daacba91f Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 8.1.0 (clang-802.0.42)
  configuration: --prefix=/sw --disable-vda
  libavutil      55. 69.100 / 55. 69.100
  libavcodec     57.102.100 / 57.102.100
  libavformat    57. 76.100 / 57. 76.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 95.100 /  6. 95.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, asf, from '000_3M_60fps_CBR.wmv':
  Metadata:
    WMFSDKNeeded    : 0.0.0.0000
    DeviceConformanceTemplate: L2
    WM/WMADRCPeakReference: 32767
    WM/WMADRCAverageReference: 6147
    WMFSDKVersion   : 10.00.00.3802
    IsVBR           : 0
    title           : 動画サンプル -桜- 3Mbps 59.94fps
    copyright       : アイ・ビー・アイ株式会社
  Duration: 00:00:34.83, start: 0.000000, bitrate: 3091 kb/s
    Stream #0:0(jpn): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x480, 2936 kb/s, 59.94 fps, 59.94 tbr, 1k tbn, 1k tbc
    Stream #0:1(jpn): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, stereo, fltp, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (wmv3 (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (wmav2 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Too many packets buffered for output stream 0:0.
Conversion failed!

If

@@ -239,6 +258,12 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx,
     if ((ret = ctx->output_pads[0].request_frame(ctx->outputs[0])) < 0)
         return ret;
 
+    if ((flags & AV_BUFFERSRC_FLAG_PUSH)) {
+        ret = push_frame(ctx->graph);
+        if (ret < 0)
+            return ret;
+    }
+
     return 0;
 }

in the patch to buffersrc.c is deleted, this error don't happen. Moreover, the errors of ffmpeg_bug_report.mp4 of ticket #6375 and Vertical400kbit.sorenson3.mov of ticket #6705 don't happen, also.
If the other in the patch to buffersrc.c is deleted, the error of too_many_packets_buffered_example.mp4 of ticket #6375 doesn't happen.
All of "Too many packets buffered for output stream" message searched in trac disappear by this delete.
I don't know if this delete is proper. And I don't try this delete in the master 0a499d6a57409926011e1952fcf7ca39224663d6 because buffersrc.c is modified in commit 5ba2aef6ec47689300debd3ddd1f39cad010a971

Last edited 6 weeks ago by ponpon (previous) (diff)

comment:3 Changed 6 weeks ago by ponpon

I try to delete only

+    if ((flags & AV_BUFFERSRC_FLAG_PUSH)) {
+        ret = push_frame(ctx->graph);
+        if (ret < 0)
+            return ret;
+    }
+
     return 0;
 }

in the master. The errors of 000_3M_60fps_CBR.wmv, ffmpeg_bug_report.mp4 of ticket #6375 and Vertical400kbit.sorenson3.mov of ticket #6705 don't happen.

For too_many_packets_buffered_example.mp4 of ticket #6375, the below message appears.

[out_0_1 @ 0x7fb3801004e0] 100 buffers queued in out_0_1, something may be wrong.
ffmpeg -i too_many_packets_buffered_example.mp4 -f null -
ffmpeg version N-87737-g0a499d6a57 Copyright (c) 2000-2017 the FFmpeg developers
  built with clang version 5.0.0 (tags/RELEASE_500/final)
  configuration: --prefix=/sw 
  libavutil      55. 77.101 / 55. 77.101
  libavcodec     57.106.104 / 57.106.104
  libavformat    57. 82.102 / 57. 82.102
  libavdevice    57.  9.101 / 57.  9.101
  libavfilter     6.106.100 /  6.106.100
  libavresample   3.  6.  0 /  3.  6.  0
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'too_many_packets_buffered_example.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.25.101
  Duration: 00:00:32.46, start: 0.000000, bitrate: 133 kb/s
    Stream #0:0(und): Audio: aac (Main) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:1(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1024x768, 4 kb/s, 1.95 fps, 100 tbr, 19200 tbn, 1200 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> wrapped_avframe (native))
  Stream #0:0 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.82.102
    Stream #0:0(und): Video: wrapped_avframe, yuv420p, 1024x768, q=2-31, 200 kb/s, 100 fps, 100 tbn, 100 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.106.104 wrapped_avframe
    Stream #0:1(und): Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc57.106.104 pcm_s16le
[out_0_1 @ 0x7fb3801004e0] 100 buffers queued in out_0_1, something may be wrong.
frame=   48 fps=0.0 q=-0.0 Lsize=N/A time=00:00:32.46 bitrate=N/A speed= 386x    

comment:4 follow-up: Changed 6 weeks ago by Cigaes

If your change makes the error disappear after the filters but reappears within libavfilter, then it is not an enhancement at all, probably the opposite. This is exactly what is happening here: the error means that frames were accumulating in the muxing buffer after filtering and (dummy) encoding, now they are accumulating in buffersink. It seems to work better because buffersink does not have a limit, but the frames are still accumulating. Even worse, since they are accumulating in libavfilter, they are accumulating as real frames, not encoded packets, possibly immensely larger.

It is my belief that the scheduling in libavfilter is now mostly correct and that the problem lies after libavfilter.

comment:5 in reply to: ↑ 4 Changed 6 weeks ago by ponpon

Replying to Cigaes:
Thank you for your explanation.
I could have understood the above delete hides the problems and results in worse results.
Please answer for one question. The errors disappear, using -max_muxing_queue_size in ticket #6375.
Concretely,

ffmpeg -i "000_3M_60fps_CBR.wmv" -max_muxing_queue_size 198 -f null /dev/null
ffmpeg -i "ffmpeg_bug_report.mp4" -max_muxing_queue_size 241 -f null /dev/null
ffmpeg -i "too_many_packets_buffered_example.mp4" -max_muxing_queue_size 329 -f null /dev/null
ffmpeg -i "Vertical400kbit.sorenson3.mov" -max_muxing_queue_size 690 -f null /dev/null

Is this treatment proper? Or should I wait the improvement of ffmpeg?

Thank you.

comment:6 Changed 3 weeks ago by cehoyos

  • Keywords regression added
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

Regression since af1761f7b5b1b72197dc40934953b775c2d951cc, another sample is fate-suite/svq3/Vertical400kbit.sorenson3.mov, ticket #6705.

Note: See TracTickets for help on using tickets.