Add tags to an Ogg Opus file

Solution 1:

Times have changed since this question was first asked and then answered! Now in October 2017 Ogg Opus files have become much more mainstream and there are several good choices under Ubuntu to allow tagging of your Ogg Opus files.

I detail 3 methods below that I would personally recommend:

1. EasyTag

A modern version of EasyTag can tag Ogg Opus files.

Edit: As has been pointed out this is less of a good idea as there is an unresolved issue with broken tagging of Ogg Vorbis files. In my experience the safe version of EasyTag for Ogg Vorbis is 2.4.2 and this version has given me personally no issues.

First install EasyTag:

sudo apt-get install easytag

Then open your Ogg Opus file with EasyTag for tag editing! A screenshot from my own system seen below:

enter image description here

Other good choices could be PuddleTag or Kid3...

2. Creating tags as you encode with Opusenc:

If you prefer the command line you can create your tags as you encode your files using opusenc. Install this utility by running the following:

sudo apt-get install opus-tools

The command line that I used to create my test file is as follows:

opusenc --bitrate 128 \
        --artist "Jody Marie Gnant" \
        --title "Lucky Night" \
        --date "1995" \
        --album "Treasure Quest Soundtrack" \
        --genre "Soundtrack" \
        luckynight.wav luckynight.opus

More tags are available to add to the syntax above and all can be seen by running opusenc -h from the command line.

3. Ripping audio CDs to Ogg Opus + tagging

Again if you are keen on the command line and you are creating your Ogg Opus audio files from audio CDs under newer versions of Ubuntu you can use abcde to rip, convert as well as tag with a single command. Install abcde as follows:

sudo apt-get install abcde opus-tools

Then place the following configuration file in ~/.abcde.conf:

# -----------------$HOME/.abcde.conf----------------- #
# 
# A sample configuration file to convert music cds to 
#       Opus using abcde version 2.7.2
# 
# http://andrews-corner.org/linux/abcde/index.html
# -------------------------------------------------- #

# Encode tracks immediately after reading. Saves disk space, gives
# better reading of 'scratchy' disks and better troubleshooting of
# encoding process but slows the operation of abcde quite a bit:
LOWDISK=y

# Specify the method to use to retrieve the track information,
# I give the default below but consider setting 'musicbrainz'
# instead, which is my own preferred option:
CDDBMETHOD=cddb

# Make a local cache of cddb entries and then volunteer to use 
# these entries when and if they match the cd:
CDDBCOPYLOCAL="y"
CDDBLOCALDIR="$HOME/.cddb"
CDDBLOCALRECURSIVE="y"
CDDBUSELOCAL="y"

# Specify the encoder to use for Opus. In this case
# the only choice is opusenc.
OPUSENCODER=opusenc

# Specify the path to the selected encoder. In most cases the encoder
# should be in your $PATH as I illustrate below, otherwise you will 
# need to specify the full path. For example: /usr/bin/opusenc
OPUSENC=opusenc

# Specify your required encoding options here. Multiple options can
# be selected as '--preset standard --another-option' etc.
# In vbr mode the bitrate setting allows for a range of bitrates, use
# --cvbr or --hard-cbr for exact bitrate control. See all of the options
# by running ;opusenc -h' from the command line...
OPUSENCOPTS="--vbr --bitrate 128"

# Output type for opus.
OUTPUTTYPE="opus"

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac. New to abcde 2.7 is 'libcdio'.
CDROMREADERSYNTAX=cdparanoia            

# Give the location of the ripping program and pass any extra options,
# if using libcdio set 'CD_PARANOIA=cd-paranoia'.
CDPARANOIA=cdparanoia  
CDPARANOIAOPTS="--never-skip=40"

# Give the location of the CD identification program:       
CDDISCID=cd-discid            

# Give the base location here for the encoded music files.
OUTPUTDIR="$HOME/Music"               

# The default actions that abcde will take.
ACTIONS=cddb,playlist,read,encode,tag,move,clean

# Decide here how you want the tracks labelled for a standard 'single-artist',
# multi-track encode and also for a multi-track, 'various-artist' encode:
OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}.${TRACKFILE}'
VAOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}'

# Decide here how you want the tracks labelled for a standard 'single-artist',
# single-track encode and also for a single-track 'various-artist' encode.
# (Create a single-track encode with 'abcde -1' from the commandline.)
ONETRACKOUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}'
VAONETRACKOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}'

# Create playlists for single and various-artist encodes. I would suggest
# commenting these out for single-track encoding.
PLAYLISTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}.m3u'
VAPLAYLISTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}.m3u'

# This function takes out dots preceding the album name, and removes a grab
# bag of illegal characters. It allows spaces, if you do not wish spaces add
# in -e 's/ /_/g' after the first sed command.
mungefilename ()
{
  echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]"
}

# What extra options?
MAXPROCS=2                              # Run a few encoders simultaneously
PADTRACKS=y                             # Makes tracks 01 02 not 1 2
EXTRAVERBOSE=2                          # Useful for debugging
COMMENT='abcde version 2.7.2'           # Place a comment...
EJECTCD=y                               # Please eject cd when finished :-)

Then simply run the command:

abcde

to set the process running!

In Conclusion:

Under a modern version of Ubuntu you will be spoiled for choices in tagging your Ogg Opus files with good choices from both gui and command line...

Solution 2:

The opus standard is quite new and hasn't gained good support for tools yet. The opus stream is usually wrapped in ogg containers; when a program which us unaware of opus looks at the containers stream, it looks for the stream codecs it knows (usually vorbis or speex for audio).

The current state of support is stated on opus' Wikipedia page: https://en.wikipedia.org/wiki/Opus_(audio_format)#Support_in_software

VLC version 2.04 is expected to get opus support, but it's not out yet.

I use wine with foobar2000 to tag opus files under linux, and it works well.

Solution 3:

I prefer to use “Ex Falso”. It has “Tags from path”, “Rename files”, “Track Numbers” features: https://quodlibet.readthedocs.io/en/latest/screenshots.html

Before I used it for mp3 files. But now I used it for opus file and it works great. My Current Ex Falso version is 4.2.1 (Operating system is Ubuntu 20.04). It can be installed from the “Ubuntu Software” center.

Solution 4:

users who prefer the command line have multiple options, one is tracktag from the python-audiotools package to write a Vorbis Comment to an Opus file. opusenc takes the metadata only while transcoding. For Debian/Ubuntu its a quick

apt install audiotools

Usage:

tracktag --name "title" --artist "interpret" file.opus

another option to edit any music file is music-tag.

pip3 install --user music_tag
alias musictag='python3 -m music_tag'

Usage:

musictag --set "title:Title" --set "artist:Artist" --set "album:Album" file.opus

It is depending on mutagen to do this and thus has wide file support.