3

How can I convert an Opus audio file with the distributed ffmpeg binaries to a format usable by iOS?

Is there a way to do it without compiling FFmpeg?

FFmpeg details:

ffmpeg --version                                                                                                                                                                                                             [100%]
ffmpeg version 5.0 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 13.0.0 (clang-1300.0.29.3)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/5.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
Giacomo1968
  • 55,001
Human
  • 553
  • 1
  • That answer requires the libfdk_aac decoder which is not built-in. – Human Mar 14 '22 at 08:25
  • It doesn’t require libfdk_aac; just remove that part of the command and do this: ffmpeg -i input.opus -vbr 5 -cutoff 18000 output.m4a. Or even more simply as this: ffmpeg -i input.opus -vbr 5 output.m4a. What you are asking is just converting from .opus to something else; this is not difficult. I set .m4a but you can also set .mp3 and such without issue. – Giacomo1968 Mar 14 '22 at 15:02
  • I wasn't able to identify which part of the command was related to libfdk and which not. Apparently you can even simplify the command further to ffmpeg -i input.opus output.m4a and it still works. Since the option -vbr 5 prdouces the following warning: Codec AVOption vbr specified for output file #0 has not been used for any stream. – Human Mar 15 '22 at 09:42

1 Answers1

5

This should be a very simple task and can be handled by this very basic command that outputs an M4A file:

ffmpeg -i input.opus output.m4a

Or even this for MP3 output:

ffmpeg -i input.opus output.mp3
Giacomo1968
  • 55,001