views:

5615

answers:

4

Hi,

I need to encode several pictures shot by the iphone camera into a mp4 video file and I know FFMPEG can do this (the application TimeLapser and ReelMoments do it already). I plan to use this in my app iMotion (available in the appstore).

I successfully install and compile the ffmpeg for the iphone SDK with this link : http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076618.html

But now I'm stuck here in my XCode project. What should I do next to use the FFMPEG library for video encoding ? The Apple documentation about external library using is very light and I just can find any tutorial on the web wich explain how to do this.

If anybody can help me, I would be very grateful..`

Thanks

Aurelien Potier

+1  A: 

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

jpedroso
A: 

Hi Aurelien Potier,

Have you configured FFMPEG with Xcode? I have created libs and able to link it in project. Do you have any sample code to convert audio streams?

Thanks Pratik

Pratik
not an answer at all
Till
+1  A: 

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

lajos
A: 

Did u had any success in using FFmpeg .... please get me some tutorial for doing it

Ramkumar