[ANN] mtag 2.2.5

Discuss anything new and newsworthy! See http://planet.linuxaudio.org and https://libreav.org/news for more Linux Audio News!

Announcements of proprietary software may fit better in the Marketplace.


Moderators: raboof, MattKingUSA, khz

Post Reply
User avatar
peter.semiletov
Established Member
Posts: 119
Joined: Thu May 11, 2023 1:09 pm
Has thanked: 25 times
Been thanked: 82 times
Contact:

[ANN] mtag 2.2.5

Post by peter.semiletov »

Hello, here is a new release of mtag - https://github.com/psemiletov/mtag
mtag is the command-line tool for media files tagging. It can use the text file template to tag the multiply sets of media files.
You can apply the same template for Ogg, MP3, and FLAC album versions.
mtag can also extract the tags to the text file and rename files according to their tags.

It is useful when yoi want to release the album in several formats, and don't want to edit tags twise or more. Instead of that you create the template file with tags and apply it to different file sets (FLAC, MP3, etc).

The usage:

To tag some files, use the command line:

Code: Select all

mtag apply rules_file extension

Example:

Code: Select all

mtag apply rules.txt flac

To be tagged correctly, the media files names needs to be named in the alphabetical order, i.e. for example:

Code: Select all

01-first-song.flac
01-second-song.flac
01-third-song.flac

The rules file must be in UTF-8 encoding. The rules file syntax is simple - the set of blocks with tags. Each block is ended with "###". Example:

Code: Select all

@album=testalbum
@artist=SomeRocker
@title=song one
###
@album=testalbum
@artist=SomeRocker
@title=song two
###
@album=testalbum
@artist=SomeRocker
@title=song three
###

So the first block will be applied to the first media file at the current directory, the second block to the second file, etc.

The list of available tags: @artist, @title, @album, @genre, @comment, @year, @track.

The #filename tag in block is ignored, it is needed just to understand which media file tags you edit now. Only the file order in directory and block order in rules file matters, not the #filename tag.

To extract the tags from the media files to the rules file, use the "extract" option:

Code: Select all

mtag extract OUTPUTFILE extension [<list of required tags>]

For example:

Code: Select all

mtag extract RULES ogg 

or

Code: Select all

mtag extract RULES mp3 "@artist,@genre,@album"

<list of required tags> is an optional parameter, it defines which tags will be generated even if such data is not presented in source media file, blank values will be used.

To rename files according their tags, use:

Code: Select all

mtag rename "template string" extension

The template string can contain any tags macros (i.e. @artist, @title, etc.), @fname macro for the original file name, and # as the numbers counter (the count of # is the leading zeroes count minus 1);

Examples:

Code: Select all

mtag rename "## - @title" mp3  
mtag rename "## - @artist @title" mp3
mtag rename "## - @fname" mp3

To list files tags by the template, use:

Code: Select all

mtag list "template string" extension

Example, write to screen:

Code: Select all

mtag list "## - @artist @title" mp3  

Example, write to the file:

Code: Select all

mtag list "## - @artist @title" mp3  > file.txt

Requirements:
Taglib, C++ 11

Installation:
As usual, under the root or sudo (mtag will be installed to /usr/local/bin):

Code: Select all

make
make install

To uninstall:

Code: Select all

make uninstall
Post Reply