C++ library for reading and writing MP4/M4A/AAC (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Go to file
Martchus 0daabba17a Use static polymorphism in FieldMapBasedTag 2018-03-06 22:44:01 +01:00
aac improved parsing ID3 genres 2016-02-23 20:33:00 +01:00
adts Fix decoration for static builds 2016-08-29 15:43:05 +02:00
avc Prevent some warnings 2017-06-10 21:47:07 +02:00
avi Fix decoration for static builds 2016-08-29 15:43:05 +02:00
flac Fix typos 2017-03-01 18:21:00 +01:00
id3 Use static polymorphism in FieldMapBasedTag 2018-03-06 22:44:01 +01:00
matroska Use static polymorphism in FieldMapBasedTag 2018-03-06 22:44:01 +01:00
mp4 Use static polymorphism in FieldMapBasedTag 2018-03-06 22:44:01 +01:00
mpegaudio Fix decoration for static builds 2016-08-29 15:43:05 +02:00
ogg Refactor calculating duration of OGG streams 2017-09-03 18:54:46 +02:00
opus Fix decoration for static builds 2016-08-29 15:43:05 +02:00
scripts Add download for MPlayer samples 2017-10-30 21:36:27 +01:00
testfiles Test more methods of MediaFileInfo 2017-08-17 18:44:11 +02:00
tests Fix default timecode scale in Matroska 2018-02-05 00:11:28 +01:00
vorbis Use static polymorphism in FieldMapBasedTag 2018-03-06 22:44:01 +01:00
wav Use _wopen under Windows to support unicode filenames 2016-12-21 00:42:31 +01:00
.gitignore Apply clang-format later 2017-05-01 03:19:44 +02:00
CMakeLists.txt Update major version to 7 2018-03-06 22:44:01 +01:00
LICENSE Initial commit 2015-04-22 19:11:19 +02:00
README.md Improve consistency of README.md 2018-03-06 22:41:21 +01:00
abstractattachment.cpp Fix typos 2017-03-01 18:21:00 +01:00
abstractattachment.h Use _wopen under Windows to support unicode filenames 2016-12-21 00:42:31 +01:00
abstractchapter.cpp fixed includes 2015-09-06 19:57:33 +02:00
abstractchapter.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
abstractcontainer.cpp doc: Cross-reference methods for tag/index pos 2017-05-22 23:53:38 +02:00
abstractcontainer.h Allow checking index position 2016-11-16 19:31:09 +01:00
abstracttrack.cpp Improve documentation 2017-08-17 19:08:54 +02:00
abstracttrack.h Add method to generate short track description 2017-08-17 19:08:54 +02:00
aspectratio.cpp Fix bound check of aspect ratio type 2017-08-17 19:08:54 +02:00
aspectratio.h Improve documentation 2017-08-17 19:08:54 +02:00
backuphelper.cpp Clean backup helper code 2018-02-04 23:55:52 +01:00
backuphelper.h Use _wopen under Windows to support unicode filenames 2016-12-21 00:42:31 +01:00
basicfileinfo.cpp Don't seek at the end for each top-level element 2017-08-17 20:05:32 +02:00
basicfileinfo.h Use _wopen under Windows to support unicode filenames 2016-12-21 00:42:31 +01:00
caseinsensitivecomparer.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
exceptions.cpp fixed spelling mistakes 2015-10-16 21:46:36 +02:00
exceptions.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
fieldbasedtag.h Use static polymorphism in FieldMapBasedTag 2018-03-06 22:44:01 +01:00
genericcontainer.h Add convenience method to find tracks by ID 2017-06-11 01:17:13 +02:00
genericfileelement.h Use static polymorphism in FieldMapBasedTag 2018-03-06 22:44:01 +01:00
generictagfield.h Use static polymorphism in FieldMapBasedTag 2018-03-06 22:44:01 +01:00
global.h Apply clang-format later 2017-05-01 03:19:44 +02:00
localeawarestring.cpp First commit 2015-04-22 19:22:01 +02:00
localeawarestring.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
margin.h Replace 'inline constexpr' with only 'constexpr' 2017-08-17 18:15:03 +02:00
mediafileinfo.cpp Update 100 % percentage correctly 2017-10-30 08:21:17 +01:00
mediafileinfo.h Fix track count if no single track or container present 2017-08-17 19:08:54 +02:00
mediaformat.cpp Add entry for Monkey's Audio on track level 2017-10-29 18:42:15 +01:00
mediaformat.h Add entry for Monkey's Audio on track level 2017-10-29 18:42:15 +01:00
notification.cpp fixed includes 2015-09-06 19:57:33 +02:00
notification.h Add == operator for notifications 2017-08-17 19:08:54 +02:00
positioninset.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
signature.cpp Detect Monkey's Audio on container level 2017-10-29 18:41:51 +01:00
signature.h Detect Monkey's Audio on container level 2017-10-29 18:41:51 +01:00
size.cpp Extend Size class 2017-08-17 18:18:10 +02:00
size.h Extend Size class 2017-08-17 18:18:10 +02:00
statusprovider.cpp Update documentation 2017-09-14 21:41:18 +02:00
statusprovider.h Transfer notifications to media file info 2017-09-14 22:13:34 +02:00
tag.cpp Fix typos 2017-03-01 18:21:00 +01:00
tag.h Use _wopen under Windows to support unicode filenames 2016-12-21 00:42:31 +01:00
tagtarget.cpp Improve implementation of TagTarget::toString 2016-06-06 20:46:30 +02:00
tagtarget.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
tagvalue.cpp Fix TagValue::toInteger() from Latin1/UTF-8 str 2017-06-08 00:48:10 +02:00
tagvalue.h Mind encoding when converting TagValue to pos 2017-06-03 21:00:26 +02:00

README.md

Tag Parser

C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags.

Supported formats

The tag library can read and write the following tag formats:

  • iTunes-style MP4/M4A tags (MP4-DASH is supported)
  • ID3v1 and ID3v2 tags
    • conversion between ID3v1 and different versions of ID3v2 is possible
  • Vorbis, Opus and FLAC comments in Ogg streams
    • cover art via "METADATA_BLOCK_PICTURE" is supported
  • Vorbis comments and "METADATA_BLOCK_PICTURE" in raw FLAC streams
  • Matroska/WebM tags and attachments

File layout options

Tag position

The library allows you to choose whether tags should be placed at the beginning or at the end of an MP4/Matroska file.

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.

Default value for minimum and maximum padding is zero. Hence the library 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.

It is also possible to force rewriting the entire file always.

Taking advantage of padding is currently not supported when dealing with Ogg streams (it is supported when dealing with raw FLAC streams).

Additional features

The library 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.

Text encoding, Unicode support

The library is aware of different text encodings and can convert between different encodings using iconv.

Windows specific

A workaround to support filenames containing non-ASCII characters (despite the lack of an UTF-8 supporting 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.

Usage

For examples check out the command line interface of Tag Editor. API documentation can be generated using Doxygen with make tagparser_apidoc.

Bugs, stability

It is recommend to create backups before editing because I can not test whether the library works with all kinds of files (when forcing rewrite a backup is always created).

Build instructions

The tagparser library depends on c++utilities and is built in the same way. It also depends on zlib. For checking integrity of testfiles, the OpenSSL crypto library is required.

TODOs

  • Support more formats (EXIF, PDF metadata, Theora, ...)
  • Support adding cue-sheet to FLAC files

More TODOs are tracked in the issue section at GitHub.