Big problems compiling FFMPEG for iOS5

I am trying to compile the ffmpeg library for iOS5. I tried different options but no one works.

I downloaded this: https://github.com/ciphor/ffmpeg4ios .

I tried the original build_armv7, but that didn't work. I edited the build_arm7 file and now it looks like this:

#!/bin/tcsh -f if (! -d armv7) mkdir armv7 if (! -d lib) mkdir lib rm armv7/*.a make clean ./configure --disable-network --disable-mpegaudio-hp --disable-lpc --disable-vaapi --disable-vdpau --disable-hwaccels --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-avx --disable-amd3dnow --disable-amd3dnowext --disable-vis --disable-mmi --disable-doc --disable-yasm --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-rdft --disable-dxva2 --disable-encoders --disable-decoders --enable-decoder=h264 --disable-bsfs --disable-protocols --disable-indevs --disable-outdevs --disable-devices --disable-filters --disable-demuxers --enable-demuxer=h264 --disable-muxers --disable-parsers --enable-parser=h264 --enable-cross-compile --arch=arm --target-os=darwin --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 /Aplications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk --cpu=cortex-a8 --extra-cflags='-pipe -Os -gdwarf-2 -issysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -m${thumb_opt:-no-thumb} -mthumb-interwork' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk' --enable-pic make mv libavcodec/libavcodec.a armv7/ mv libavdevice/libavdevice.a armv7/ mv libavformat/libavformat.a armv7/ mv libavutil/libavutil.a armv7/ mv libswscale/libswscale.a armv7/ rm lib/*.a cp armv7/*.a lib/ 

But I get this error:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 cannot create an executable file. C compiler failed.

I have looked all over the internet. I read all the stackoverflow posts about this, but no one helped me. Please tell me what I am doing wrong, and please do not send me links: trust me, I saw them all!

+4
source share
3 answers

Check the config.log file in the compilation root directory and look for "C compiler failed." You will find there the command that was tested, and the exact reason for its failure (i.e., the output of the compiler).

Perhaps the compiler installation directory is not / Applications / Xcode.app / Contents / Developer / Platforms / iPhoneOS.platform / Developer / usr / bin / or that some library was not found, etc.

Actually, I see that you specify several paths on the configure command line. Have you verified that they are correct for your version of Xcode?

+2
source

This worked for me with iOS 5.0 and Snow Leopard. You must modify ldflags, sysroot, and cc to provide valid file paths in Mountain Lion for Xcode to be moved to the antoher folder.

 ./configure \ --extra-ldflags=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system \ --disable-muxers \ --disable-demuxers \ --disable-devices \ --disable-parsers \ --disable-protocols \ --disable-filters \ --disable-bsfs \ --disable-doc \ --disable-ffmpeg \ --disable-ffplay \ --disable-avfilter \ --disable-avformat \ --disable-ffserver \ --disable-decoders \ --disable-encoders \ --disable-network \ --enable-decoder=h261 \ --enable-decoder=h263 \ --enable-decoder=h263p \ --enable-encoder=h261 \ --enable-encoder=h263 \ --enable-encoder=h263p \ --enable-cross-compile \ --enable-hardcoded-tables \ --enable-memalign-hack \ --enable-neon \ --arch=arm \ --target-os=darwin \ --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \ --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk \ --cpu=cortex-a8 \ --extra-cflags='-arch armv7 -mno-thumb -mfpu=neon -mfloat-abi=softfp' \ --extra-ldflags='-arch armv7 -mno-thumb -mfpu=neon -mfloat-abi=softfp' 2>&1 | tee configure.log make clean make 
+3
source

If you need ffmpeg 11 You might need to use a snow leopard or a lion, it seems that the mountain lion lacks critical components of the gcc compiler. We study our build scripts for this.

If the version is not so important for you, we have a ready-made infrastructure for ffmpeg 8, in fact, we do not find much difference between the use of these two and find that ffmpeg 8 has less performance problems.

https://github.com/mooncatventures-group/ffmpegDecoder

If you have a build with a lion or snow leopard, you can probably change our build script and build ffmpeg 11, others did it.

+1
source

Source: https://habr.com/ru/post/1433978/


All Articles