2015-12-18 78 views
0

我跟了很多教程buildinf ffmpeg.so文件像錯誤在建築物的ffmpeg的Android

http://enoent.fr/blog/2014/06/20/compile-ffmpeg-for-android/

http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/

和許多教程,但最後我都堅持這個錯誤每個時間我不知道如何解決它請任何人知道如何解決它,然後幫我

我的build.sh文件看起來像這樣

NDK=C:/Users/Benzatine/Downloads/android-ndk-r10e 
    SYSROOT=$NDK/platforms/android-19/arch-arm/ 
    TOOLCHAIN=$NDK/toolchains//arm-linux-androideabi-4.8/prebuilt/windows-x86_64 
function build_one 
{ 
./configure \ 
--prefix=$PREFIX \ 
--enable-shared \ 
--disable-static \ 
--disable-doc \ 
--disable-ffmpeg \ 
--disable-ffplay \ 
--disable-ffprobe \ 
--disable-ffserver \ 
--disable-avdevice \ 
--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 

但是,當執行make命令它提供了以下錯誤

LD  libswscale/libswscale-3.so 
    c:/users/benzatine/downloads/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: error:  libavutil/libavutil.so:1:1: syntax error, unexpected '!', expecting $end 
c:/users/benzatine/downloads/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: error: libavutil/libavutil.so: not an object or archive 
collect2.exe: error: ld returned 1 exit status 
library.mak:111: recipe for target 'libswscale/libswscale-3.so' failed 
make: *** [libswscale/libswscale-3.so] Error 1 
每次我嘗試建立的ffmpeg這個錯誤occure如何解決時間

它,請幫助我的人

+0

請人幫我解決這個問題,我試圖這幾乎是從統計最近一個月 – user3269550

回答

0

我會假設您正在基於錯誤消息在Windows系統上構建它。

我剛剛在Facebook上發現了這篇文章,所以我不打算爲此付出任何代價。特別是他只是使用其他項目,並調整它使其強制工作。它使用Android'愛'版本並編譯它在Windows系統。

FFMpeg(https://www.ffmpeg.org),用C語言編寫的用於多媒體相關任務的最常用的庫文件之一。 它有很多功能可以爲您的應用程序添加多媒體支持,但如果您不想使用C/C++創建應用程序,則可能會遇到問題,因爲我們有一個'C'庫將其移植到其他語言中。相信我把它移植到 不同的語言是很多工作都充滿了錯誤。幸運的是,你可以在互聯網上找到教程並簡單地構建 腳本,但是很明顯,它們只是通過假設你將它移植到基於nix的操作系統而編寫的,並且在Windows操作系統上移植它的一些教程不起作用(至少對我來說。 :)) 但我使用ffmpeg的主要原因是爲Android添加了多媒體功能,而不是由標準Android API提供的 。我在互聯網 上發現了一些使用FFMpeg'Love'版本的預製android項目。這是該項目。

In case you are wondering how to use it in your Android project , here are the step 

1) Add a native support to the Android Project by right-clicking the Android Tools>Add Native Support... 
2) Copy 'armeabi' folder to 'libs' folder of your project 
3) Replace 'obj' folder with the 'obj' of ffmpeg project in the attached file 
4) Add 'ffmpeg' folder to the 'jni' folder 
5) Replace 'Androd.mk' folder with the 'Android.mk' of the ffmpeg project in the attached file 
6) Write your code in C/C++ and enjoy 

As always if you have any trouble or question you can comment them and I will answer them as soon as possible 

附加文件:http://robot-mitya.googlecode.com/files/MyFfmpegTest.zip

來源:http://dmitrydzz-hobby.blogspot.com/2012/04/how-to-build-ffmpeg-and-use-it-in.html

+0

先生我怎樣才能直接使用執行ffmpeg的命令我的項目中的java代碼庫@ Sun Maung Oo – user3269550

+0

ffmpeg命令是什麼意思?您是否試圖在Android中構建ffmpeg可執行文件? –

+0

是的,我想運行使用java的processbuilder ffmpeg命令直接 – user3269550