C++ library for reading and writing MP4/M4A/AAC (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Go to file
Martchus bc306af88e Apply clang-format later 2017-05-01 03:19:44 +02: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 Use std::make_unique provided by C++14 2017-02-05 21:02:40 +01: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 Fix typos 2017-03-01 18:21:00 +01:00
matroska Add DVB subtitles format 2017-04-30 02:02:10 +02:00
mp4 Remove unused metaAtom in mp4container.cpp 2017-03-22 14:36:52 +01:00
mpegaudio Fix decoration for static builds 2016-08-29 15:43:05 +02:00
ogg Fix typos 2017-03-01 18:21:00 +01:00
opus Fix decoration for static builds 2016-08-29 15:43:05 +02:00
scripts Add script to find all required testfiles 2017-04-08 18:38:41 +02:00
tests Add test to verify testfiles via SHA-256 checksum 2017-04-08 18:40:27 +02:00
vorbis Use std::make_unique provided by C++14 2017-02-05 21:02:40 +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 Apply clang-format later 2017-05-01 03:19:44 +02:00
LICENSE Initial commit 2015-04-22 19:11:19 +02:00
README.md Make crypto optional and document it 2017-04-15 23:21:16 +02: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 Fix typos 2017-03-01 18:21:00 +01:00
abstractcontainer.h Allow checking index position 2016-11-16 19:31:09 +01:00
abstracttrack.cpp Improve subtitle format names and media types 2016-07-11 20:58:12 +02:00
abstracttrack.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
aspectratio.cpp parsing AVC config 2016-02-17 20:19:05 +01:00
aspectratio.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
backuphelper.cpp Fix typos 2017-03-01 18:21:00 +01:00
backuphelper.h Use _wopen under Windows to support unicode filenames 2016-12-21 00:42:31 +01:00
basicfileinfo.cpp Use _wopen under Windows to support unicode filenames 2016-12-21 00:42:31 +01: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
download_testfiles.sh Add tests for FLAC files 2016-05-21 22:11:08 +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 Fix typos 2017-03-01 18:21:00 +01:00
genericcontainer.h Use std::make_unique provided by C++14 2017-02-05 21:02:40 +01:00
genericfileelement.h Use std::make_unique provided by C++14 2017-02-05 21:02:40 +01:00
generictagfield.h Ease dealing with native field IDs 2017-01-23 00:25:53 +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 Remove numberToString() where possible 2017-01-30 00:42:35 +01:00
mediafileinfo.cpp Fix typos 2017-03-01 18:21:00 +01:00
mediafileinfo.h Document defaults of padding constraints 2016-11-18 17:09:26 +01:00
mediaformat.cpp Add DVB subtitles format 2017-04-30 02:02:10 +02:00
mediaformat.h Add DVB subtitles format 2017-04-30 02:02:10 +02:00
notification.cpp fixed includes 2015-09-06 19:57:33 +02:00
notification.h Fix typos 2017-03-01 18:21:00 +01:00
positioninset.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
signature.cpp Detect raw AC3 and Dirac 2016-08-07 20:48:23 +02:00
signature.h Fix decoration for static builds 2016-08-29 15:43:05 +02:00
size.h Remove numberToString() where possible 2017-01-30 00:42:35 +01:00
statusprovider.cpp Make use of string builder 2017-01-27 18:59:22 +01:00
statusprovider.h Fix decoration for static builds 2016-08-29 15:43:05 +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 setting encoding in TagValue::assignText() 2016-12-28 00:17:26 +01:00
tagvalue.h Use std::make_unique provided by C++14 2017-02-05 21:02:40 +01: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.

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

  • Matroska files composed of more than one segment aren't tested yet and might not work
  • 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.

TODO

  • Support more formats (EXIF, PDF metadata, Theora, ...)
  • Do tests with Matroska files which have multiple segments
  • Support adding cue-sheet to FLAC files