简体   繁体   English

html5视频无法在ipad上播放任何mp4编码

[英]html5 video wont play ANY mp4 encodes on ipad

Im trying to embed a mp4 on a page with the HTML5 video tag. 我试图在带有HTML5视频标签的页面上嵌入mp4。 Everything works fine on Desktop but nothing will work on an iPad Version 9.3.4. 在台式机上一切正常,但在iPad版本9.3.4上无任何效果。 I have the mime types in an .htaccess file. 我在.htaccess文件中有mime类型。 I've tried various encodes with handbrake, Miro and FFmpeg conversions. 我尝试了手刹,Miro和FFmpeg转换的各种编码。

Even sample videos like at w3schools and videojs don't play. 甚至w3schoolsvideojs之类的示例视频也无法播放。 The video will play if i actually sync it to the iPad, but nothing works over the web. 如果我实际上将其同步到iPad,则可以播放该视频,但是在网络上没有任何效果。 An older iPad actually plays mp4s through the HTML5 video player. 较旧的iPad实际上通过HTML5视频播放器播放mp4。 I'm ready to throw this POS iPad through a window. 我已经准备好将此POS iPad扔进窗户。

 <video autoplay="false" width="320" height="240" controls="true" id='video'>
  <source src="http://webnamehere.com/video/bunny.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>

Your browser does not support the video tag.

Has anyone found a way to fix this? 有没有人找到解决此问题的方法? Is there ANY encoding that this thing will actually play? 这个东西实际上会播放任何编码吗? Thank you in advance for any help. 预先感谢您的任何帮助。

The mp4 might need the correct Profile to play on that device. mp4可能需要正确的配置文件才能在该设备上播放。

If you convert with ffmpeg, try adding 如果您使用ffmpeg进行转换,请尝试添加

-profile:v baseline -level 3.1 -movflags +faststart

See here the different profile levels. 在这里查看不同的配置文件级别。 https://trac.ffmpeg.org/wiki/Encode/H.264#Compatibility https://trac.ffmpeg.org/wiki/Encode/H.264#Compatibility

Here is a full command: 这是完整的命令:

ffmpeg -i "video.mp4" -y -vcodec libx264 -crf 18 -pix_fmt yuv420p -qcomp 0.8 -preset medium -acodec aac -b:a 400k -x264-params ref=4 -profile:v baseline -level 3.1 -movflags +faststart "video.mp4"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM