5

I'm interested in writing metadata for .opus files, but all of the posts that I've seen so far are for more mainstream formats such as .ogg, or .mp3. I'm uncertain as to whether ID3 tags work with .opus files, and I can't find any resources that say whether they do or not. I've seen something similar in (How to add metadata to WAV file?).

How can I write metadata such as title, author, and the like to .opus files?

I'm thinking that a libopus enabled ffmpeg would be able to do it, but from the documentation it is not obvious to me how to do it.

Solutions using just ffmpeg are preferred, but any open source Java library should be just fine as well.

Sarah Szabo
  • 10,345
  • 9
  • 37
  • 60

4 Answers4

3

If you are encoding an existing audio file to opus, then it is easy to do using opusenc:

opusenc input.wav out.opus --title "This is a title" --artist "The Beatles"

There are several metadata options

 --title title      Set track title
 --artist artist    Set artist or author, may be used multiple times
 --album album      Set album or collection
 --genre genre      Set genre, may be used multiple times
 --date YYYY-MM-DD  Set date of track (YYYY, YYYY-MM, or YYYY-MM-DD)
 --comment tag=val  Add the given string as an extra comment
                      This may be used multiple times
 --picture file     Attach album art (see --help-picture)
Terence Eden
  • 14,034
  • 3
  • 48
  • 89
  • 1
    Sorry, I was out of state. I already discovered and programmed the subroutines for opusenc in my program. Excellent suggestion. At first I was worried that opusenc was a linux specific program, but was thankful when I discovered it is platform independent. – Sarah Szabo Jan 25 '19 at 00:54
2

With FFmpeg:

ffmpeg -i myfile.opus -metadata FOO="Bar Baz" -codec copy myfile-withmeta.opus

Then an ffprobe on the file will confirm the presence of the new metadata entry.

Fabien Snauwaert
  • 4,995
  • 5
  • 52
  • 70
0

The 'Foobar2000' media player will allow you add metadata (including images) to a .opus audio file. It's free to download for Windows and IOS.

0

If you don't need to do it in your code or in Bash or something, you can use VLC player to edit metadata. And you don't need to convert or copy or do anything like that. Just open your file, Go to Tools -> Media Information -> General. Edit and save. That's it.