Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The Opus audio codec looks like the best thing ever for compressing audio. It has recently become supported in the latest ffmpeg and VLC players. However, there is no documentation I can find on how to actually encode media with it. Can someone please direct me to said docs, preferably with specifics to ffmpeg flags and usage? I have a lot of audiobooks that are taking up far too much space and Opus looks like the perfect format to keep them in.

share|improve this question
    
You did not mention your OS. –  LordNeckbeard Dec 9 '12 at 17:48

2 Answers 2

up vote 5 down vote accepted
ffmpeg -i input -acodec libopus -b:a bitrate -vbr on -compression_level 10 output

The ffmpeg wiki has a list of options and descriptions for libopus.

Make sure you compiled ffmpeg with --enable-libopus!

share|improve this answer
    
This is great! I had figured out how to encode with ffmpeg, but didn't know about the -vbr and --compression_level flags. This is exactly what I was looking for! –  nakedhitman Dec 5 '13 at 20:36
  1. Download Opus-tools

  2. Encode:
    opusenc --bitrate 64 What_A_Feeling.wav What_A_Feeling_64.opus

  3. Decode: (to play in any media player, useful if your media player does not support opus yet):
    opusdec What_A_Feeling_64.opus What_A_Feeling_opus64.wav

(What_A_Feeling is a song name)

share|improve this answer
    
Thanks, but I was hoping for something a bit more detailed. Are there variable bit rate options? What other flags can I pass to optimize the audio stream? –  nakedhitman Dec 9 '12 at 21:56
    
@nakedhitman The --vbr option is default. See the man page for opusenc. You can also encode with ffmpeg but it needs to be compiled with --enable-libopus after installing libopus. –  LordNeckbeard Dec 9 '12 at 23:10
    
That helps, thank you. –  nakedhitman Dec 10 '12 at 4:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.