iPhone“无法播放” .mp4 H.264 视频文件

发布于 2024-09-10 05:41:58 字数 400 浏览 12 评论 0原文

我正在尝试为客户设置一个简单的移动页面,其中包含指向 .mp4 视频文件的链接。类似这样:

<a href="My_Video_File.mp4" target="_blank">Watch MP4 Video</a>

然后我显然已经正确获取了我的视频文件,并且 .mp4 具有以下特征:

Dimension: 480 * 272
Codecs: AAC, H.264, MPEG-4 SDSM, MPEG-4 ODSM
Channel Count: 2
Total Bitrate: 991
Size: 11.4MB

但是,问题是当我单击链接时 iPhone 说“电影无法播放”。并且没有告诉我为什么。

有什么帮助吗?

I'm trying to setup a simple mobile page for a client with a link to an .mp4 video file. Lke so:

<a href="My_Video_File.mp4" target="_blank">Watch MP4 Video</a>

And then I've obviously got my video file sourced properly and the .mp4 has the following characteristics:

Dimension: 480 * 272
Codecs: AAC, H.264, MPEG-4 SDSM, MPEG-4 ODSM
Channel Count: 2
Total Bitrate: 991
Size: 11.4MB

But, the problem is when I click on the link iPhone says "Movie cannot be played." and doesn't tell me why.

Any help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

白首有我共你 2024-09-17 05:41:58

该问题部分与编码有关,但更多与尺寸有关。

我发现,如果您的 .mp4 文件尺寸大于 640*360,那么 iPhone(iPad、iPod)甚至不会为用户提供尝试播放该文件的选项。他们只是得到了“X 播放”按钮图标。

此外,这些设备仅支持使用基线 H.264 配置文件编码的 .mp4,否则无法播放。

此外,iPhone 的比特率限制为 1.5Mb,但建议将比特率保持在 900kb 以下。

如果质量比大小更重要,那么您可以使用更大尺寸的 m4v,但我相信比特率规则仍然适用。

The problem was partially to do with encoding but more to do with the dimensions.

I found out that if your .mp4 file is larger in dimension than 640*360 then the iPhone (iPad, iPod) won't even give the user the option to attempt to play it. They just get the X'd out play button icon.

Also, these devices only support .mp4's that are encoded with the baseline H.264 profile, or they can't be played.

Also, there's a bitrate limit of 1.5Mb for the iPhone, but it's suggested to keep the bitrate below 900kb.

If quality is less of a concern than size then you can use m4v's of larger dimensions but I believe the bitrate rules still apply.

初相遇 2024-09-17 05:41:58

我遇到了类似的问题,我的猜测是编码。我曾尝试使用 Adob​​e Premiere CS4 (Adobe Media Encoder) 进行“iPhone”预设,但没有成功。

通过 ffmpeg 使用以下命令运行它就成功了:

ffmpeg -i INPUT -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -coder 0 -bf 0 -refs 1 -flags2 -wpred-dct8x8 -level 30 -maxrate 10M -bufsize 10M -acodec libfaac -ac 2 -ar 48000 -ab 192k OUTPUT.mp4

我在这里找到了上述内容(以及许多其他配置): http: //rodrigopolo.com/ffmpeg/cheats.html(我纠正了“iPod-iPhone 640 width,without presset”中的一些拼写错误[原文如此]。)

其他搜索可能会产生有关编码要求的更多信息(h.264 基线 3.0)以及在 iPhone 上播放的电影的大小要求。

有关该主题的 Apple 官方参考: http: //developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html

I encountered a similar issue and my guess was encoding. I had tried the "iPhone" preset with Adobe Premiere CS4 (Adobe Media Encoder) with no luck.

Running it through ffmpeg with the following did the trick:

ffmpeg -i INPUT -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -coder 0 -bf 0 -refs 1 -flags2 -wpred-dct8x8 -level 30 -maxrate 10M -bufsize 10M -acodec libfaac -ac 2 -ar 48000 -ab 192k OUTPUT.mp4

I found the above (and many other configurations) here: http://rodrigopolo.com/ffmpeg/cheats.html (I corrected a few typos in their "iPod-iPhone 640 width, without presset" [sic].)

Other searching around will probably yield more information about the encoding requirements (h.264 baseline 3.0) and size requirements for the movie to play on the iPhone.

The official Apple reference on the subject: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html

为你鎻心 2024-09-17 05:41:58

您需要 h254 视频是渐进式的而不是更低的。选择 H.264 预设并将视频从较低更改为渐进。

You need the h254 video to be progressive not lower. Choose the H.264 preset and change the video from lower to progressive.

花落人断肠 2024-09-17 05:41:58

这对我来说是这样的:

ffmpeg -an -i movie.mp4 -vcodec libx264 -codec:a libmp3lame -qscale:a 1 -pix_fmt yuv420p -profile:v benchmark -level 3 output.mp4

我使用了 mp3 编解码器在这里。这解决了我的 iPhone mp4 问题!

this did it for me:

ffmpeg -an -i movie.mp4 -vcodec libx264 -codec:a libmp3lame -qscale:a 1 -pix_fmt yuv420p -profile:v baseline -level 3 output.mp4

I used mp3 codec here. This fixed my iPhone mp4 problem!

握住我的手 2024-09-17 05:41:58

我在生成视频时遇到了类似的情况。它可以在我的本地计算机上正常播放,或者通过支持 .mp4 的浏览器播放;然而,当我尝试在 iPhone 上查看它时,它总是会弹出划掉的播放按钮。阅读 ffmpeg 文档 后,我尝试使用以下内容,它在我的 iPhone 上运行得非常好以及我尝试过的其他设备。

ffmpeg -i input.mkv -c:v libx264 -crf 28 -preset veryslow -tune fastdecode \
  -profile:v baseline -level 3.0 -movflags +faststart -c:a libfdk_aac -ac 2 \
  -ar 44100 -ab 64k -threads 0 -f mp4 output.mp4

我正在处理的视频分辨率为 1280x720,帧率为 30fps,最终使其正常工作的选项是

-profile:v baseline -level 3.0

I ran into a similar situation with video that I was generating. It would play fine on my local machine, or through a browser that supports .mp4; however when I tried viewing it on my iPhone it would invariably bring up the crossed-out play button. After reading ffmpeg docs I tried using the following and it worked beautifully on my iPhone as well as the other devices I've been able to try.

ffmpeg -i input.mkv -c:v libx264 -crf 28 -preset veryslow -tune fastdecode \
  -profile:v baseline -level 3.0 -movflags +faststart -c:a libfdk_aac -ac 2 \
  -ar 44100 -ab 64k -threads 0 -f mp4 output.mp4

The video that I'm dealing with is 1280x720 at 30fps, and the option that finally got it working was

-profile:v baseline -level 3.0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文