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

Use ffmpeg to merge video and audio to report an error: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 timesInsert picture description here

Solution

1

But after testing, the merge speed is extremely slow

  • Front desk merge
    ffmpeg -i x.mp4 -i y.mp3 -acodec copy -strict -2   xy.mp4 
    
    Background merge
    ffmpeg -i x.mp4 -i y.mp3 -acodec copy -strict -2   xy.mp4 -y -loglevel quiet
    

2

Tested to merge quickly

  • Front desk merge
    ffmpeg -i x.mp4 -i y.mp3 -c:v copy -c:a aac -strict -2   xy.mp4  
    
    Background merge
    ffmpeg -i x.mp4 -i y.mp3 -c:v copy -c:a aac -strict -2  xy.mp4 -y -loglevel quiet
    

Guess you like

Origin blog.csdn.net/a12355556/article/details/115287654