我从帧创建视频,ffmpeg 没有声音:
ffmpeg -f image2 -r 1 -i "img%d.png" -vcodec libx264 -pix_fmt yuv420p -movflags faststart x.mp4
在台式机上,一切顺利。但在智能手机上,Firefox 说:
no video with supported format and MIME type found.
源图像为 1024x768。我能做什么? HTML5 是:
<video controls autoplay>
<source type="video/mp4" src="/x.mp4"></source>
</video>
最佳答案
You must not use the type attribute when calling the video.
You must manually call video.play()
The video must be encoded to some quite strict parameters; using the iPhone setting on Handbrake with the 'Web Optimized' button checked usually does the trick.
这是html:
<video id="video" autobuffer height="240" width="360">
<source src="BigBuck.m4v">
<source src="BigBuck.webm" type="video/webm">
<source src="BigBuck.theora.ogv" type="video/ogg">
</video>
这是css:
var video = document.getElementById('video');
video.addEventListener('click',function(){
video.play();
},false);
请看看这个。
HTML5 <video> element on Android
关于html - 为什么我的智能手机不能播放视频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31179881/