我正在开发一个使用ffmpeg的电子应用程序,我正在win10机器上开发,所以我使用命令提示符,我已经安装了npm包‘ffmpeg-ff探针-静态’。通过调用包,我可以在终端中运行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!
同样的命令也适用于其他的vlc文件,所以在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"
我尝试过添加-max_muxing_queue_size 9999
到我的ffmpeg命令中,就像许多帖子建议的那样,但是这并不能解决它,有人知道如何防止这个错误吗?
编辑--我尝试了一种发布的解决方案:
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%
发布于 2021-03-31 02:16:14
与专辑艺术形象有关的东西是不对的。忽略它,向您的concat过滤器输出添加一个输出标签,并且只对连接的音频进行映射:
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"
否则,默认流选择将选择过滤器输出加上损坏的图像,从而导致问题中显示的错误。
发布于 2022-02-06 14:08:01
这解决了我的问题(后来说的是断旗,但这很容易通过重新调整或播放设置来解决)。
Linux 21.04,ffmpeg ffmpeg版本4.2.3
文件示例:这里 (几天)
ffmpeg -fflags +genpts -i peta_alien.ogv -map 0 -c:v copy -c:a aac -max_muxing_queue_size 4000 peta_alien.avi
https://stackoverflow.com/questions/66880338
复制相似问题