加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Windows中的FFMPEG for android无法成功编译

发布时间:2020-12-14 02:50:42 所属栏目:Windows 来源:网络整理
导读:我试图在 Windows 8.1中编译FFMPEG for android但我在build_android.sh中的32行时出错 ./build_android.sh:line 32:语法错误:意外的文件结束 当我在cygwin中执行命令时 chmod x build_android.sh ./build_android.sh 如果你知道在windows中编译ffmpeg for
我试图在 Windows 8.1中编译FFMPEG for android但我在build_android.sh中的32行时出错

./build_android.sh:line 32:语法错误:意外的文件结束

当我在cygwin中执行命令时

chmod x build_android.sh

./build_android.sh

如果你知道在windows中编译ffmpeg for android的步骤以及如何在android中使用ffmpeg那么请求回复我.

我在引用.
http://www.packtpub.com/sites/default/files/downloads/Developing_Multimedia_Applications_with_NDK.pdf
,

https://trac.ffmpeg.org/wiki/CompilationGuide/Android和

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

build_android.sh

#!/bin/bash
NDK=E:/android-ndk-r9d
SYSROOT=$NDK/platforms/android-9/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/windows
function build_one { ./configure 
--prefix=$PREFIX 
--disable-shared 
--enable-static 
--disable-doc 
--enable-ffmpeg 
--disable-ffplay 
--disable-ffprobe 
--disable-ffserver 
--enable-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 instal }

make install
}

要么

make install; }

因为这样,你是passig}作为make的第二个参数,你的函数build_one没有关闭}.

编辑

你能尝试一下吗?

NDK=E:/android-ndk-r9d
SYSROOT=$NDK/platforms/android-9/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/windows
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
./configure 
--prefix=$PREFIX 
--disable-shared 
--enable-static 
--disable-doc 
--enable-ffmpeg 
--disable-ffplay 
--disable-ffprobe 
--disable-ffserver 
--enable-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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读