Compiling ffmpeg for iPhone SDK (Symbol(s) not found - Linker)
I'm using ffplay in my Application. I implemented the Librarys which has been used in this Project: http://code.google.com/p/ffmpeg4iphone/downloads/detail?name=ffplay-xproj.zip&can=2&q=
But I've seen that this Sources are very old(Apr 2009). I wanted to Build new Librarys and then change it with these In my project.
What I've done:
- Downloaded the ffmpeg Source code: (using command line: svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg)
- Compiled the Project with special ./configure options and the gas-processor : http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-October/076618.html
- I only changed here the Paths of the actual locations for the iP开发者_如何学Chone SDK 4.1
- Changed the header Path in xCode Active Target Project Settings to my ffmpeg folder
- Included the .a files in my project in xCode
- Added the Other Linker Flags -lm -lbz2 -lz
- Tried to Build my Application, but I get some Linker errors where symbol(s) wasn't found.
Undefined symbols: "avcodec_init()", referenced from:
And the other errors are nearly the same (_av_codec.....)
How can I build it correctly?
I've found the solution: I set the architecture to Optimized(arm7) and then all was working.
One more Question: I use ffmpeg for streaming an online stream. Which Values Should I set to get a good streaming quality also when I am in 3G. This what i've done:
- set the audio-buffer to 1024
- set the lowres value of mpeg to 3
Not sure if you are using C or C++ (g++) compiler, but try guarding your #includes for ffmpeg with extern "C": the c++ compiler (if it is used) is probably mangling the function names and hence the link errors.
Try to enclose your include with extern "C":
#ifdef __cplusplus
extern "C" {
#endif
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#ifdef __cplusplus
}
#endif
精彩评论