Adding metadata to opus file from command line

audiotagging

I have a collection of opus music files that needs tagging and a text file containing the appropriate tags. I'm trying to accomplish the tagging through a Python script but I need a way to edit the metadata of the opus files. So a CLI program that can tag opus files.

opusenc, which is part of opus-tools doesn't accept opus files as input. There are a lot of graphical programs that can edit the tags of opus files but that doesn't work in this case. I was thinking ffmpeg could do it but the wiki page doesn't mention opus (or ogg or flac which also uses a "Vorbis Comment" to store metadata as I understand it).

I assume my two suggestions would re-encode the files and I'm not sure if that will damage the sound quality. If so it would be preferable to use something that doesn't re-encode.

I'm running Manjaro Linux.

Best Answer

I guess I basically had the answer in my question. FFMpeg works just fine when I just decided to try it. It doesn't seem to re-encode because the process is instantaneous. I just did:

ffmpeg -i <input-file> -acodec copy -metadata title="<title>" -metadata artist=<artist> <output-file>
Related Question