Workaround playing a video .mov file in iOS app? Also related to Adobe Flash Animations
Asked Answered
M

1

5

After researching lots on StackOverflow and Class References, iOS MPMoviePlayerController cannot play .mov video files. AVPlayer can play .mov files but there are no controls.

I want my app to play .mov files, because Adobe Flash Animation provides .mov as the cleanest and native looking video. If I convert the same video to mp4 (supported formats) there is loss in quality, even when I turn the video rate to 100 MB/s and highest quality video.

Quite ironic, QuickTime is Apple's intellectual property and its products do not support .mov video files.

How do I get around this issue?

Mejias answered 3/1, 2015 at 10:14 Comment(0)
E
7

MPMoviePlayerController (and iOS in general) does support .mov files. See Apple's class documentation, section "Supported Formats". But only a limited number of video codecs are supported.

Deceptively, the Quicktime ".mov" format is not a video codec, but rather audio/video container format that can contain video and audio (and some other things) in any number of compression codecs (h.264, mpeg2, ProRes, MJPEG, AAC, mp3, etc.)

Your files don't work because they include video compressed with a codec which iOS does not support (maybe PhotoJPEG if they are Flash animations?). You can check the format of your videos by opening them in Quicktime Player on Mac OS X and clicking "Show Movie Inspector" in the Window menu.

It is not possible to add support for additional codecs to the native iOS video playback system (MPMoviePlayerController and friends). This leaves two options;

  • Recompress your files to make them compatible
  • Use a different video playback framework.

You say you have already tried recompressing the files, but this is still the best option. I encourage you to try recompressing the files with Handbrake. The h.264 codec is capable of excellent results (see BluRay movies, the iTunes Movie store, etc.)

If you really must play back your animations in their current format, you'll need to use another video playback framework. I suggest you look at libVLC and VLCKit from the excellent VideoLan project (I'm having problems accessing the VLCKit project pages, but a fork is available here). Be aware, non-native video playback will very likely not be hardware accelerated and so will eat your users' batteries.

One last thing, if your videos are short and silent… might animated GIF be an option?

Elvieelvin answered 4/1, 2015 at 17:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.