How to compile FFmpeg for the IOS 5.1?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to compile FFmpeg for the IOS 5.1?

yntnfu
Follow the thread I compile ffmpeg successfully:
http://ffmpeg.org/pipermail/libav-user/2012-March/001621.html

But when I try to link it with my program , it happens like this:
"ld: warning: ignoring file
/Users/XXXX/ffmpeg/ffmpeg/armv7/libavcodec.a, file was built for
archive which is not the architecture being linked (armv7)"

It seems that no ARM7 libraries created.

How to fix this?
Reply | Threaded
Open this post in threaded view
|

Re: How to compile FFmpeg for the IOS 5.1?

Wagner Patriota
rm -r ./compiled

echo Configure for armv7 build
./configure \
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='/usr/local/bin/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7' \
--extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk' \
--prefix=compiled/armv7 \
--enable-cross-compile \
--enable-nonfree \
--enable-gpl \
--disable-armv5te \
--disable-swscale-alpha \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-asm \
--disable-debug

make clean
make && make install


echo Configure for armv6
./configure \
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='/usr/local/bin/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk \
--target-os=darwin \
--arch=arm \
--cpu=arm1176jzf-s \
--extra-cflags='-arch armv6' \
--extra-ldflags='-arch armv6 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk' \
--prefix=compiled/armv6 \
--enable-cross-compile \
--enable-nonfree \
--enable-gpl \
--disable-armv5te \
--disable-swscale-alpha \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-asm \
--disable-debug

make clean
make && make install


echo Configure for i386
./configure \
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='/usr/local/bin/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386' \
--extra-ldflags='-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk' \
--prefix=compiled/i386 \
--enable-cross-compile \
--enable-nonfree \
--enable-gpl \
--disable-armv5te \
--disable-swscale-alpha \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-asm \
--disable-debug

make clean
make && make install


# make fat (universal) libs
mkdir -p ./compiled/fat/lib

lipo -output ./compiled/fat/lib/libavcodec.a  -create \
-arch armv6 ./compiled/armv6/lib/libavcodec.a \
-arch armv7 ./compiled/armv7/lib/libavcodec.a \
-arch i386 ./compiled/i386/lib/libavcodec.a

lipo -output ./compiled/fat/lib/libavdevice.a  -create \
-arch armv6 ./compiled/armv6/lib/libavdevice.a \
-arch armv7 ./compiled/armv7/lib/libavdevice.a \
-arch i386 ./compiled/i386/lib/libavdevice.a

lipo -output ./compiled/fat/lib/libavformat.a  -create \
-arch armv6 ./compiled/armv6/lib/libavformat.a \
-arch armv7 ./compiled/armv7/lib/libavformat.a \
-arch i386 ./compiled/i386/lib/libavformat.a

lipo -output ./compiled/fat/lib/libavutil.a  -create \
-arch armv6 ./compiled/armv6/lib/libavutil.a \
-arch armv7 ./compiled/armv7/lib/libavutil.a \
-arch i386 ./compiled/i386/lib/libavutil.a

lipo -output ./compiled/fat/lib/libswresample.a  -create \
-arch armv6 ./compiled/armv6/lib/libswresample.a \
-arch armv7 ./compiled/armv7/lib/libswresample.a \
-arch i386 ./compiled/i386/lib/libswresample.a

lipo -output ./compiled/fat/lib/libpostproc.a  -create \
-arch armv6 ./compiled/armv6/lib/libpostproc.a \
-arch armv7 ./compiled/armv7/lib/libpostproc.a \
-arch i386 ./compiled/i386/lib/libpostproc.a

lipo -output ./compiled/fat/lib/libswscale.a  -create \
-arch armv6 ./compiled/armv6/lib/libswscale.a \
-arch armv7 ./compiled/armv7/lib/libswscale.a \
-arch i386 ./compiled/i386/lib/libswscale.a

lipo -output ./compiled/fat/lib/libavfilter.a  -create \
-arch armv6 ./compiled/armv6/lib/libavfilter.a \
-arch armv7 ./compiled/armv7/lib/libavfilter.a \
-arch i386 ./compiled/i386/lib/libavfilter.a

On Mon, Jun 4, 2012 at 6:30 AM, yntnfu <[hidden email]> wrote:
Follow the thread I compile ffmpeg successfully:
http://ffmpeg.org/pipermail/libav-user/2012-March/001621.html
http://ffmpeg.org/pipermail/libav-user/2012-March/001621.html

But when I try to link it with my program , it happens like this:
"ld: warning: ignoring file
/Users/XXXX/ffmpeg/ffmpeg/armv7/libavcodec.a, file was built for
archive which is not the architecture being linked (armv7)"

It seems that no ARM7 libraries created.

How to fix this?

--
View this message in context: http://libav-users.943685.n4.nabble.com/How-to-compile-FFmpeg-for-the-IOS-5-1-tp4655114.html
Sent from the libav-users mailing list archive at Nabble.com.
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user


_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: How to compile FFmpeg for the IOS 5.1?

yntnfu
Thanks ,Wagner Patriota. Do you mean that I must make a fat lib which can link successfully by armv7?
Reply | Threaded
Open this post in threaded view
|

Re: How to compile FFmpeg for the IOS 5.1?

Wagner Patriota
yes, sure... or you can remove the --arch parameters from the lipo and leave only the architetures you need.

On Mon, Jun 4, 2012 at 10:06 PM, yntnfu <[hidden email]> wrote:
Thanks ,Wagner Patriota. Do you mean that I must make a fat lib which can
link successfully by armv7?

--
View this message in context: http://libav-users.943685.n4.nabble.com/How-to-compile-FFmpeg-for-the-IOS-5-1-tp4655114p4655125.html
Sent from the libav-users mailing list archive at Nabble.com.
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user


_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user