Ahmed Nuaman
Ahmed Nuaman

Reputation: 13259

iPad MP4 playback issues

I'm wondering weather this is an issue with iOS devices or just the iPad (I've actually only had an iPad to play on).

If I were to write a HTML link that linked to an MP4 on a server (over HTTP), the iPad launches it in Safari but doesn't recognise that it's an MP4 and just serves a blank page.

I've had a look on other devices, such as Android for eg, and this fires up the media player and streams correctly.

Is there a specific way to get it to play in the default media player on iPad/iOS?

Upvotes: 2

Views: 2327

Answers (3)

user2441249
user2441249

Reputation:

Found this while looking for a solution for iOS-related MP4-audio problems: Some of my MP4 audio files would start to play, but at a certain point in the file, playback on iOS would hang, while non-iOS players played the same MP4 files flawlessly till the end.

MP4 is a container format. Said to also contain non-audio/non-video streams and metadata headers that describe audio/video. iOS seems to dislike some stream types and if some headers are at unexpected positions in the file.

mp4box and ffmpeg can fix these headers and remove unwanted streams. I only fiddled with mp4box, that did it for me to fix the audio problems:

mp4box -single 1 input.mp4 -out outputfixed.mp4

The "1" is the stream number containing the audio in my case (may vary, mp4box can also list the contained streams).

Later on I found that the GUI tool "MP4tag", that is primarily meant to edit tags, has a menu function called "MP4 optimize" that is said to be able to fix the same problem.

mp4box should also be able to fix vid+audio combinations, by retrieving more than one stream from the input file.

Upvotes: 0

Luca Lenardi
Luca Lenardi

Reputation: 105

I'm experiencing a very similar problem with the iPad in playing an mp4 file, which in fact was encoded by Brightcove.

The video won't start inside an html5 video tag using the iPad, while it works perfectly in Chrome, Safari and IE9.

You can grab the video here: http://tinyurl.com/796c5ub and this is the output of $ffmpeg -i video1.mp4:

ffmpeg version 0.7.1, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jul 31 2011 18:31:40 with clang 2.1 (tags/Apple/clang-163.7.1)
  configuration: --prefix=/opt/local --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libxvid --enable-libx264 --enable-libvpx --enable-libspeex --enable-nonfree --mandir=/opt/local/share/man --enable-shared --enable-pthreads --disable-indevs --cc=/Developer/usr/bin/clang --arch=x86_64
  libavutil    50. 43. 0 / 50. 43. 0
  libavcodec   52.122. 0 / 52.122. 0
  libavformat  52.110. 0 / 52.110. 0
  libavdevice  52.  5. 0 / 52.  5. 0
  libavfilter   1. 80. 0 /  1. 80. 0
  libswscale    0. 14. 1 /  0. 14. 1
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2011-12-06 08:00:00
    encoder         : Lavf53.17.0
  Duration: 00:00:45.60, start: 0.000000, bitrate: 1818 kb/s
    Stream #0.0(eng): Video: h264 (High), yuv420p, 1280x852, 1687 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      creation_time   : 2011-12-06 08:00:00
    Stream #0.1(eng): Audio: aac, 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      creation_time   : 2011-12-06 08:00:00
At least one output file must be specified

Upvotes: 1

Stu Thompson
Stu Thompson

Reputation: 38908

The problem is more than likely the particular encoding characteristics of the MP4. h264 and MPEG-4 have loads of little options and tweakable parameters. iOS devices are fairly specific about what they do and do not like. (To be fair, this is not a problem specific to iOS devices.)

Have a look at Brightcove's encoding recommendations and re-encode your media.

That failing, and assuming you have FFmpeg installed, post the results of ffmpeg -i problemfile.mp4 and comment below so I can have a look.

Upvotes: 2

Related Questions