6

I am writing ios app that should convert mov file to mp4. Is there any ways to that using AVFoundation or something similar?

I will really appreciate your help!

Thanks!

Artem Kiselev
  • 643
  • 1
  • 7
  • 7

1 Answers1

9

Do you need to do AV media transcoding, or just change the container? A standard (not streaming) MOV container will/should be compatible with a MP4 container (inspection of a few test files from iOS show they are identical). So it is possible that you could just rename the file to MP4. This does assume the media in the container is supported by the MP4 container. FYI, The ISO spec for MP4 is based on the Quicktime file format. Also, if you are recording the media on the device then you can select MP4 as the container for the media.

Steve McFarlin
  • 3,576
  • 1
  • 25
  • 24
  • Thanks for your answer! I'm just adding *.mp4 extension to the movie file and it works perfectly on all devices I've tested on, therefore I think it is the good way of doing that. Does ios have something similar to UIImageJPEGRepresentation(myUIImage, 1.0) but for video files, where you can set the quality of transcoding, instead of default iOS presets? – Artem Kiselev Sep 30 '12 at 02:53
  • 1
    Yes. Take a look at [this post](http://stackoverflow.com/questions/8394935/avassetwriterinput-impossible-to-choose-video-resolution/8514509#8514509) – Steve McFarlin Oct 01 '12 at 22:20
  • 5
    After rename the file to mp4, it's worked in all iphone, ipad devices but not worked in android devices...I think it is not converted exactly .mp4 format – Prasad G Dec 10 '14 at 04:16