如何编译ffmpeg-2.2.2在windows上与cygwin和android ndk r9c [英] How to compile ffmpeg-2.2.2 on windows with cygwin and android ndk r9c
问题描述
有人成功编译了
ffmpeg-2.2.2在Windows上使用cygwin和android ndkr9c吗?
或者可以指点我最新的教程吗?
( http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/ 对我不起作用
i get Makefile:2:config.mak:没有这样的文件...
cygwin admin devel gnome完全安装,并且使-v确定)
将视频转换为图像(用于动态壁纸)...你知道更好的
方法或者是最好的ffmpeg吗?
thx
从Roman的教程。
以下更改适用于Windows:您应该使用 NDK make.exe
,而不是 cygwin 。所以,我只是在我的 build_android.sh 中写了 d:/dev/Android/ndk/prebuilt/windows-x86_64/bin/make.exe
。对于一些奇怪的原因,我不能运行 make clean
- 但我现在只是选择忽略这个问题。
按照教程,不要忘记设置
TOOLCHAIN = $ NDK / toolchains / arm-linux-androideabi-4.8 / prebuilt / windows-x86_64
此外,使用混合样式路径,即 d :/ dev / whatever
,而不是 cygwin style / cygdrive / d / dev / whatever
。注意不要使用带空格的路径 - 既不是 ndk 安装,也不是 ffmpeg
git clone。
使用 ffmpeg 2.2 ,您可以使用 - target-os = android
为 ./ configure
,而不是第2步中描述的修改 ./ configure
文件。
在我的机器上,我没有 pr
和 od
命令。我选择只是伪造他们,写
echo'cat $ 3' ./pr
echo'echo od'> ./od
这些不会破坏构建。
所以,我的构建过程如下:
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
现在, libavcodec.so
无法再构建:链接器列表。 所以,在它崩溃后,我手动启动链接器:
$ 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, - 根据需要-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)
,替换
$$(LD)$(SHFLAGS)$(LDFLAGS)$$(LD_O)$$(filter%.o,$$ ^)$(FFEXTRALIBS)
pre>
与
$(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 $ ).list $(FFEXTRALIBS)
..从
/ code>顺利进行。
PS:我使用了make -n libavcodec / libavcodec .so.55
以准备响应文件libavcodec / libavcodec.list
。
PPS:这里是另一篇文章,帮助构建和使用ffmpeg for Android。
did someone successfully compile
ffmpeg-2.2.2 on windows with cygwin and android ndkr9c ?
Or can point me to an up to date tutorial ?
(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 )
I need to convert a video to images(for live-wallpaper)... do you know a better method or is ffmpeg the best ?
thx
解决方案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 wroted:/dev/Android/ndk/prebuilt/windows-x86_64/bin/make.exe
in my build_android.sh. For some weird reason, I could not runmake clean
- but I simply chose to ignore this problem for now.Following the tutorial, don't forget to set
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64
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 forffmpeg
git clone.With ffmpeg 2.2, you can use
--target-os=android
for./configure
, instead of mangling./configure
file as described in step 2.On my machine, I did not have
pr
andod
commands. I chose simply to fake them, writingecho 'cat $3' > ./pr echo 'echo od' > ./od
These do not spoil the build.
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"
Compilation does display some warnings, but the .so files are all produced.
To enable NEON, I used
--extra-cflags="-Os -fpic -marm -march=armv7-a -mfloat-abi=softfp -mfpu=neon" --extra-ldflags="-Wl,--fix-cortex-a8"
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
I patch the
library.mak
file as follows: for$(SUBDIR)$(SLIBNAME_WITH_MAJOR)
, replace$$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
with
$(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)
.. and from there,
make
proceeded smoothly.
PS: I usedmake -n libavcodec/libavcodec.so.55
to prepare the response filelibavcodec/libavcodec.list
.PPS: Here is another article that helps to build and use ffmpeg for Android.
这篇关于如何编译ffmpeg-2.2.2在windows上与cygwin和android ndk r9c的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!