FFMPEG converted mp4 file does not play in firefox and chrome

后端 未结 8 2080
刺人心
刺人心 2020-12-28 09:28

I have used FFMPEG command to convert flv video file to mp4 and use html5 video tag and play video in browser. But after the video is converted to mp4 using ffmpeg it does n

8条回答
  •  余生分开走
    2020-12-28 09:47

    This is what you need. I recently found myself fighting the same problem.

    Add this to your command:

    -pix_fmt yuv420p
    

    If you don't specify the pix_fmt it defaults to yuv444p which doesn't seem to be compatible with current browsers.

    The full command I'm successfully testing with is:

    ffmpeg -y -i "INPUT-FILE" -c:v libx264 -preset slow -crf 22 -pix_fmt yuv420p -c:a libvo_aacenc -b:a 128k "OUTPUT-FILE"
    

    Put your input, output paths inside the quotes and try that to get started. Plays in current IE, Firefox, and Chrome. I'm using the built in aac encoder for audio.

提交回复
热议问题