iPhone "cannot play" .mp4 H.264 video file

45,103

Solution 1

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.

Solution 2

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

Solution 3

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

Solution 4

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!

Share:
45,103
AJB
Author by

AJB

Lover of the beach, sharp minds, and distributed systems.

Updated on May 15, 2021

Comments

  • AJB
    AJB about 3 years

    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?

  • Chealion
    Chealion almost 13 years
    The bitrate limit for the iPhone is actually 2500kbps. The iPod video had the 1500kbps limit. The iPhone 4 and iPad (both generations) and newer can play up to 720p, Main Profile at nearly any bitrate.
  • ammcom
    ammcom over 8 years
    It does not work for me, do you have any update for newer versions of FFMPEG?
  • Admin
    Admin almost 4 years
    your answer contradicts your facts in the question therefore it is a bad answer
  • AJB
    AJB almost 4 years
    @francogrex You might want to check the dates on this question. It's literally a decade old now. Things have changed.