264编码MP4在Safari上播放

264编码MP4在Safari上播放

本文介绍了以HTML5呈现的H.264编码MP4在Safari上播放,但不在iOS设备上播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Adobe Media Encoder CS5将FLV文件编码为H.264,以通过HTML5在网络上呈现,并且视频文件在OS X中的Safari中(以及编码为OGG的Firefox中)播放得很好,但在任何iOS设备(iPad,iPhone)我得到了带有斜线的播放图标。



有没有人遇到过这种情况,如果有的话,有什么想法吗? / p>

谢谢。

解决方案

我们遇到了这个问题并发现编码文件符合iPhone的webview标准创建的文件播放正常。



并非所有H.264编码的Mp4文件都受iPhone(或Chrome支持)的支持,在编码过程中可以产生不起作用的视频。即使使用了相同的编码设置,H.264也是一种可变比特率编码器,因此不同的视频可能会超过比特率限制,导致一些工作而其他不工作。

我们成功的编码设置为:




  • 仅使用H.264 Baseline Profile Level 3.0

  • 分辨率低于640 x 480,帧率高达30 fps
  • B基准配置文件不支持B帧。

  • 比特率限制900kb。



这是我们曾经达到这些设置。

I'm using Adobe Media Encoder CS5 to encode a FLV file to H.264 to present on the web via HTML5 and the video file plays just fine in Safari in OS X (and in Firefox encoded to OGG) but on any iOS device (iPad, iPhone) I get the play icon with the slash running through it.

Has anyone encountered this before and if so, any ideas as to why?

Thanks.

解决方案

We had this problem and found that encoding the files in accordance with iPhone's webview's standards created files that played fine.

Not all H.264 encoded Mp4 files are supported by iPhone (or Chrome for that matter) and slight differences in the encoding process can produce videos that do not work. Even if the EXACT same encoding settings were used, H.264 is a variable bit-rate encoder, so different videos may exceed bitrate limits, causing some to work and other not.

The encoding settings that were successful for us were:

  • Only use the H.264 Baseline Profile Level 3.0
  • Resolution below 640 x 480 and framerate up to 30 fps
  • B frames are not supported in the Baseline profile.
  • bitrate limit of 900kb.

Here is the reference we used to arrive at those settings.

这篇关于以HTML5呈现的H.264编码MP4在Safari上播放,但不在iOS设备上播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 02:41