我已經看到很多關於FFmpeg和在Android中使用FFmpeg的帖子,但是我發現這些帖子大部分都是針對FFmpeg或Android NDK的舊版本。我能從https://github.com/mconf/android-ffmpeg得到結果,其中包括文件:「libavcodec.so」,「libavformat.so」,「libavutil.so」,「libswscale.so」。但是,僅僅將這些文件添加到我的項目似乎不足以使用FFmpeg。 (我遵循https://stackoverflow.com/a/21773572/1877798作爲參考指南)。有可能是我在我的項目中配置這些文件時做了錯誤的事情,或者我在構建Android的FFmpeg時做了一些錯誤。 (應該有更多的文件嗎?)Android - 集成ffmpeg和android-ndk-r9c
我想知道是否有最新的指南,建設或整合FFmpeg在Android項目。我正在使用FFmpeg(截至2/27/14)和Android NDK 9c。 如果沒有,是否有人對其他庫有其他建議?我正嘗試拍攝一組圖像文件並以編程方式創建視頻/動畫gif。
謝謝! :-)
~~編輯~~
我發現http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/comment-page-4/和幾個人在GitHub上找到。然而,他們似乎都在努力構建FFmpeg。我使用的是Mac OS X
這裏是我的腳本:
#!/bin/bash
NDK=/Downloads/android-ndk-r9c
SYSROOT=$NDK/platforms/android-18/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
# Note: Change the TOOLCHAIN to match that available for your host system.
# darwin-x86_64 is for Mac OS X, but you knew that.
function build_one
{
./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-programs \
--disable-doc \
--disable-symver \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
這裏是日誌:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include- dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
/Downloads/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
[email protected] mailing list or IRC#ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
Makefile:2: config.mak: No such file or directory
Makefile:48: /common.mak: No such file or directory
Makefile:91: /libavutil/Makefile: No such file or directory
Makefile:91: /library.mak: No such file or directory
Makefile:168: /doc/Makefile: No such file or directory
Makefile:169: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
Makefile:2: config.mak: No such file or directory
Makefile:48: /common.mak: No such file or directory
Makefile:91: /libavutil/Makefile: No such file or directory
Makefile:91: /library.mak: No such file or directory
Makefile:168: /doc/Makefile: No such file or directory
Makefile:169: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
Makefile:2: config.mak: No such file or directory
Makefile:48: /common.mak: No such file or directory
Makefile:91: /libavutil/Makefile: No such file or directory
Makefile:91: /library.mak: No such file or directory
Makefile:168: /doc/Makefile: No such file or directory
Makefile:169: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
你能幫我在那裏:如何使用ijkplayer庫]( http://stackoverflow.com/questions/24594674/how-to-use-ijkplayer-library) – MAY3AM