|
3 days ago | |
---|---|---|
application | 2 months ago | |
cli | 4 weeks ago | |
dbquery | 4 weeks ago | |
gui | 3 days ago | |
misc | 4 weeks ago | |
renamingutility | 2 months ago | |
resources | 2 months ago | |
testfiles | 7 months ago | |
tests | 2 months ago | |
translations | 9 months ago | |
.gitignore | 2 years ago | |
CMakeLists.txt | 4 months ago | |
LICENSE | 6 years ago | |
LICENSES-windows-distribution.md | 1 year ago | |
README.md | 2 months ago |
A tag editor with Qt GUI and command-line interface. Supports MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska.
The tag editor can read and write the following tag formats:
The tag editor can also display technical information such as the ID, format, language, bitrate, duration, size, timestamps, sampling frequency, FPS and other information of the tracks.
It also allows to inspect and validate the element structure of MP4 and Matroska files.
Sometimes the tag editor has to rewrite the entire file in order to apply changes. With the default settings this will happen most of the times.
The next section describes how to tweak settings to avoid this at the cost of having some padding within the files
and/or storing tags at the end of the file. Note that temporary files also serve as a backup in case something
goes wrong, e.g. your computer crashes while saving or a bug within the tag editor breaks particularly structured files.
To be save it might therefore even be desirable to enforce the creation of a temporary file. That is also possible to
configure within the GUI and the CLI option --force-rewrite
.
Nevertheless, it will not always be possible to avoid rewriting a file in all cases anyways. You can configure a
directory for temporary files within the GUI settings or the CLI option --temp-dir
. Then you can easily clean up all
temporary files at some point together. For efficiency the temporary directory should be on the same file system
as the files you are editing. A feature to delete temporary files automatically has not been implemented yet.
The editor allows you to choose whether tags should be placed at the beginning or at the end of an MP4/Matroska file. Placing tags at the end of the file can avoid having to rewrite the entire file to apply changes.
In the CLI, this is controlled via --tag-pos
option.
To enfore a specific --tag-pos
, even if this requires the file to be rewritten, combine with the --force
option.
ID3v2 tags and Vorbis/Opus comments can only be placed at the beginning. ID3v1 tags can only be placed at the end of the file. Hence this configuration has no effect when dealing with such tags.
It is also possible to control the position of the index/cues. However, this is currently only supported when dealing with Matroska files.
Note: This can not be implemented for MP4 since tags and index are tied to each other. When dealing with MP4 files the index position will always be the same as the tag position.
Putting the index at the beginning of the file is sometimes called faststart.
For forcing faststart via CLI the following options are required:
tageditor set --index-pos front --force
Padding allows adding additional tag information without rewriting the entire file or appending the tag. Usage of padding can be configured:
Default value for minimum and maximum padding is zero (in the CLI and GUI). This leads to the fact that the Tag Editor will almost always have to rewrite the entire file to apply changes. To prevent this, set at least the maximum padding to a higher value.
However, it is also possible to force rewriting the entire file.
The relevant CLI options are --min-padding
, --max-padding
and --force-rewrite
.
Taking advantage of padding is currently not supported when dealing with Ogg streams (it is supported when dealing with raw FLAC streams).
See the release section on GitHub.
The Tag Editor has a Qt-based GUI and a command line interface. For a C++ library interface checkout the underlying tagparser library.
The GUI should be self-explaining - a lot of the UI elements have tooltips with further explanations. The basic workflow is quite simple:
You can set the behaviour of the editor to keep previous values, so you don't have to enter information like album name or artist for all files in an album again and again.
This screenshot shows the experimental MusicBrainz/LyricWiki search.
Checkout the settings dialog. You can
Settings of the GUI do not affect the CLI.
There is also a tool to rename files using the tag information stored in the files. The new name for each file is generated by a small JavaScript which can be customized. An example script is provided. Before any actual changes are made, you will see a preview with the generated file names. As shown in the example script it is also possible to move files into another directory.
The tag editor also features a MusicBrainz, Cover Art Archive and LyricWiki search.
tageditor <operation> [options]
Checkout the available operations and options with --help
. For a list of all available field names, track
attribute names and modifier, use the CLI option --print-field-names
.
Here are some Bash examples which illustrate getting and setting tag information:
Displays title, album and artist of all *.m4a files in the specified directory:
tageditor get title album artist --files /some/dir/*.m4a
Displays all supported fields of all *.mkv files in the specified directory:
tageditor get --files /some/dir/*.mkv
Extracts the cover of the specified (Opus) file:
tageditor extract cover --output-file the-cover.jpg --file some-file.opus
--attachment
.Displays technical information about all *.m4a files in the specified directory:
tageditor info --files /some/dir/*.m4a
Sets title, album, artist, cover and track number of all *.m4a files in the specified directory:
tageditor set title="Title of "{1st,2nd,3rd}" file" title="Title of "{4..16}"th file" \
album="The Album" artist="The Artist" \
cover=/path/to/image track={1..16}/16 --files /some/dir/*.m4a
Sets title of both specified files and the album of the second specified file:
tageditor set title0="Title for both files" album1="Album for 2nd file" \
--files file1.ogg file2.mp3
The number after the field name specifies the index of the first file to use the value for. The first index is 0.
Sets the title specificly for the track with the ID 3134325680
and removes
the tags targeting the song/track and the album/movie/episode in general:
tageditor set target-level=30 target-tracks=3134325680 title="Title for track 3134325680" \
--remove-targets target-level=50 , target-level=30 \
--files file.mka
For more information checkout the Matroska specification.
Sets custom fields:
tageditor set mkv:FOO=bar1 mp4:©foo=bar2 -f file.mkv file.m4a
FOO
is set to bar1
in file.mkv and the custom field ©foo
is set to bar2
in file.m4a. So the prefixes tell the tag editor that the specified field
ID is a native field ID of a particular tag format rather than a generic identifier. Native
fields are only applied to the corresponding format of course.mp4
: iTune-style MP4/M4A ID (must be exactly 4 characters)mkv
: Matroska IDid3
: ID3v2 ID (must be exactly 3 or 4 characters depending on the tag version)vorbis
: Vorbis comment ID, also works for Opus (which uses Vorbis comments as well)Removes the "forced" flag from all tracks, flags the track with the ID 2 as "default" and sets its language to "ger":
tageditor set track-id=all forced=no track-id=2 default=yes language=ger
Here is another example, demonstrating the use of arrays and the syntax to auto-increase numeric fields such as the track number:
cd some/dir
# create an empty array
titles=()
# iterate through all music files in the directory
for file in *.m4a; do \
# truncate the first 10 characters
title="${file:10}"; \
# append the title truncating the extension
titles+=("title=${title%.*}"); \
done
# now set the titles and other tag information
tageditor set "${titles[@]}" album="Some Album" track+=1/25 disk=1/1 -f *.m4a
Note: The + sign after the field name track which indicates that the field value should be increased after a file has been processed.
--encoding
and in the GUI settings.
std::fstream
under Windows) can be enabled by adding -DUSE_NATIVE_FILE_BUFFER=ON
to the CMake arguments when building c++utilities
. It is not sufficient to specify this
option only when building tagparser
or Tag Editor.The application depends on c++utilities and tagparser and is built the same way as these libaries. For basic instructions checkout the README file of c++utilities.
When the Qt GUI is enabled, Qt and qtutilities are required, too.
The following Qt modules are requried (version 5.6 or higher): core concurrent gui network widgets declarative/script webenginewidgets/webkitwidgets
Note that old Qt versions like 5.6 lack support for modern JavaScript features. To use the JavaScript-based renaming tool is recommend to use at least Qt 5.12.
-DWEBVIEW_PROVIDER:STRING=webkit/webengine/none
to the CMake arguments to use either Qt WebKit (works with
'revived' version as well), Qt WebEngine or no web view at all. If no web view is used, the file information can only
be shown using a plain tree view. Otherwise the user can choose between a web page and a tree view.-DJS_PROVIDER:STRING=script/qml/none
to the CMake arguments to use either Qt Script, Qt QML or no JavaScript
engine at all. If no JavaScript engine is used, the renaming utility is disabled.It is possible to build without the GUI if only the CLI is needed. In this case no Qt dependencies (including qtutilities) are required.
To build without GUI, add the following parameters to the CMake call:
-DWIDGETS_GUI=OFF -DQUICK_GUI=OFF
As a small demo for Reflective RapidJSON, the tag editor features an optional
JSON export. To enable it, add -DENABLE_JSON_EXPORT
to the CMake arguments.
When enabled, the following additional dependencies are required (only at build-time): rapidjson, reflective-rapidjson and llvm/clang
cd $SOURCES
git clone https://github.com/Martchus/cpp-utilities.git c++utilities
git clone https://github.com/Martchus/tagparser.git
git clone https://github.com/Martchus/qtutilities.git # only required for Qt GUI
git clone https://github.com/Martchus/reflective-rapidjson.git # only required for JSON export
git clone https://github.com/Martchus/tageditor.git
git clone https://github.com/Martchus/subdirs.git
cd $BUILD_DIR
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/install/prefix" \
$SOURCES/subdirs/tageditor
/install/prefix
with the directory where you want to install.cd $BUILD_DIR
make install -j$(nproc)
DESTDIR
to a
writable location (e.g. make DESTDIR="temporary/install/dir" install …
) and move the files from there to
the desired location afterwards.More TODOs and bugs are tracked in the issue section at GitHub.