为什么 mp4 视频在 iPad 上可以正常播放,而在 iPhone 上却不行?
我对这个问题很困惑。
我有一个大型 H.264 mp4 视频文件库,需要在 iOS 上播放。最初,我只针对 iPad,但要求发生了变化,现在我需要包括 iPhone。但我注意到,我的 iPod Touch 与我的 iPad 具有完全相同的操作系统版本和构建 ID,但无法播放我在 iPad 上成功使用的相同文件。我已经向一位同事证实了这一点,他也拥有相同版本的 iPhone 和 iPad。建造。我也在 iPad 模拟器中看到了完全相同的行为,但直到现在我还认为这是模拟器的一个怪癖。现在我不太确定了。
mp4 使用以下设置进行编码:
AVC Coding 640x360, Millions
AAC, Stereo (L R), 44.100 kHz
29.97 fps
693.35kb/s
我尝试从多个服务器甚至本地加载媒体,但似乎没有什么区别。
如果我从 QuickTime 将这些文件导出为 m4v 文件,它们在所有设备和模拟器上都可以正常播放,所以我的直觉告诉我这是我缺少的编码器设置。
为了消除所有其他可能的因素,我尝试直接从 Mobile Safari 地址栏调用视频文件。我已经确认在以下匹配版本上会发生这种情况:
设备:
- 4.2.1 (8C148) - 在 iPad 上播放,而不是在 iPhone 上播放。
模拟器:
- 3.2 (7W367a) - 在 iPad 上可以正常播放(无 iPhone 版本)
- 4.0.2 (8A400) - 无法播放 iPhone(无 iPad 版本)
- 4.1 (8B117) - 无法播放 iPhone (无 iPad 版本)
- 4.2 (8C134) - 无法播放 iPhone 或 iPad
我已经浏览了 iOS 变更日志,寻找任何可以解释为什么视频解压缩器应该在一个版本而不是另一个版本上工作的内容,但我找不到任何内容跳出来的。
任何人都知道这背后可能是什么以及我该如何解决它?
I'm quite stumped on this issue.
I have a large library of H.264 mp4 video files that I need to have play on iOS. Originally, I was targeting only iPad, but requirements have changed and now I need to include iPhone. But I've noticed that my iPod Touch, which has exactly the same OS version and build id as my iPad, won't play the same files that I've been successfully using on the iPad. I've confirmed this with a colleague who also has an iPhone and iPad with the same version & build. I've also seen the exact same behavior in the iPad simulator, but until now I figured it was a quirk of the simulator. Now I'm not so sure.
The mp4s are encoded with the following settings:
AVC Coding 640x360, Millions
AAC, Stereo (L R), 44.100 kHz
29.97 fps
693.35kb/s
I've tried loading the media off multiple servers and even locally and it doesn't seem to make a difference.
If I export these files from QuickTime as m4v files, they play fine on all devices and simulators, so my gut tells me this is an encoder setting I'm missing.
To eliminate all other possible factors, I've tried calling up the video files directly from the Mobile Safari address bar. I've confirmed this is happening on the following matching builds:
Devices:
- 4.2.1 (8C148) - plays on iPad, not on iPhone.
Simulators:
- 3.2 (7W367a) - plays okay on iPad (no iPhone version)
- 4.0.2 (8A400) - doesn't play iPhone (no iPad version)
- 4.1 (8B117) - doesn't play iPhone (no iPad version)
- 4.2 (8C134) - doesn't play iPhone or iPad
I've gone through the iOS changelogs looking for anything that might explain why a video decompressor should work on one version and not another and I can't find anything that jumps out.
Anyone have any ideas what could be behind this and how I can fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您的编码器未使用 iOS 上不可用的 H.264 功能。我相信所有 iOS 设备都支持 3.0 Baseline,除了第一代之外的所有设备都支持 3.1 Baseline,以及最新的 3.1 Main。维基百科有一个不同配置文件之间的差异列表。
有关 iOS 设备支持的更详细信息,请参阅此处,但每个设备的官方技术规格列出了其特定功能。
Be sure that your encoder isn't using H.264 features unavailable on iOS. I believe all iOS devices support 3.0 Baseline, everything but first generation supports 3.1 Baseline, and the most recent 3.1 Main. Wikipedia has a list of differences between the different profiles.
Somewhat more detailed information on iOS devices' support is available here, but the official tech specs for each device lists its particular capabilities.