Using FFMPEG library with iPhone SDK for video encoding

Solution 1:

Check out the iFrameExtractor project on github. While this is not exactly what you are looking for, it has scripts for building the ffmpeg libraries and the xcode project links the libraries.

Some more info in this blog post:

http://www.codza.com/extracting-frames-from-movies-on-iphone

Solution 2:

In the Project menu, select Edit Active Target "[...]".

Then in Build separator, make sure you have All Configuration selected and do the following:

  • search for 'Header Search Paths' and indicate where the FFmpeg headers are located;
  • search for 'Library Search Paths' and indicate where the compiled static library binaries (.a files) are located.

This should do it but there's one more neat trick in the latter. You can add a build condition to 'Library Search Paths' so that compiler will use different binaries for different architectures, i.e. you can compile seamlessly for both the Simulator and for the Device. Instruction below.

  • With the Library Search Paths row selected, click the the button on left bottom corner of the same window and choose Add Build Setting Condition;
  • Where appears 'Any SDK', select 'Any iPhone OS Simulator' and indicate the path to the x86 ffmpeg binaries.
  • Repeat the steps above replacing 'Any iPhone OS Simulator' with 'Any iPhone OS Device' and indicate the ARM ffmpeg binaries.

Below is an example of this kind of build settings.

alt text

Solution 3:

Another option would be to use FFMPEG on a server. Send the images to the server and use PHP w/ ffmpeg to convert the video. With this, you wouldn't have to worry about compiling FFMPEG on the device. Just a thought