Audacity & OPUS Files?
Solution 1
As Doug has pointed out Audacity has the ability to easily import Opus files under Ubuntu 17.04 and also the ability to export as Opus with a small work around. To illustrate:
1. Importing Opus Files with Audacity
Audacity easily imports Opus files either by:
- Drag and drop the Opus files directly onto the main Audacity window
- File --> Import --> Audio from the Audacity main window
This has tested without flaw on my installation of Audacity 2.1.2 under Ubuntu 17.04.
2. Exporting Opus Files with Audacity
Audacity can export as Opus but does not have the capability to directly export as Opus or to use the conventional 'Custom FFmpeg Export' setting.
Instead go to:
File --> Export --> External Program
and change the Command options to something like the following:
And to make copying and pasting a little easier here is the command line:
ffmpeg -i - -c:a libopus -b:a 128k "%f"
And this should give you the results you are after...
Notes:
- Audacity: Exporting to an External Program sends audio via a command-line to an external application, either for processing or for encoding as a file.
Solution 2
There is need for ffmpeg
to export opus.
First, install opus-tools
with:
sudo apt install opus-tools
Then, one can simply use something like:
opusenc --bitrate 192 - "%f".ogg
instead of the ffmpeg
command.
This works fine with Audacity 2.1.3 and opusenc 0.1.9.
EDIT
ffmpeg
does not support quality settings for opus. Here is part of the output using today's 3.4 git snapshot of ffmpeg
when trying something like
ffmpeg -i - -c:a libopus -q:a 7 "%f"
as command:
[libopus @ 0x3f065c0] No bit rate set. Defaulting to 96000 bps.
[libopus @ 0x3f065c0] Quality-based encoding not supported, please specify a bitrate and VBR setting.
Related videos on Youtube
![Sarah Szabo](https://i.stack.imgur.com/5oAMO.png?s=256&g=1)
Sarah Szabo
Updated on September 18, 2022Comments
-
Sarah Szabo almost 2 years
How can I get Audacity to work with Opus files? Is there a plugin I can get?
I've heard that I can point Audacity to a framework for encoding/decoding and delegate the work to the framework, since Audacity doesn't support
.opus
yet.How should I go about adding
.opus
support to Audacity?Edit 0: (After trying the external program and the file not appearing):
Edit 1: After Recompiling A file with the file name now appears in the folder, but it appears to be unplayable.
-
doug about 7 yearsaudacity should open an .opus file just fine (does so here) As far as exporting to .opus then use external program option (ffmpeg), read here forum.audacityteam.org/…
-
andrew.46 about 7 years@doug I have taken the substantial liberty of expanding on your succinct comment to produce a full answer...
-
-
Sarah Szabo almost 7 yearsI tried the command in the export audio/external program window, but the file doesn't appear. I get an output from
libopus
, I'll post the output. -
andrew.46 almost 7 years@SarahSzabo Your copy of FFmpeg does not have support for encoding with libopus, is this the repository version for 17.04? I will double check when I get home away from this Windows computer...
-
Sarah Szabo almost 7 yearsThis was the output of
ffmpeg -version
:ffmpeg -version ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.3.0 (Ubuntu 6.3.0-12ubuntu2) 20170406
I just got it from git. -
andrew.46 almost 7 years@SarahSzabo OIC. Bear in mind that Zesty already has a decent and reasonably fully featured version of FFmpeg in the standard repositories, you might be better off using this? However if you have compiled your own copy recompile adding
--enable-libopus
to your ./configure string and make sure you have the opus '-devel' packages installed:sudo apt-get install libopus-dev
... -
Sarah Szabo almost 7 yearsI installed the opus-devel packages, and then recompiled with the flags specified. I edited the post to clarify.
-
andrew.46 almost 7 years@SarahSzabo This is because you have not actually compiled from git, you have used a release version and thus quality encoding is not available. Try
ffmpeg -i - -c:a libopus -b:a 128k "%f"
for your 'external command' and then all should be well :) -
andrew.46 over 6 yearsOops, not sure where I got scrambled with the quality settings, I have deleted this section. BTW your answer might be better suited as a comment?
-
hanky over 6 yearsI tried to post a comment, but it looks like I haven't earned enough reputation to be allowed to comment others entries, so I edited my post...