opus in MP4 support is experimental, add ‘-strict -2‘ if you want to use it. Could not write header

使用ffmpeg合并视频和音频报错:opus in MP4 support is experimental, add '-strict -2' if you want to use it. Could not write header Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #1:0 -> #0:1 (copy) Last message repeated 1 times在这里插入图片描述

解决办法

1

但是经过测试,合并速度极慢

  • 前台合并
    ffmpeg -i x.mp4 -i y.mp3 -acodec copy -strict -2   xy.mp4 
    
    后台合并
    ffmpeg -i x.mp4 -i y.mp3 -acodec copy -strict -2   xy.mp4 -y -loglevel quiet
    

2

经测验合并速度很快

  • 前台合并
    ffmpeg -i x.mp4 -i y.mp3 -c:v copy -c:a aac -strict -2   xy.mp4  
    
    后台合并
    ffmpeg -i x.mp4 -i y.mp3 -c:v copy -c:a aac -strict -2  xy.mp4 -y -loglevel quiet
    

猜你喜欢

转载自blog.csdn.net/a12355556/article/details/115287654