Tag Archives: ffmpeg

FFMPEG enable experimental codecs in your own code.

"The %s '%s' is experimental but experimental codecs are not enabled, "
"add '-strict %d' if you want to use it.\n"

With a simple google search (no more than 15mins) I couldn’t find a way to enable native FFMPEG AAC encoding, on the command line you do it by adding this: -strict experimental or -strict -2 however, it wasn’t clear to me how to do it on your own code (when using libavcodec and libavformat) so I followed that flag and determined that this message gets thrown when your codec context

avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL

So to the equivalent of adding the -strict experimental on the command line in code would be setting your codec context variable: strict_std_complaince to -2 before opening the codec.

c->strict_std_compliance = -2;
/* open it */
ret = avcodec_open2(c, codec, NULL);

Cross Compiling FFMPEG on a mac for ios

Source: http://www.tangentsoftworks.com/blog/2012/11/12/how-to-prepare-your-mac-for-ios-development-with-ffmpeg-libraries/
Adapted with Info from: https://github.com/kristopherjohnson/kxmovie/blob/master/build_x264

libx264 binaries are located at: ../x264/

./configure \
--prefix=armv7 \
--enable-gpl \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--enable-libx264 \
--enable-encoder=libx264 \
--enable-avresample \
--enable-cross-compile \
--sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" \
--target-os=darwin \
--cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" \
--extra-cflags="-arch armv7 -mfpu=neon -miphoneos-version-min=6.1 -I../x264/armv7/include" \
--extra-ldflags="-arch armv7 \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk \
-miphoneos-version-min=6.1 \
-L../x264/x264-uarch/lib" --arch=arm --cpu=cortex-a9 --enable-pic

make clean && make && make install

./configure \
--prefix=armv7s \
--enable-gpl \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--enable-libx264 \
--enable-encoder=libx264 \
--enable-avresample \
--enable-cross-compile \
--sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" \
--target-os=darwin \
--cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" \
--extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1 -I../x264/armv7s/include" \
--extra-ldflags="-arch armv7s \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk \
-miphoneos-version-min=6.1 \
-L../x264/x264-uarch/lib" --arch=arm --cpu=cortex-a9 --enable-pic

make clean && make && make install

./configure \
--prefix=i386 \
--enable-gpl \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--enable-libx264 \
--enable-encoder=libx264 \
--enable-avresample \
--enable-cross-compile \
--sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" \
--target-os=darwin \
--cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" \
--extra-cflags="-arch i386 -I../x264/i386/include" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk \
-L../x264/x264-uarch/lib" --arch=i386 --cpu=i386 --enable-pic --disable-asm

make clean && make && make install