tageditor/README.md

250 lines
11 KiB
Markdown
Raw Normal View History

2015-08-26 20:11:46 +02:00
# Tag Editor
2016-05-16 21:01:48 +02:00
A tag editor with Qt GUI and command-line interface. Supports MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska.
2015-05-19 22:59:28 +02:00
2015-06-08 22:06:46 +02:00
## Supported formats
The tag editor can read and write the following tag formats:
2016-05-16 21:01:48 +02:00
- iTunes-style MP4/M4A tags (MP4-DASH is supported)
2015-06-08 22:06:46 +02:00
- ID3v1 and ID3v2 tags
2016-05-16 21:01:48 +02:00
- conversion between ID3v1 and different versions of ID3v2 is possible
2016-05-14 23:23:47 +02:00
- Vorbis, Opus and FLAC comments in Ogg streams
2016-05-06 22:47:00 +02:00
- cover art via "METADATA_BLOCK_PICTURE" is supported
2016-05-16 21:01:48 +02:00
- Vorbis comments and "METADATA_BLOCK_PICTURE" in raw FLAC streams
2015-06-08 22:06:46 +02:00
- Matroska/WebM tags and attachments
2015-12-22 23:44:53 +01:00
## Additional features
2016-05-06 22:47:00 +02:00
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.
2015-05-19 22:59:28 +02:00
2015-08-10 01:19:40 +02:00
It also allows to inspect and validate the element structure of MP4 and Matroska files.
2015-06-21 22:51:25 +02:00
2015-12-22 23:44:53 +01:00
## File layout options
### Tag position
The editor allows you to choose whether tags should be placed at the beginning or at
the end of an MP4/Matroska file.
2016-11-15 23:18:50 +01:00
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.
2016-11-15 23:18:50 +01:00
2016-05-06 22:47:00 +02:00
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.
2016-11-15 23:18:50 +01:00
### Index position
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.
#### Faststart
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
```
2015-12-22 23:44:53 +01:00
### Padding
Padding allows adding additional tag information without rewriting the entire file
or appending the tag. Usage of padding can be configured:
- minimum/maximum padding: The file is rewritten if the padding would fall below/exceed the specifed limits.
- preferred padding: If the file needs to be rewritten the preferred padding is used.
2016-11-15 23:18:50 +01:00
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.
2015-12-22 23:44:53 +01:00
However, it is also possible to force rewriting the entire file.
2016-11-15 23:18:50 +01:00
The relevant CLI options are `--min-padding`, `--max-padding` and `--force-rewrite`.
2016-05-16 21:01:48 +02:00
Taking advantage of padding is currently not supported when dealing with Ogg streams (it is supported when
dealing with raw FLAC streams).
2016-11-18 18:32:11 +01:00
## Download
### Source
See the release section on GitHub.
### Packages and binaries
* Arch Linux
* for PKGBUILDs checkout [my GitHub repository](https://github.com/Martchus/PKGBUILDs) or
[the AUR](https://aur.archlinux.org/packages?SeB=m&K=Martchus)
* for binary repository checkout [my website](http://martchus.no-ip.biz/website/page.php?name=programming)
* Tumbleweed
* for RPM \*.spec files and binary repository checkout
[openSUSE Build Servide](https://build.opensuse.org/project/show/home:mkittler)
* Gentoo
* packages are provided by perfect7gentleman; checkout his
[repository](https://github.com/perfect7gentleman/pg_overlay)
* Windows
* for mingw-w64 PKGBUILDs checkout [my GitHub repository](https://github.com/Martchus/PKGBUILDs)
* for binaries checkout [my website](http://martchus.no-ip.biz/website/page.php?name=programming) and the
release section on GitHub
2016-09-14 20:03:58 +02:00
2015-06-21 22:51:25 +02:00
## Usage
2016-05-06 22:47:00 +02:00
The Tag Editor has a GUI (Qt 5) and a command line interface. For a C++ library
interface checkout the underlying tagparser library.
2015-06-21 22:51:25 +02:00
### GUI
The GUI should be self-explaining. Just open a file, edit the tags and save the changings.
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.
2016-09-10 17:19:48 +02:00
#### Screenshots
##### Main window under Openbox/qt5ct with Breeze theme/icons
![main window/Openbox/qt5ct/Breeze](/resources/screenshots/mainwindow.png?raw=true)
2015-11-26 19:31:31 +01:00
#### Settings
2015-12-22 23:44:53 +01:00
Checkout the settings dialog. You can:
- customize which fields the editor shows and in which order
2016-05-06 22:47:00 +02:00
- change settings regarding the tag processing (ID3 version(s) to be used, preferred character set, usage of padding, ...)
2015-12-22 23:44:53 +01:00
- set whether unknown/unsupported tags should be ignored/kept or removed
- set whether ID3v1 and ID3v2 tags should be edited together or separately
- set the directory used to store temporary files
2016-05-06 22:47:00 +02:00
- set the desired file layout options (see section "File layout options")
2015-12-22 23:44:53 +01:00
- and more.
2015-11-26 19:31:31 +01:00
Settings of the GUI do not affect the CLI.
2015-06-21 22:51:25 +02:00
2015-11-26 19:31:31 +01:00
#### File renaming
2015-06-21 22:51:25 +02:00
There is also a tool to rename files using the tag information stored in the files. The new name is generated
2015-11-26 19:31:31 +01:00
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.
2015-06-21 22:51:25 +02:00
#### MusicBrainz, Cover Art Archive and LyricaWiki search
The tag editor also features a MusicBrainz, Cover Art Archive and LyricaWiki search which can be opened with *F10*.
However, this feature is still experimental.
2016-05-06 22:47:00 +02:00
2015-06-21 22:51:25 +02:00
### CLI
#### Usage
2015-08-10 01:19:40 +02:00
```
tageditor <operation> [options]
2015-08-10 01:21:09 +02:00
```
2016-11-15 23:18:50 +01:00
Checkout the available operations and options with `--help`.
#### Examples
2015-09-24 00:37:15 +02:00
Here are some Bash examples which illustrate getting and setting tag information:
2015-06-21 22:51:25 +02:00
##### Reading tags
* *Displays* title, album and artist of all *.m4a files in the specified directory:
2015-09-24 00:37:15 +02:00
```
tageditor get title album artist --files /some/dir/*.m4a
```
2016-03-22 23:01:50 +01:00
* *Displays* all supported fields of all *.mkv files in the specified directory:
```
tageditor get --files /some/dir/*.mkv
```
2016-10-28 20:06:50 +02:00
* *Displays* technical information about all *.m4a files in the specified directory:
```
tageditor info --files /some/dir/*.m4a
```
* *Displays* technical information about all *.m4a files in the specified directory:
2015-09-24 00:37:15 +02:00
```
tageditor info --files /some/dir/*.m4a
```
##### Writing tags
* *Sets* title, album, artist, cover and track number of all *.m4a files in the specified directory:
2015-09-24 00:37:15 +02:00
```
tageditor set title="Title of "{1st,2nd,3rd}" file" title="Title of "{4..16}"th file" \
album="The Album" artist="The Artist" \
2015-07-07 00:46:20 +02:00
cover=/path/to/image track={1..16}/16 --files /some/dir/*.m4a
2015-09-24 00:37:15 +02:00
```
2016-03-22 23:01:50 +01:00
- The first file will get the title *Title of 1st file*, the second file will get the name *Title of 2nd file* and so on.
- The 16th and following files will all get the title *Title of the 16th file*.
- The same scheme is used for the track numbers.
- All files will get the album name *The Album*, the artist *The Artist* and the cover image from the file */path/to/image*.
* *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](https://matroska.org/technical/specs/tagging/index.html).
2015-09-24 00:37:15 +02:00
* 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
2015-09-24 00:37:15 +02:00
```
2016-03-22 23:01:50 +01:00
**Note**: The *+* sign after the field name *track* which indicates that the field value should be increased after
2015-09-24 00:37:15 +02:00
a file has been processed.
2016-12-02 11:09:08 +01:00
## Text encoding / unicode support
2016-12-21 00:18:38 +01:00
1. It is possible to set the preferred encoding used *within* the tags via CLI option ``--encoding`` and
in the GUI settings.
2. The CLI assumes all arguments to be UTF-8 encoded (no matter which preferred encoding is specified)
and file names are just passed as specified.
3. The CLI prints all values in UTF-8 encoding (no matter which encoding is actually used in the tag).
### Windows only
2017-01-15 20:51:02 +01:00
* Codepage is set to UTF-8 to ensure *3.* is handled correctly by the terminal. So
2016-12-21 00:18:38 +01:00
far it seems that this effort just causes weird truncating behaviour in some cases and might
prevent pipes/redirections to function. One can use MSYS2 terminal to work around this.
2017-01-15 20:51:02 +01:00
* All UTF-16 encoded arguments as provided by WinAPI are converted to UTF-8 so *2.*
shouldn't cause any trouble.
2016-12-21 00:18:38 +01:00
2015-08-10 01:19:40 +02:00
## Build instructions
The application depends on [c++utilities](https://github.com/Martchus/cpp-utilities) and [tagparser](https://github.com/Martchus/tagparser) and is built the same way as these libaries. For basic instructions checkout the README file of [c++utilities](https://github.com/Martchus/cpp-utilities).
2015-08-10 01:19:40 +02:00
### Building with Qt 5 GUI
2016-09-10 17:19:48 +02:00
The following Qt 5 modules are requried: core concurrent gui network widgets declarative/script webenginewidgets/webkitwidgets
#### Select Qt modules for JavaScript and WebView
2016-02-05 20:24:03 +01:00
* If Qt Script is installed on the system, the editor will link against it. Otherwise it will link against Qt QML.
* To force usage of Qt Script/Qt QML or to disable both add `-DJS_PROVIDER=script/qml/none` to the CMake arguments.
* If Qt WebKitWidgets is installed on the system, the editor will link against it. Otherwise it will link against Qt WebEngineWidgets.
* To force usage of Qt WebKit/Qt WebEngine or to disable both add `-DWEBVIEW_PROVIDER=webkit/webengine/none` to the CMake arguments.
### Building without Qt 5 GUI
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
```
2015-08-26 20:11:46 +02:00
## TODO
2016-09-10 17:19:48 +02:00
- Support more formats (EXIF, PDF metadata, Theora in Ogg, ...)
- Allow adding tags to specific streams when dealing with Ogg
- Do tests with Matroska files which have multiple segments
- Set tag information concurrently if multiple files have been specified (CLI)
2016-09-14 20:03:58 +02:00
- Support adding cue-sheet to FLAC files
2015-11-26 19:31:31 +01:00
## Bugs
2016-09-10 17:19:48 +02:00
- Large file information is not shown when using Qt WebEngine
2016-12-27 20:23:34 +01:00
- It is recommend to create backups before editing because I can not test whether the underlying library
works with all kinds of files (when forcing rewrite a backup is always created)
2015-12-27 18:11:02 +01:00
- underlying library: Matroska files composed of more than one segment aren't tested yet and might not work.
- Also note the issue tracker on GitHub