我正在开发一个使用ffmpeg的电子应用程序,我在win10机器上开发,所以我使用命令提示符,我已经安装了npm包 "ffmpeg-ffprobe-static"。我可以在终端通过调用该包来运行ffmpeg命令,就像这样。
C:\Users\martin\myproject\node_modules\ffmpeg-ffprobe-static>ffmpeg.exe -h
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文件,所以这些比利-马丁的歌曲在vlc中可以完全正常播放,但却导致ffmpeg崩溃。
//running this command:
ffmpeg.exe -i "G:\RenderTune broken files\broken flac example\05 - Billy Martin - Phillie Dog.flac" -i "G:\RenderTune broken files\broken flac example\08 - 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\5. Gossip.flac" -i "G:\RenderTune broken files\working flac example\6. 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"
我试着像许多帖子建议的那样,在我的ffmpeg命令中加入-max_muxing_queue_size 9999
,但这并没有解决这个问题,有谁知道如何防止这个错误吗?
我尝试了其中的一个解决方案。
ffmpeg.exe -y -i "G:\RenderTune broken files\working flac example\5. Gossip.flac" -i "G:\RenderTune broken files\working flac example\6. 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%