출처 : http://blog.fh-kaernten.at/wehr/?p=1764
In one of my latest projects I needed some audio/video streaming capabilities for iOS driven devices.
The first App. which we implemented was a audio/HDVideo low latency conference streaming application for smart phones.
The second app was around MPEG-TS to Elementary Stream demuxer for some dreambox streaming fun
The framework of choice is the swiss army knife for streaming stuff,.. ffmpeg. To be more precise, ffmpeg consists of serveral libraries and the command line programs ffmpeg, ffplay, ffprobe.
What do you need:
- Xcode4.3
- Apple’s command line tools (Xcode -> Preferences -> Components)
- pkg-config -> download
- gas-preprocessor -> download (extract under your ffmpeg root dir ./gas-preprocessor)
- build-essentials -> you can download an install script
- m4
- autoconf
- automake
- libtool
- last but not least ffmpeg -> download
I used the latest snapshot available at the the time of writing. Extract the snapshot .tar to a folder of our choice.
Thanks Michael, the lead developer of ffmpeg, the ffmpeg source comes with the convenient autotools facilities. So we only need to set the correct configure flags
1. Compiler flags:
As we need to do some cross-compiling we need to select the compiler/assembler which comes with our XCode
–cc=’/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2′.
–as=’./gas-preprocessor/gas-preprocessor.pl /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2′
–arch=arm
–target-os=darwin
–cpu=cortex-a8
–enable-pic
–disable-yasm
2. iOs SDK path:
–sysroot=’/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk’
3. extra flags:
–extra-cflags=’-mfpu=neon -pipe -Os -gdwarf-2 -miphoneos-version-min=5.0′
–extra-ldflags=’-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -miphoneos-version-min=5.0′
4. configure ffmpeg library components:
for example:
–disable-ffmpeg
–disable-ffplay
–disable-ffprobe
–disable-ffserver
–disable-avdevice
–disable-avfilter
–disable-everything
and then enable the components you need
–enable-decoder=xxx
–enable-parser=xxx
–enable-demuxer=xxx
after successful completion of ./configure run make… and voilà
If you get some errors complaining about “error: invalid operand in inline asm: ” try to disable assembler directives with
–diasble-asm
have fun
Mario
'프로그래밍 > iOS' 카테고리의 다른 글
내 어플에 GameCenter (게임센터) 를 붙여보자 + 겜센터 스타일 노티도 띄워보자! (0) | 2012.09.14 |
---|---|
MFMessageComposeViewController를 이용한 sms(문자) 보내기 (0) | 2012.09.13 |
iOS ffmpeg player (rtsp 플레이어) (0) | 2012.09.05 |
Objective-C에서 NSFileManger와 NSFileHandle을 이용하여 문자열을 파일로 저장하는 방법 (0) | 2012.09.04 |
페북 Single Sign On 을 iOS앱에 적용하기 (0) | 2012.08.08 |