android - ffmpeg for android build - 是否完整

标签 android linux build ffmpeg

//EDIT节省时间并引用SF project 。 IMO,它可能会节省大量的工作来加快速度......

在此问题上进行更多工作后:

添加了 git project

安装自定义工具链后,构建会更容易,以便您可以调用 compiler the easy way

来自 ndk-build 的示例标准输出

-- 最初在 Windows Vista 上的 vmplayer 中使用 ubuntu 12.04。 IMO linux 比 cygwin 更适合构建。

我关注这些instructions存在以下条件时得到不确定的结果。

build_android.sh seems to exit normally
config.log has error where confirming gcc from crosstoolchain
all the static libs are built ok (./libavfilter, ./libavcodec etc )
ffmpeg.o is there and executes ok
no ./android directory as per the prefix setting to config

看起来我可以将二进制文件推送到我的手机并在 shell 中进行测试。如果没问题的话我可以寻找静态库的 jni 包装器。

但是为什么构建没有向 --prefix=./android/armv7-a 写入任何内容? 构建结束时该路径不存在

详细信息:

配置日志处理了什么:

FFMPEG_CONFIGURATION='--target-os=linux --prefix=./android/armv7-a 
--enable-libvpx --enable-libvorbis --enable-pthreads --logfile=config.log
--enable-cross-compile --extra-libs=-lgcc --arch=arm 
--cc=/home/rob/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc 
--cross-prefix=/home/rob/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- 
--nm=/home/rob/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-nm 
--sysroot=/home/rob/src/android-ndk-r8/platforms/android-14/arch-arm/ --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 -mfloat-abi=softfp  -marm -march=armv7-a -mtune=cortex-a9 '"'"' 
--disable-shared --enable-static --extra-ldflags='"'"'
-Wl,-rpath-link=/home/rob/src/android-ndk-r8/platforms/android-14/arch-arm//usr/lib -L/home/rob/src/android-ndk-r8/platforms/android-14/arch-arm//usr/lib 
-nostdlib -lc -lm -ldl -llog'"'"' 
--disable-everything --enable-demuxer=mov --enable-demuxer=h264 
--disable-ffplay --enable-protocol=file 
--enable-avformat --enable-avcodec --enable-decoder=rawvideo 
--enable-decoder=mjpeg --enable-decoder=h263 --enable-decoder=mpeg4 
--enable-decoder=h264 --enable-parser=h264 --disable-network --enable-zlib --disable-avfilter --disable-avdevice'

配置日志尾部包含编译器检查错误

zmbv_test='yes'
zmbv_test_deps='zlib'
WARNING: /home/rob/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-pkg-config not found, library detection may fail.
mktemp -u XXXXXX
Yd2A0h
WARNING: Unknown C compiler /home/rob/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc, unable to select optimal CFLAGS
check_ld cc
check_cc
BEGIN /tmp/ffconf.m9Kg3cqt.c
    1   int main(void){ return 0; }
END /tmp/ffconf.m9Kg3cqt.c
/home/rob/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 -mfloat-abi=softfp -marm -march=armv7-a -mtune=cortex-a9 -c -o /tmp/ffconf.tO2EIBz5.o /tmp/ffconf.m9Kg3cqt.c
./configure: 640: ./configure: /home/rob/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: not found
C compiler test failed.

build_android.sh 标准输出的尾部看起来不错

libavutil/opt.c: In function ‘av_find_opt’:
libavutil/opt.c:41:5: warning: ‘av_next_option’ is deprecated (declared at libavutil/opt.h:347) [-Wdeprecated-declarations]
CC  libavutil/pixdesc.o
libavutil/opt.c: In function ‘av_opt_set_defaults’:
libavutil/opt.c:601:5: warning: ‘av_opt_set_defaults2’ is deprecated (declared at libavutil/opt.h:370) [-Wdeprecated-declarations]
CC  libavutil/random_seed.o
CC  libavutil/rational.o
CC  libavutil/rc4.o
CC  libavutil/samplefmt.o
CC  libavutil/sha.o
CC  libavutil/timecode.o
CC  libavutil/tree.o
CC  libavutil/utils.o
CC  libavutil/x86/cpu.o
INSTALL libavdevice/avdevice.h
INSTALL presets/libvpx-1080p50_60.ffpreset
INSTALL presets/libvpx-1080p.ffpreset
INSTALL presets/libvpx-360p.ffpreset
INSTALL presets/libvpx-720p50_60.ffpreset
INSTALL presets/libvpx-720p.ffpreset
INSTALL presets/libx264-ipod320.ffpreset
INSTALL presets/libx264-ipod640.ffpreset
INSTALL doc/ffprobe.xsd
INSTALL libavdevice/libavdevice.pc
INSTALL libavfilter/asrc_abuffer.h
INSTALL libavfilter/avcodec.h
INSTALL libavfilter/avfilter.h
INSTALL libavfilter/avfiltergraph.h
INSTALL libavfilter/buffersink.h
INSTALL libavfilter/version.h
INSTALL libavfilter/vsrc_buffer.h
INSTALL libavfilter/libavfilter.pc
INSTALL libavformat/avformat.h
INSTALL libavformat/avio.h
INSTALL libavformat/version.h
INSTALL libavformat/libavformat.pc
INSTALL libavresample/avresample.h
INSTALL libavresample/version.h
INSTALL libavresample/libavresample.pc
INSTALL libavcodec/avcodec.h
INSTALL libavcodec/avfft.h
INSTALL libavcodec/dxva2.h
INSTALL libavcodec/vaapi.h
INSTALL libavcodec/vda.h
INSTALL libavcodec/vdpau.h
INSTALL libavcodec/version.h
INSTALL libavcodec/xvmc.h
INSTALL libavcodec/libavcodec.pc
INSTALL libswresample/libswresample.pc
INSTALL libswresample/swresample.h
INSTALL libswscale/swscale.h
INSTALL libswscale/libswscale.pc
INSTALL libavutil/adler32.h
INSTALL libavutil/aes.h
INSTALL libavutil/attributes.h
INSTALL libavutil/audio_fifo.h
INSTALL libavutil/audioconvert.h
INSTALL libavutil/avassert.h
INSTALL libavutil/avstring.h
INSTALL libavutil/avutil.h
INSTALL libavutil/base64.h
INSTALL libavutil/bprint.h
INSTALL libavutil/bswap.h
INSTALL libavutil/common.h
INSTALL libavutil/cpu.h
INSTALL libavutil/crc.h
INSTALL libavutil/error.h
INSTALL libavutil/eval.h
INSTALL libavutil/fifo.h
INSTALL libavutil/file.h
INSTALL libavutil/imgutils.h
INSTALL libavutil/intfloat.h
INSTALL libavutil/intfloat_readwrite.h
INSTALL libavutil/intreadwrite.h
INSTALL libavutil/lfg.h
INSTALL libavutil/log.h
INSTALL libavutil/lzo.h
INSTALL libavutil/mathematics.h
INSTALL libavutil/md5.h
INSTALL libavutil/mem.h
INSTALL libavutil/dict.h
INSTALL libavutil/opt.h
INSTALL libavutil/parseutils.h
INSTALL libavutil/pixdesc.h
INSTALL libavutil/pixfmt.h
INSTALL libavutil/random_seed.h
INSTALL libavutil/rational.h
INSTALL libavutil/samplefmt.h
INSTALL libavutil/sha.h
INSTALL libavutil/timecode.h
INSTALL libavutil/timestamp.h
INSTALL libavutil/avconfig.h
INSTALL libavutil/libavutil.pc
AR  libavdevice/libavdevice.a
AR  libavfilter/libavfilter.a
AR  libavformat/libavformat.a
AR  libavresample/libavresample.a
AR  libavcodec/libavcodec.a
AR  libswresample/libswresample.a
AR  libswscale/libswscale.a
AR  libavutil/libavutil.a
INSTALL libavdevice/libavdevice.a
INSTALL libavfilter/libavfilter.a
INSTALL libavresample/libavresample.a
INSTALL libswresample/libswresample.a
INSTALL libswscale/libswscale.a
INSTALL libavutil/libavutil.a
INSTALL libavformat/libavformat.a
LD  ffmpeg_g
INSTALL libavcodec/libavcodec.a
CP  ffmpeg
STRIP   ffmpeg
INSTALL install-progs-yes
INSTALL ffmpeg

最佳答案

“未找到”错误并不表示未找到arm-linux-androideabi-gcc,该错误是从arm-linux-androideabi-gcc返回的,很可能是因为一个错误的标志。由于您的 --cross-prefix 设置正确,您可以删除 --cc 和 --nm 行。如果稍微改变交叉前缀(例如,去掉末尾的 - ),您会发现未找到的错误将更改为不太明确的错误。

尝试删除额外cflags中除了“-DANDROID -mfloat-abi=softfp -marm -march=armv7-a”之外的所有内容,并删除疯狂的额外引号,看看它是否可以编译。

关于android - ffmpeg for android build - 是否完整,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10668833/

相关文章:

amazon-web-services - 将 VSTS Build 与 AWS 结合使用的最简单方法是什么?

android - 在 openCV 上使用 CameraBridgeViewBase 拍照

php - 错误 header : ap_headers_output_filter() after putting cache header in htaccess file

linux - 如何使用 bash 脚本将一行中的一些重复模式分成多行?

linux - 在 httpd.conf 中保留 VirtualHost RewriteRule

ant - Apache Ivy : resolving dependencies embedded in an installer

linux - 尝试在 Mandriva 上构建 OS161 时出现 "bmake: no system rules (sys.mk)"

java - 使用连接后需要调用java.net.HttpURLConnection.disconnect()?

java - 如何在 Activity 退出之前释放分配给可绘制对象的内存?

android - 是否可以创建引用公共(public)模块的正确目标的 kotlin 多平台项目?