FFmpeg: 输出流#0:1的编码器(amr_nb)未找到

3

我正在使用这个命令将flv转换为3gp

ffmpeg -y -i in.flv -ar 8000 -b:a 12.20k -ac 1 -s 176x144 out.3gp

它报了这个错误

Encoder (codec amr_nb) not found for output stream #0:1

我在yum上搜索amr_nb包,但是没有找到。

我使用的是CentOS 7。

ffmpeg -version
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil      54. 20.100 / 54. 20.100
libavcodec     56. 26.100 / 56. 26.100
libavformat    56. 25.101 / 56. 25.101
libavdevice    56.  4.100 / 56.  4.100
libavfilter     5. 11.102 /  5. 11.102
libavresample   2.  1.  0 /  2.  1.  0
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  1.100 /  1.  1.100
libpostproc    53.  3.100 / 53.  3.100

我不确定缺少了什么。 编辑: 我按照这个指南 https://s3bubble.com/installing-ffmpeg-on-centos-6-6-in-usrlocalbin/ + alijandro 的建议进行了操作。

这个命令可以在Ubuntu 22.04上运行:sudo apt install sox libsox-fmt-all && sox input.mp3 output.amr-nb - Adam Monsen
1个回答

8

您的系统上安装的ffmpeg不支持编码器amr-nb,而这是3gp格式的默认编码器。

请查看编码器列表是否有该项。

$ ffmpeg -encoders |grep amr_nb

你可以尝试。
  1. use h263/aac as the output encoder, add the option -vcodec h263 -acodec aac

  2. or build ffmpeg with amr-nb support

    • get opencore source from here https://sourceforge.net/projects/opencore-amr
    • compile the source and install to /path/to/opencore-amr
    • get the source of ffmpeg
    • configure ffmpeg with the options

      $./configure --enable-libopencore-amrnb \
      --enable-libopencore-amrwb \
      --enable-version3 \
      ...
      --extra-cflags="-I/path/to/opencore-amr/include" \
      --extra-ldflags="-L/path/to/opencore-amr/lib"
      ...
      # more configure options
      
    • compile and install ffmpeg, then your command will work

3
AMR是一种音频编解码器,因此vcodec的选择并不重要。 - Gyan
谢谢阿里杰罗,就是这样。 - m.qayyum

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接