我正在開發一個媒體應用程序,它爲實現此功能提供了對所有視頻格式的支持,我們要求FFMPEG是編解碼器的最佳庫。對Android的Windows下編譯FFmpeg中是非常漫長的戰鬥,所以我移植到Ubuntu我幾乎編譯它顯示的二進制代碼,但是它下面的消息在ubuntu上爲FF安裝FFMPEG
>AR libpostproc/libpostproc.a
AR libswresample/libswresample.a
AR libswscale/libswscale.a
AR libavcodec/libavcodec.a
AR libavutil/libavutil.a
INSTALL libavfilter/libavfilter.a
INSTALL libavformat/libavformat.a
INSTALL libavresample/libavresample.a
INSTALL libpostproc/libpostproc.a
INSTALL libswresample/libswresample.a
INSTALL libswscale/libswscale.a
INSTALL libavutil/libavutil.a
LD ffmpeg_g
INSTALL libavcodec/libavcodec.a
CP ffmpeg
STRIP ffmpeg
skipping strip ffmpeg
INSTALL install-progs-yes
INSTALL ffmpeg
/home/akshay/Desktop/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-ld: -: unknown option
給出的最後一點這裏是我的腳本
#!/bin/bash
NDK=/home/akshay/Desktop/android-ndk-r9c
PLATFORM=$NDK/platforms/android-8/arch-arm
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86
PREFIX=./android-ffmpeg
function build_one
{
./configure --target-os=linux --prefix=$PREFIX \
--enable-cross-compile \
--enable-runtime-cpudetect \
--disable-asm \
--arch=arm \
#--cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
--disable-stripping \
#--nm=$PREBUILT/bin/arm-linux-androideabi-nm \
--sysroot=$PLATFORM \
--enable-nonfree \
--enable-version3 \
--disable-everything \
--enable-gpl \
--disable-doc \
--enable-avresample \
--enable-demuxer=rtsp \
--enable-muxer=rtsp \
--disable-ffplay \
--disable-ffserver \
--enable-ffmpeg \
--disable-ffprobe \
--enable-encoders \
--enable-decoders \
--enable-protocols \
--enable-hwaccels \
--enable-zlib \
--disable-devices \
--disable-avdevice \
--extra-cflags="-I/home/android-ffmpeg/include -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=armv7-a" \
--extra-ldflags="-L/home/android-ffmpeg/lib"
make -j4 install
$PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib -soname libffmpeg.so -shared - nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavfilter/ libavfilter.a libavresample/libavresample.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl - llog --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.8/libgcc.a
}
build_one
請告訴我什麼錯在腳本
錯誤是告訴你它正在使用'$ PREBUILT/lib/gcc/arm-linux-androideabi/4.8/libgcc.a'作爲選項。試着把它放在一個單獨的行上,或者把'&&放在它之前,告訴它只有在前一個成功時才繼續該命令。 – nathansizemore
@nathanaizemore它通過嘗試你的評論 –