I am searching a command-line tagging tool that supports ogg-tagging and allows to change encoding to the tags.
2 Answers
As @LiveWireBT said in a comment, you can use vorbiscomment
, available in the vorbis-tools
package.
vorbiscomment
is not really easy to use when you want to replace/edit a single tag, like Genre, because you have only two options: append a tag with -a
, or replace ALL TAGS with -w
.
Appending a Genre tag will ADD a Genre tag, not edit the current one. Writing a Genre tag will ONLY write the Genre tag, and remove all other tags.
So my workaround to modify a tag is the following:
# dynamically: list tags, edit one with sed, rewrite tags
vorbiscomment -l file.ogg | sed 's/^genre=.*/GENRE=Black Metal/' | vorbiscomment -w file.ogg
# with a temporary file (it's actually one of the examples in the manpage)
# (a bit longer/more difficult to use in a for loop,
# since you can specify only one input file)
vorbiscomment -l file.ogg > comments.txt
<edit comments.txt with vim/nano/sed>
vorbiscomment -w -c comments.txt file.ogg
About the encoding of tags, the --raw
option might be what you need:
-R, --raw
Read and write comments in UTF-8, rather than converting to the user's character set.
tageditor supports a wide variety of formats, and has both a GUI and CLI interface.
tageditor set \
album="${album}" \
artist="${artist}" \
title="${title}" \
genre="${genre}" \
--files "${file}"
vorbiscomment
?