'How Can I Add Metadata in opus files?

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.



Solution 1:[1]

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.

Solution 2:[2]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fabien Snauwaert
Solution 2 Richard