簡體   English   中英

ffmpeg for android build-完成嗎

[英]ffmpeg for android build - is it complete

//編輯節省時間,並參考SF項目 海事組織,它可以節省大量的工作,以加快速度.....

在此問題上進行更多工作后:

添加了一個git 項目

通過安裝自定義工具鏈,構建起來更容易,這樣您就可以以簡單的方式調用編譯器

來自ndk-build的樣本stdout

-最初在Windows Vista的vmplayer內部使用ubuntu 12.04。 IMO linux比cygwin更適合構建。

我遵循這些指示獲得不確定的結果,其中存在以下情況。

build_android.sh似乎正常退出
config.log在從交叉工具鏈確認gcc時出錯
所有的靜態庫都可以正常構建(./libavfilter、./libavcodec等)
ffmpeg.o在那兒執行
沒有./android目錄,按照config的前綴設置

看來我可以將二進制文件推送到手機中並在外殼中進行測試。 如果可以的話,我可以找一個靜態庫的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 stdout的尾部看起來不錯

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行。 如果稍微更改交叉前綴(例如,將-刪除掉),您會發現未找到的錯誤將變為不太模糊的錯誤。

嘗試除去多余的cflag中除“ -DANDROID -mfloat-abi = softfp -marm -march = armv7-a”之外的所有內容,並刪除瘋狂的多余引號並查看其是否可以編譯。

這是您遵循的指南所說的:

腳本執行完畢后,在ffmpeg-0.8目錄下將存在一個名為android的文件夾,其中包含構建的所有輸出。

更改了標准'build_android.sh'中的2個項目,以便至少根據$ PREFIX在目標目錄中獲得輸出...

簡短的變更清單

NDK=/home/rob/src/android-ndk-r8
PLATFORM=$NDK/platforms/android-8/arch-arm/
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
export PATH=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:$PATH

...

mkdir -p $PREFIX
..
make clean
  1. 導出2.創建目標目錄

我在原始常見問題中抱怨的編譯器檢查仍然存在...

/home/rob/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc無法創建可執行文件。 C編譯器測試失敗。

但是我將輸出二進制文件放在了正確的文件夾中,因此,我將它們移動到電話中並在外殼程序中的CLI中進行測試,以查看是否可以創建將在電話上播放的WEBM文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM