html - 为什么我的智能手机不能播放视频?

标签 html video ffmpeg

我从帧创建视频,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>

最佳答案

  1. You must not use the type attribute when calling the video.

  2. You must manually call video.play()

  3. 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/

相关文章:

html - 谷歌浏览器自动填充删除背景图片

javascript - 单击该 div 中的按钮后隐藏 div

android - 需要首先通过缓冲而不下载完整视频来在 videoview 中播放视频。有这方面的图书馆吗?

javascript - 悬停播放 HTML5 视频导致海报不显示,视频延迟

android - Xamarin Android 中 Xuggle-Xuggler/FFmpeg 的替代品?

jquery .dotdotdot 不工作

html - 使CSS框从四面八方旋转

opencv - 如何使用 OpenCV_Contrib 检测视频中的地标?

ffmpeg - 在 ffmpeg 或 avconv 中明确加入 MP3 - 什么是神奇的代码行?

bash - ffmpeg - bash 脚本淡出音频文件