【问题标题】:Android ffmpeg with opus support支持 opus 的 Android ffmpeg
【发布时间】:2013-09-26 10:24:58
【问题描述】:

我正在关注this 教程,进行了一些更改,我想添加opus 支持,我认为添加选项--enable-libopus 是我所需要的,但没有,当我尝试使用shell 编译时,如下所示得到错误:

配置.sh

#!/bin/bash

export ANDROID_NDK=/home/ademar/android-ndk-r9
export TOOLCHAIN=$(pwd)/temp/ffmpeg
export SYSROOT=$TOOLCHAIN/sysroot/
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=arm-linux-androideabi-4.8 --install-dir=$TOOLCHAIN

export PATH=$TOOLCHAIN/bin:$PATH
export CC=arm-linux-androideabi-gcc
export LD=arm-linux-androideabi-ld
export AR=arm-linux-androideabi-ar

CFLAGS="-O3 -Wall -mthumb -pipe -fpic -fasm \
  -finline-limit=300 -ffast-math \
  -fstrict-aliasing -Werror=strict-aliasing \
  -fmodulo-sched -fmodulo-sched-allow-regmoves \
  -Wno-psabi -Wa,--noexecstack \
  -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ \
  -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ \
  -DANDROID -DNDEBUG"

EXTRA_CFLAGS="-march=armv7-a -mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad"
EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"

FFMPEG_FLAGS="--prefix=/tmp/ffmpeg/build \
  --target-os=linux \
  --arch=arm \
  --enable-cross-compile \
  --cross-prefix=arm-linux-androideabi- \
  --enable-shared \
  --disable-symver \
  --disable-doc \
  --disable-ffplay \
  --disable-ffmpeg \
  --disable-ffprobe \
  --disable-ffserver \
  --disable-avdevice \
  --disable-avfilter \
  --disable-encoders  \
  --disable-muxers \
  --disable-filters \
  --disable-devices \
  --disable-everything \
  --enable-protocols  \
  --enable-parsers \
  --enable-demuxers \
  --disable-demuxer=sbg \
  --enable-decoders \
  --enable-bsfs \
  --disable-network \
  --enable-swscale  \
  --enable-asm \
  --enable-libopus \
  --enable-libtheora \
  --enable-libvorbis \
  --enable-nonfree \
  --enable-version3"

cd ffmpeg
./configure $FFMPEG_FLAGS --extra-cflags="$CFLAGS $EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS"

错误:

ERROR: opus not found

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 ffmpeg-user@ffmpeg.org 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.

如果需要我可以发布config.log 内容,但它很大。

在文件夹 ffmpeg 上,我在分支 release/1.2 上有一个来自 source.ffmpeg.org 的 git 克隆

【问题讨论】:

    标签: android android-ndk ffmpeg opus


    【解决方案1】:

    您需要确保在构建 ffmpeg 之前构建和安装 libopus。只是添加启用选项告诉 ffmpeg 允许 opus,但这并不意味着您的系统已经安装了 libopus。这就是 configure 抱怨的原因。

    安装 libopus。有关如何下载和构建的详细信息,请参阅http://www.opus-codec.org/

    【讨论】:

    • 无法理解,如果我已经安装了 opus 库,我该如何将它传递给 ffmpeg?
    • 然后它应该在配置中找到它。如果没有,将有一个选项在配置中提供目录路径。键入 ./configure --help 以获取选项列表,其中之一将用于提供库的路径。
    【解决方案2】:

    ffmpeg 的最新版本现在包含 opus 编解码器。您不再需要在 ffmpeg 中包含 libopus。希望这可以帮助其他人对此进行调查。

    【讨论】:

    • 哇,它看起来非常好,但这里ffmpeg.org/ffmpeg-codecs.html#libopus-1 仍然通知“在配置过程中需要存在 libopus 标头和库。您需要使用 --enable-libopus 显式配置构建。”也许它只是不推荐使用的文档,你有包含 libopus 的提交吗?
    • @ademar111190 自 FFmpeg 2.3 opus 解码支持已添加。我不确定编码是否可用,但解码有效。我正在使用官方发布的 FFmpeg 2.5。
    • 明白了。非常感谢@Jona =)
    • FFmpeg 自带的opus 编码器不好,不推荐。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-14
    • 1970-01-01
    • 2013-12-14
    • 1970-01-01
    相关资源
    最近更新 更多