如何在Windows上编译使用Cygwin和Android的NDK R9C的ffmpeg-2.2.2 [英] How to compile ffmpeg-2.2.2 on windows with cygwin and android ndk r9c
问题描述
也有人编译成功
在Windows上使用Cygwin和Android的ndkr9c的ffmpeg-2.2.2?
ffmpeg-2.2.2 on windows with cygwin and android ndkr9c ?
,也可以点我一个最新的教程吗?
Or can point me to an up to date tutorial ?
(<一href="http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/">http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/工作不适合我 我得到的Makefile:2:config.mak:没有这样的文件? cygwin的管理devel软件包GNOME是完全安装并-v OK)
(http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/ isn't working for me i get Makefile:2: config.mak: No such file... cygwin admin devel gnome is completely installed and make -v ok )
我需要转换一个视频图像(活墙纸)...你知道更好的 方法或FFmpeg的最好?
I need to convert a video to images(for live-wallpaper)... do you know a better method or is ffmpeg the best ?
THX
推荐答案
开始与罗马的的教程。
以下更改适用于Windows系统:你应该使用 NDK make.exe
,不是从的cygwin 之一。所以,我只是写了 D:/dev/Android/ndk/$p$pbuilt/windows-x86_64/bin/make.exe
在我的 build_android.sh 。出于某种奇怪的原因,我不能跑使清洁
- 但我只是选择忽略这个问题,现在
Start with Roman's tutorial.
Following changes apply to Windows: you should use the NDK make.exe
, not the one from cygwin. So, I simply wrote d:/dev/Android/ndk/prebuilt/windows-x86_64/bin/make.exe
in my build_android.sh. For some weird reason, I could not run make clean
- but I simply chose to ignore this problem for now.
继教程,不要忘记设置
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64
此外,使用混合风格的路径,即 D是:/ dev /不管
,而不是的cygwin 风格 / cygdrive / D的/ dev /不管
。请注意,不要使用路径与空间 - 无论对于 NDK 安装,也没有为的ffmpeg
git的克隆
Also, use mixed-style paths, i.e. d:/dev/whatever
and not cygwin style /cygdrive/d/dev/whatever
. Be careful not to use paths with spaces - neither for ndk installation, nor for ffmpeg
git clone.
是的ffmpeg 2.2 ,您可以使用 - 目标OS =机器人
为 ./配置
,而不是重整 ./配置
文件中的步骤所述2
With ffmpeg 2.2, you can use --target-os=android
for ./configure
, instead of mangling ./configure
file as described in step 2.
在我的机器上,我没有新闻
和 OD
命令。我选择了简单地伪造它们,写
On my machine, I did not have pr
and od
commands. I chose simply to fake them, writing
echo 'cat $3' > ./pr
echo 'echo od' > ./od
这些不破坏身材。
所以,我的构建过程如下:
So, my build process is as follows:
git clean -d -f -x
./configure --enable-shared --disable-static --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-doc --disable-symver --cross-prefix=d:/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi- --target-os=android --arch=arm --enable-cross-compile --sysroot=d:/android-ndk-r9c/platforms/android-9/arch-arm/ --extra-cflags="-Os -fpic"
编译程序会显示一些警告,但在的.so 文件全部产生。
要启用NEON,我用
--extra-cflags="-Os -fpic -marm -march=armv7-a -mfloat-abi=softfp -mfpu=neon"
--extra-ldflags="-Wl,--fix-cortex-a8"
现在, libav codec.so
不能建立了:连接器列表中的文件太多。 所以,后坠毁,我手动启动了连接器:
Now, libavcodec.so
could not be built anymore: too many files on the linker list. So, after it crashed, I launched the linker manually:
$ d:/Dev/Android/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64//bin/arm-linux-androideabi-gcc -shared -Wl,-Bsymbolic -Wl,--version-script,libavcodec/libavcodec.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,--fix-cortex-a8 --sysroot=d:/Dev/Android/ndk/platforms/android-9/arch-arm/ -isysroot d:/Dev/Android/ndk/platforms/android-9/arch-arm/ -Wl,--as-needed -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample @libavcodec/libavcodec.list -lswresample -lavutil -lm -lz -pthread -o libavcodec/libavcodec.so.55
我修补 library.mak
文件,如下所示:为 $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
,更换
I patch the library.mak
file as follows: for $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
, replace
$$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
与
$(Q)echo >$(SUBDIR)lib$(NAME).list $(wordlist 1,400,$(filter %.o,$$<))
$(Q)echo >>$(SUBDIR)lib$(NAME).list $(wordlist 401,999,$(filter %.o,$$<)
$$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) @$(SUBDIR)lib$(NAME).list $(FFEXTRALIBS)
..并从那里,让
进展顺利。
PS:我用 使-n libav codeC / libav codec.so.55
至prepare的的响应文件的 libav codeC / libav codec.list
。
PS: I used make -n libavcodec/libavcodec.so.55
to prepare the response file libavcodec/libavcodec.list
.
PPS:以下是另一篇文章帮助建造和使用的ffmpeg为Android。
PPS: Here is another article that helps to build and use ffmpeg for Android.
这篇关于如何在Windows上编译使用Cygwin和Android的NDK R9C的ffmpeg-2.2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!