简体   繁体   English

如何在OS X上将audio.m4a转换为audio.amr?

[英]How to convert audio.m4a to audio.amr on OS X?

I tried installing ffmpeg 我尝试安装ffmpeg

$ brew install ffmpeg

and running ffmpeg 并运行ffmpeg

$ ffmpeg -i audio.m4a -ar 8000 -ab 12.2k audio.amr

I got the following error: 我收到以下错误:

Automatic encoder selection failed for output stream #0:0. 输出流#0:0的自动编码器选择失败。 Default encoder for format amr (codec amr_nb) is probably disabled. 格式amr(codec amr_nb)的默认编码器可能已禁用。 Please choose an encoder manually. 请手动选择编码器。 Error selecting an encoder for stream 0:0 为流0:0选择编码器时出错

I can't figure out how to enable amr_nb. 我不知道如何启用amr_nb。

Step 1: Find the AMR install option for ffmpeg Homebrew package 步骤1:查找ffmpeg Homebrew软件包的AMR安装选项

List all install options for ffmpeg Homebrew package: 列出ffmpeg Homebrew软件包的所有安装选项:

$ brew info ffmpeg

ffmpeg: stable 3.2.2 (bottled), HEAD ffmpeg:稳定3.2.2(瓶装),HEAD
Play, record, convert, and stream audio and video 播放,录制,转换和流音频和视频
https://ffmpeg.org/ https://ffmpeg.org/
/usr/local/Cellar/ffmpeg/3.2.2 (239 files, 50.3M) * /usr/local/Cellar/ffmpeg/3.2.2(239个文件,50.3M)*
Built from source on 2016-12-14 at 17:43:58 with: --with-opencore-amr 从2016年12月14日在17:43:58从源构建,具有:--with-opencore-amr
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ffmpeg.rb 来自: https : //github.com/Homebrew/homebrew-core/blob/master/Formula/ffmpeg.rb

==> Dependencies ==>依赖关系
Build: pkg-config ✔, texi2html ✔, yasm ✔ 构建:pkg-config✔,texi2html✔,Yasm✔
Recommended: lame ✔, x264 ✔, xvid ✔ 推荐:la脚✔,x264✔,xvid✔
Optional: chromaprint ✘, fdk-aac ✘, fontconfig ✘, freetype ✘, frei0r ✘, game-music-emu ✘, libass ✘, libbluray ✘, libbs2b ✘, libcaca ✘, libebur128 ✘, libgsm ✘, libmodplug ✘, libsoxr ✘, libssh ✘, libvidstab ✘, libvorbis ✘, libvpx ✘, opencore-amr ✔, openh264 ✘, openjpeg ✘, openssl ✘, opus ✘, rtmpdump ✘, rubberband ✘, schroedinger ✘, sdl2 ✘, snappy ✘, speex ✘, tesseract ✘, theora ✘, two-lame ✘, wavpack ✘, webp ✘, x265 ✘, xz ✘, zeromq ✘, zimg ✘ 可选:chromaprint✘,fdk-aac✘,fontconfig✘,freetype✘,frei0r✘,game-music-emu✘,libass✘,libbluray✘,libbs2b✘,libcaca✘,libebur128✘,libgsm✘,libmodplug✘,libsoxr libssh✘,libvidstab✘,libvorbis✘,libvpx✘,opencore-amr✔,openh264✘,openjpeg✘,openssl✘,opus✘,rtmpdump✘,橡皮筋✘,schroedinger✘,sdl2✘,snappy✘,speex✘,tesse theora✘,两层✘,wavpack✘,webp✘,x265✘,xz✘,zeromq✘,zimg✘

==> Options ==>选项
... ...
--with-opencore-amr --with-opencore-amr
Enable Opencore AMR NR/WB audio format 启用Opencore AMR NR / WB音频格式
... ...

More concisely: 更简洁地说:

$ brew info ffmpeg | grep amr

--with-opencore-amr --with-opencore-amr

Step 2: Install ffmpeg using Homebrew install options 步骤2:使用Homebrew安装选项安装ffmpeg

$ brew install ffmpeg --with-opencore-amr 

Step 3: Run ffmpeg 步骤3:执行ffmpeg

$ ffmpeg -i audio.m4a -ar 8000 -ab 12.2k audio.amr

AMR codec support is via external libraries. AMR编解码器支持通过外部库提供。

You can get OS X binaries with those libraries linked from https://evermeet.cx/ffmpeg/ . 您可以通过链接到https://evermeet.cx/ffmpeg/的库获取OS X二进制文件。 Get the snapshot or nightly build. 获取快照或每晚构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM