ffmpeg Error: Too many packets buffered for output stream
ffmpeg Error: Too many packets buffered for output stream
我正在开发一个使用 ffmpeg 的电子应用程序,我正在 win10 机器上开发,所以我使用命令提示符并且我已经安装了 npm 包 'ffmpeg-ffprobe-static'。我可以通过像这样调用包在终端中 运行 ffmpeg 命令:
C:\Users\martin\myproject\node_modules\ffmpeg-ffprobe-static>ffmpeg.exe -h
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200621
....
我有一个 ffmpeg 命令可以将两个 flac 文件组合成一个 mp3 文件,在我遇到这个错误之前一直运行良好:
[mjpeg @ 0000022537ace640] bits 85 is invalid
Error while decoding stream #0:1: Invalid data found when processing input
Too many packets buffered for output stream 0:0.
[libmp3lame @ 0000022537ac3480] 3 frames left in the queue on closing
Conversion failed!
相同的命令适用于其他 flac 文件,因此这些 Billy Martin 歌曲中有些东西可以在 vlc 中完美播放但会导致 ffmpeg 崩溃:
//running this command:
ffmpeg.exe -i "G:\RenderTune broken files\broken flac example - Billy Martin - Phillie Dog.flac" -i "G:\RenderTune broken files\broken flac example - Billy Martin - Stax.flac" -y -filter_complex concat=n=2:v=0:a=1 -c:a libmp3lame -b:a 320k "G:\RenderTune broken files\broken flac example\COMBINED_FILES.mp3"
//results in this output:
[mjpeg @ 0000022537ace640] bits 85 is invalid
Error while decoding stream #0:1: Invalid data found when processing input
Too many packets buffered for output stream 0:0.
[libmp3lame @ 0000022537ac3480] 3 frames left in the queue on closing
Conversion failed!
我在这里上传了损坏的 flac 文件:https://www.mediafire.com/folder/0v9hbfrap727y/broken+flac
如果我 运行 与其他 flac 文件使用相同的命令,它工作正常:
ffmpeg.exe -i "G:\RenderTune broken files\working flac example. Gossip.flac" -i "G:\RenderTune broken files\working flac example. Let The Children Play.flac" -y -filter_complex concat=n=2:v=0:a=1 -c:a libmp3lame -b:a 320k "G:\RenderTune broken files\working flac example\COMBINED_FILES.mp3"
我已经尝试像许多帖子建议的那样将 -max_muxing_queue_size 9999
添加到我的 ffmpeg 命令中,但这并没有解决它,有人知道如何防止这个错误吗?
[编辑]
我尝试了其中一种已发布的解决方案:
ffmpeg.exe -y -i "G:\RenderTune broken files\working flac example. Gossip.flac" -i "G:\RenderTune broken files\working flac example. Let The Children Play.flac" -filter_complex "[0:a][1:a]concat=n=2:v=0:a=1[a]" -map "[a]" -c:a libmp3lame -b:a 320k "G:\RenderTune broken files\working flac example\COMBINED_FILES.mp3"
因不同的错误而崩溃:
[libmp3lame @ 000002453725f3c0] Queue input is backward in time.9x
... lots of these [mp3 @ ..] messages
[mp3 @ 0000024537344400] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 2449071 >= 2445999
[mp3 @ 0000024537344400] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 2449071 >= 2447151
[mp3 @ 0000024537344400] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 2449071 >= 2448303
[flac @ 00000245372d4140] invalid residual315.7kbits/s speed=59.7x
[flac @ 00000245372d4140] decode_frame() failed
Error while decoding stream #1:0: Invalid data found when processing input
size= 24871kB time=00:10:37.09 bitrate= 319.8kbits/s speed=60.5x
video:0kB audio:24869kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.004673%
专辑封面图片出现问题。通过向 concat 过滤器输出添加输出标签来忽略它,并且仅 mapping 串联音频:
ffmpeg.exe -y -i "G:\RenderTune broken files\working flac example. Gossip.flac" -i "G:\RenderTune broken files\working flac example. Let The Children Play.flac" -filter_complex "[0:a][1:a]concat=n=2:v=0:a=1[a]" -map "[a]" -c:a libmp3lame -b:a 320k "G:\RenderTune broken files\working flac example\COMBINED_FILES.mp3"
否则 default stream selection 将选择过滤器输出加上损坏的图像,从而导致您的问题中显示的错误。
这解决了我的问题(后文提到了损坏的标志,但这很容易通过重新编码或调整设置来解决)。
Linux 21.04,ffmpeg
ffmpeg 版本 4.2.3
文件示例:here(几天)
ffmpeg -fflags +genpts -i peta_alien.ogv -map 0 -c:v copy -c:a aac -max_muxing_queue_size 4000 peta_alien.avi
我正在开发一个使用 ffmpeg 的电子应用程序,我正在 win10 机器上开发,所以我使用命令提示符并且我已经安装了 npm 包 'ffmpeg-ffprobe-static'。我可以通过像这样调用包在终端中 运行 ffmpeg 命令:
C:\Users\martin\myproject\node_modules\ffmpeg-ffprobe-static>ffmpeg.exe -h
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200621
....
我有一个 ffmpeg 命令可以将两个 flac 文件组合成一个 mp3 文件,在我遇到这个错误之前一直运行良好:
[mjpeg @ 0000022537ace640] bits 85 is invalid
Error while decoding stream #0:1: Invalid data found when processing input
Too many packets buffered for output stream 0:0.
[libmp3lame @ 0000022537ac3480] 3 frames left in the queue on closing
Conversion failed!
相同的命令适用于其他 flac 文件,因此这些 Billy Martin 歌曲中有些东西可以在 vlc 中完美播放但会导致 ffmpeg 崩溃:
//running this command:
ffmpeg.exe -i "G:\RenderTune broken files\broken flac example - Billy Martin - Phillie Dog.flac" -i "G:\RenderTune broken files\broken flac example - Billy Martin - Stax.flac" -y -filter_complex concat=n=2:v=0:a=1 -c:a libmp3lame -b:a 320k "G:\RenderTune broken files\broken flac example\COMBINED_FILES.mp3"
//results in this output:
[mjpeg @ 0000022537ace640] bits 85 is invalid
Error while decoding stream #0:1: Invalid data found when processing input
Too many packets buffered for output stream 0:0.
[libmp3lame @ 0000022537ac3480] 3 frames left in the queue on closing
Conversion failed!
我在这里上传了损坏的 flac 文件:https://www.mediafire.com/folder/0v9hbfrap727y/broken+flac
如果我 运行 与其他 flac 文件使用相同的命令,它工作正常:
ffmpeg.exe -i "G:\RenderTune broken files\working flac example. Gossip.flac" -i "G:\RenderTune broken files\working flac example. Let The Children Play.flac" -y -filter_complex concat=n=2:v=0:a=1 -c:a libmp3lame -b:a 320k "G:\RenderTune broken files\working flac example\COMBINED_FILES.mp3"
我已经尝试像许多帖子建议的那样将 -max_muxing_queue_size 9999
添加到我的 ffmpeg 命令中,但这并没有解决它,有人知道如何防止这个错误吗?
[编辑] 我尝试了其中一种已发布的解决方案:
ffmpeg.exe -y -i "G:\RenderTune broken files\working flac example. Gossip.flac" -i "G:\RenderTune broken files\working flac example. Let The Children Play.flac" -filter_complex "[0:a][1:a]concat=n=2:v=0:a=1[a]" -map "[a]" -c:a libmp3lame -b:a 320k "G:\RenderTune broken files\working flac example\COMBINED_FILES.mp3"
因不同的错误而崩溃:
[libmp3lame @ 000002453725f3c0] Queue input is backward in time.9x
... lots of these [mp3 @ ..] messages
[mp3 @ 0000024537344400] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 2449071 >= 2445999
[mp3 @ 0000024537344400] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 2449071 >= 2447151
[mp3 @ 0000024537344400] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 2449071 >= 2448303
[flac @ 00000245372d4140] invalid residual315.7kbits/s speed=59.7x
[flac @ 00000245372d4140] decode_frame() failed
Error while decoding stream #1:0: Invalid data found when processing input
size= 24871kB time=00:10:37.09 bitrate= 319.8kbits/s speed=60.5x
video:0kB audio:24869kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.004673%
专辑封面图片出现问题。通过向 concat 过滤器输出添加输出标签来忽略它,并且仅 mapping 串联音频:
ffmpeg.exe -y -i "G:\RenderTune broken files\working flac example. Gossip.flac" -i "G:\RenderTune broken files\working flac example. Let The Children Play.flac" -filter_complex "[0:a][1:a]concat=n=2:v=0:a=1[a]" -map "[a]" -c:a libmp3lame -b:a 320k "G:\RenderTune broken files\working flac example\COMBINED_FILES.mp3"
否则 default stream selection 将选择过滤器输出加上损坏的图像,从而导致您的问题中显示的错误。
这解决了我的问题(后文提到了损坏的标志,但这很容易通过重新编码或调整设置来解决)。
Linux 21.04,ffmpeg ffmpeg 版本 4.2.3
文件示例:here(几天)
ffmpeg -fflags +genpts -i peta_alien.ogv -map 0 -c:v copy -c:a aac -max_muxing_queue_size 4000 peta_alien.avi