Build latest version of FFMPEG with libx264 Android -
i able build ffmpeg libx264 android , working before 2 months.
i uses halfninja building.
today take latest source of ffmpeg , libx264 here.
git clone git://git.videolan.org/x264.git git clone git://git.videolan.org/ffmpeg.git
and try rebuild whole project. throws following errors.
ffmpeg.c:2406: error: undefined reference 'hwaccels' ffmpeg.c:3390: error: undefined reference 'qp_hist' ffmpeg.c:3390: error: undefined reference 'do_hex_dump' ffmpeg.c:3390: error: undefined reference 'do_pkt_dump' ffmpeg.c:576: error: undefined reference 'do_benchmark_all' ffmpeg.c:657: error: undefined reference 'audio_sync_method' ffmpeg.c:1222: error: undefined reference 'vstats_filename' ffmpeg.c:972: error: undefined reference 'frame_drop_threshold' ffmpeg.c:1181: error: undefined reference 'debug_ts' ffmpeg.c:2742: error: undefined reference 'copy_tb' ffmpeg.c:2846: error: undefined reference 'audio_volume' ffmpeg.c:2862: error: undefined reference 'init_simple_filtergraph' ffmpeg.c:2863: error: undefined reference 'configure_filtergraph' ffmpeg.c:2923: error: undefined reference 'video_sync_method' ffmpeg.c:2538: error: undefined reference 'frame_bits_per_raw_sample' ffmpeg.c:3258: error: undefined reference 'sdp_filename' ffmpeg.c:2087: error: undefined reference 'ist_in_filtergraph' ffmpeg.c:4069: error: undefined reference 'ffmpeg_parse_options' ffmpeg.c:4074: error: undefined reference 'show_usage' ffmpeg.c:3303: error: undefined reference 'options' ffmpeg.c:3303: error: undefined reference 'stdin_interaction' ffmpeg.c:2553: error: undefined reference 'exit_on_error' ffmpeg.c:2553: error: undefined reference 'do_pkt_dump' ffmpeg.c:2553: error: undefined reference 'do_hex_dump' ffmpeg.c:3727: error: undefined reference 'copy_ts' ffmpeg.c:3727: error: undefined reference 'dts_delta_threshold' ffmpeg.c:268: error: undefined reference 'dts_error_threshold' ffmpeg.c:3976: error: undefined reference 'print_stats' ffmpeg.c:1694: error: undefined reference 'do_benchmark' ffmpeg.c:1694: error: undefined reference 'max_error_rate'
please me out resolve this.
please @ script.
build_android.sh
#!/bin/bash # # build_android.sh # copyright (c) 2012 jacek marchwicki # # licensed under apache license, version 2.0 (the "license"); # may not use file except in compliance license. # may obtain copy of license @ # # http://www.apache.org/licenses/license-2.0 # # unless required applicable law or agreed in writing, software # distributed under license distributed on "as is" basis, # without warranties or conditions of kind, either express or implied. # see license specific language governing permissions , # limitations under license. export ndk=/home/tasol/development/ijoomer_development/ndk/android-ndk-r10d if [ "$ndk" = "" ]; echo ndk variable not set, exiting echo "use: export ndk=/your/path/to/android-ndk" exit 1 fi os=`uname -s | tr '[a-z]' '[a-z]'` function build_x264 { platform=$ndk/platforms/$platform_version/arch-$arch/ export path=${path}:$prebuilt/bin/ cross_compile=$prebuilt/bin/$eabiarch- cflags=$optimize_cflags #cflags=" -i$arm_inc -fpic -dandroid -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -d__arm_arch_5__ -d__arm_arch_5t__ -d__arm_arch_5e__ -d__arm_arch_5te__ -wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb -os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -dandroid -wa,--noexecstack -mmd -mp " export cppflags="$cflags" export cflags="$cflags" export cxxflags="$cflags" export cxx="${cross_compile}g++ --sysroot=$platform" export as="${cross_compile}gcc --sysroot=$platform" export cc="${cross_compile}gcc --sysroot=$platform" export nm="${cross_compile}nm" export strip="${cross_compile}strip" export ranlib="${cross_compile}ranlib" export ar="${cross_compile}ar" #export ldflags="-wl,-rpath-link=$platform/usr/lib -l$platform/usr/lib -nostdlib -lc -lm -ldl -llog" cd x264 ./configure --disable-asm --prefix=$(pwd)/$prefix --host=$arch-linux --enable-static $additional_configure_flag || exit 1 make clean || exit 1 make -j4 install || exit 1 cd .. } function build_ffmpeg { platform=$ndk/platforms/$platform_version/arch-$arch/ cc=$prebuilt/bin/$eabiarch-gcc cross_prefix=$prebuilt/bin/$eabiarch- pkg_config=${cross_prefix}pkg-config if [ ! -f $pkg_config ]; cat > $pkg_config << eof #!/bin/bash pkg-config \$* eof chmod u+x $pkg_config fi nm=$prebuilt/bin/$eabiarch-nm cd ffmpeg export pkg_config_libdir=$(pwd)/$prefix/lib/pkgconfig/ export pkg_config_path=$(pwd)/$prefix/lib/pkgconfig/ ./configure --target-os=linux \ --prefix=$prefix \ --enable-cross-compile \ --extra-libs="-lgcc" \ --arch=$arch \ --cc=$cc \ --cross-prefix=$cross_prefix \ --nm=$nm \ --sysroot=$platform \ --extra-cflags=" -o3 -fpic -dandroid -dhave_sys_uio_h=1 -dipv6mr_interface=ipv6mr_ifindex -fasm -wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $optimize_cflags " \ --disable-shared \ --disable-stripping \ --enable-static \ --enable-runtime-cpudetect \ --extra-ldflags="-wl,-rpath-link=$platform/usr/lib -l$platform/usr/lib -nostdlib -lc -lm -ldl -llog -l$prefix/lib" \ --extra-cflags="-i$prefix/include" \ --enable-gpl \ --enable-encoder=libx264 \ --enable-libx264 \ --enable-parser=mjpeg \ --enable-demuxer=image2 \ --enable-hwaccel=h264_vaapi \ --enable-hwaccel=h264_vaapi \ --enable-hwaccel=h264_dxva2 \ --enable-hwaccel=mpeg4_vaapi \ --enable-demuxer=mov \ --enable-demuxer=h264 \ --enable-demuxer=mpegvideo \ --enable-demuxer=h263 \ --enable-demuxer=mpegps \ --enable-demuxer=mjpeg \ --enable-demuxer=rtsp \ --enable-demuxer=rtp \ --enable-demuxer=hls \ --enable-demuxer=matroska \ --enable-muxer=rtsp \ --enable-muxer=mp4 \ --enable-muxer=mov \ --enable-muxer=mjpeg \ --enable-muxer=matroska \ --enable-protocol=crypto \ --enable-protocol=jni \ --enable-protocol=file \ --disable-network \ --enable-filter=buffer \ --enable-filter=buffersink \ --enable-filter=scale \ --enable-protocol=rtp \ --enable-protocol=tcp \ --enable-protocol=udp \ --enable-protocol=applehttp \ --enable-protocol=hls \ --enable-protocol=http \ --enable-decoder=xsub \ --enable-decoder=jacosub \ --enable-decoder=dvdsub \ --enable-decoder=dvbsub \ --enable-decoder=subviewer \ --enable-decoder=rawvideo \ --enable-encoder=rawvideo \ --enable-decoder=mjpeg \ --enable-encoder=mjpeg \ --enable-decoder=h263 \ --enable-decoder=mpeg4 \ --enable-encoder=mpeg4 \ --enable-decoder=h264 \ --enable-encoder=h264 \ --enable-decoder=aac \ --enable-encoder=aac \ --enable-parser=h264 \ --enable-encoder=mp2 \ --enable-decoder=mp2 \ --enable-encoder=libvo_amrwbenc \ --enable-decoder=amrwb \ --enable-muxer=mp2 \ --enable-bsfs \ --enable-decoders \ --enable-encoders \ --enable-parsers \ --enable-hwaccels \ --enable-muxers \ --enable-avformat \ --enable-avcodec \ --disable-demuxer=v4l \ --disable-demuxer=v4l2 \ --disable-indev=v4l \ --disable-indev=v4l2 \ --disable-ffplay \ --disable-ffmpeg \ --disable-ffplay \ --disable-ffprobe \ --disable-ffserver \ --enable-nonfree \ --enable-version3 \ --enable-memalign-hack \ --disable-asm \ $additional_configure_flag \ || exit 1 make clean || exit 1 make -j4 install || exit 1 cd .. } function build_one { cd ffmpeg cd .. } #arm v5 eabiarch=arm-linux-androideabi arch=arm cpu=armv5 optimize_cflags="-marm -march=$cpu" prefix=../ffmpeg-build/armeabi out_library=$prefix/libffmpeg.so additional_configure_flag= soname=libffmpeg.so prebuilt=$ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/$os-x86_64 #prebuilt=$ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/$os-x86 platform_version=android-5 build_x264 build_ffmpeg build_one #arm v7vfpv3 #eabiarch=arm-linux-androideabi #arch=arm #cpu=armv7-a #optimize_cflags="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$cpu " #prefix=../ffmpeg-build/armeabi-v7a #out_library=$prefix/libffmpeg.so #additional_configure_flag= #soname=libffmpeg.so #prebuilt=$ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/$os-x86_64 #prebuilt=$ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/$os-x86 #platform_version=android-5 #build_x264 #build_ffmpeg #build_one #arm v7 + neon (neon include vfpv3-32) eabiarch=arm-linux-androideabi arch=arm cpu=armv7-a optimize_cflags="-mfloat-abi=softfp -mfpu=neon -marm -march=$cpu -mtune=cortex-a8 -mthumb -d__thumb__ " prefix=../ffmpeg-build/armeabi-v7a #prefix=../ffmpeg-build/armeabi-v7a-neon out_library=../ffmpeg-build/armeabi-v7a/libffmpeg-neon.so additional_configure_flag=--enable-neon soname=libffmpeg-neon.so prebuilt=$ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/$os-x86_64 #prebuilt=$ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/$os-x86 platform_version=android-9 build_x264 build_ffmpeg build_one #x86 eabiarch=i686-linux-android arch=x86 optimize_cflags="-m32" prefix=../ffmpeg-build/x86 out_library=$prefix/libffmpeg.so additional_configure_flag=--disable-asm soname=libffmpeg.so prebuilt=$ndk/toolchains/x86-4.8/prebuilt/$os-x86_64 #prebuilt=$ndk/toolchains/x86-4.6/prebuilt/$os-x86 platform_version=android-9 build_x264 build_ffmpeg build_one #mips eabiarch=mipsel-linux-android arch=mips optimize_cflags="-el -march=mips32 -mips32 -mhard-float" prefix=../ffmpeg-build/mips out_library=$prefix/libffmpeg.so additional_configure_flag="" soname=libffmpeg.so prebuilt=$ndk/toolchains/mipsel-linux-android-4.8/prebuilt/$os-x86_64 #prebuilt=$ndk/toolchains/mipsel-linux-android-4.6/prebuilt/$os-x86 platform_version=android-9 build_x264 build_ffmpeg build_one
build_all.sh
#!/bin/bash # # build_all.sh export ndk=/home/tasol/development/ijoomer_development/ndk/android-ndk-r10d sudo ./build_android.sh $ndk/ndk-build echo "done dona done!!!"
android.mk
local_path := $(call my-dir) include $(clear_vars) local_module := videokit # these need in right order ffmpeg_libs := $(addprefix ffmpeg-build/$(target_arch_abi)/lib/, \ libavdevice.a \ libavformat.a \ libavfilter.a \ libavcodec.a \ libswscale.a \ libavutil.a \ libswresample.a \ libpostproc.a ) # ffmpeg uses own deprecated functions liberally, turn off annoying noise local_cflags += -g -iffmpeg -ivideokit -wno-deprecated-declarations local_ldlibs += -llog -lz $(ffmpeg_libs) ffmpeg-build/$(target_arch_abi)/lib/libx264.a local_src_files := videokit/uk_co_halfninja_videokit_videokit.c videokit/ffmpeg.c videokit/cmdutils.c include $(build_shared_library) include $(clear_vars) local_module := ffmpeg ffmpeg_libs := $(addprefix ffmpeg-build/$(target_arch_abi)/lib/, \ libavdevice.a \ libavformat.a \ libavfilter.a \ libavcodec.a \ libswscale.a \ libavutil.a \ libswresample.a \ libpostproc.a ) local_cflags += -g -iffmpeg -ivideokit -wno-deprecated-declarations local_ldlibs += -llog -lz $(ffmpeg_libs) ffmpeg-build/$(target_arch_abi)/lib/libx264.a local_src_files := ffmpeg/ffmpeg.c ffmpeg/cmdutils.c include $(build_executable)
application.mk
app_abi := armeabi,armeabi-v7a,x86,mips app_platform := android-10 app_stl := gnustl_static
update
finally got success
Comments
Post a Comment