Ffmpeg h.264 video plays in Safari but not in Chrome

I use ffmpeg to encode raw .MOV video into H.264 compressed video to display on the html5 website. I use the following line to encode the video:

ffmpeg -y \ -i in.mov -b 3500k -bt 4000k \ -acodec libfaac -ac 2 -ar 48000 -ab 192k \ -vcodec libx264 -vpre ultrafast -vpre baseline \ out.mp4 

The resulting video looks great and works great in Safari, but Chrome cannot recognize it. Any ideas?

Thanks.

+4
source share
2 answers

I think Chrome has refused support for h264 because Google only wants to use open codecs that do not have patents for them, such as WebM.

0
source

Google has announced that it is dropping support for H.264 in Chrome. However, this was more than a year ago, and they never sought a deadline.

Meanwhile, I reproduced the same problem described in this post. In the end, I figured out how to make it work. In the original question, the video tag used is not specified. I found that if you simply specify:

 <video src="file.mp4"></video> 

and the video starts with a black frame that doesn't seem to work (just a black box that doesn't do anything). Either specify "autoplay =" true "to start playback automatically, or" controls = "yes" "to display playback controls.

0
source

Source: https://habr.com/ru/post/1387647/


All Articles