Reputation: 11
When I run ffmpeg on android by adb shell, it shows this error:
Duration: 00:00:12.00, start: 0.000000, bitrate: 30412 kb/s Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 352x288, 30412 kb/s, 25 tbr, 25 tbn, 25 tbc
[4;31mUnknown encoder 'libx264'
I don't understand what went wrong. It bothered me for a lot of days.
Can you help me out? Thanks in advance!
(I pushed the compiled libffmpeg.so
to /system/lib
and pushed ffmpeg
to /system/bin
)
Target: compile ffmpeg with x264, and run libffmpeg.so on android device by adb shell.
Compiled environment: Ubuntu16.0 32bit,ndk r10b 32bit platform 15, ffmpeg 3.0,x264 latest.
My configure:
cd ffmpeg-3.0.9
export NDK=/home/ichp/project/android-ndk-r10b
export PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt
export PLATFORM=$NDK/platforms/android-15/arch-arm
export PREFIX=../simplefflib
export CURRENT_PATH=/home/ichp/project/FREYA-LIVE-LIBRARY-OPTIMIZER-FOR-ANDROID
./configure --target-os=linux --prefix=$PREFIX
--enable-cross-compile --enable-runtime-cpudetect --enable-asm --arch=arm --cpu=armv7-a --enable-libx264 --enable-encoder=libx264 --disable-encoders --disable-protocols --enable-protocol=file --enable-version3 --cc=$PREBUILT/linux-x86/bin/arm-linux-androideabi-gcc --cross-prefix=$PREBUILT/linux-x86/bin/arm-linux-androideabi- --disable-stripping --nm=$PREBUILT/linux-x86/bin/arm-linux-androideabi-nm --sysroot=$PLATFORM --enable-gpl --disable-shared --enable-static --enable-small --disable-ffprobe --disable-ffplay --enable-ffmpeg --disable-ffserver --disable-debug --enable-pthreads --enable-neon --extra-cflags="-I$CURRENT_PATH/temp/armeabi-v7a/include -fPIC -marm -DANDROID -DNDEBUG -static -O3 -march=armv7-a -mfpu=neon -mtune=generic-armv7-a -mfloat-abi=softfp -ftree-vectorize -mvectorize-with-neon-quad -ffast-math" --extra-ldflags="-L$CURRENT_PATH/temp/armeabi-v7a/lib"
make clean
make
make install
Upvotes: 1
Views: 2033
Reputation: 93319
The order of options matter. Move --disable-encoders
to before any --enable-encoder=
options.
Upvotes: 1