ffmpeg 轉檔時,出現錯誤:
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 -
maybe incorrect parameters such as bit_rate, rate, width or height
可能是原始影片的 width/height 非偶數
加上參數即可:
-vf "scale=trunc(iw/2)2:trunc(ih/2)2"
例如:
ffmpeg -i source.mp4 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" output.mp4