2

I am using AVFoundation to record video on IOS 5. I would like the content to be in an MP4 container. I have been searching around and cannot find a message that specifies the format to record the video in. I would rather record to the MP4 file on the first shot instead of recording it to a mov file and then reencode it in a mp4 on a separate pass. Does anyone know how to do this?

I guessed above when I said it records to a mov. What is the default file format it records to?

I am new with AVFoundation and IOS in general so please excuse me if some of this is obvious and I am having difficulty finding it.

Thankyou for any help

vjuliano
  • 1,474
  • 2
  • 15
  • 29
  • You have asked this question 5 years ago and probably solved it by using asssetwrier. Do you know what you are asking is possible without assetwriter in 2017 ? :) – Numan Karaaslan Dec 24 '17 at 14:49

1 Answers1

2

I am currently unaware of how to do it in foundation classes, but you can certainly do it using AVAssetWriter look for option outputFileType and shouldOptimizeForNetworkUse.

Hemant Verma
  • 90
  • 2
  • 9
  • thank you, my understanding of this class is that AVFoundation creates the orginal media file, then this reads it, encodes it in a different format and writes it back to storage. Is this true? I would like to avoid all this additional overhead if possible. – vjuliano Jan 15 '12 at 20:42
  • Till now I haven't found the way to avoid this overhead. – Hemant Verma Jan 17 '12 at 16:59