Scroll to navigation

mp4tagcli(1) General Commands Manual mp4tagcli(1)

Name

mp4tagcli - mp4 tag command line interface

Synopsis

mp4tagcli --version
mp4tagcli --copyfrom infile --copyto outfile
mp4tagcli filename --clean
mp4tagcli filename --duration
mp4tagcli filename --asstream
mp4tagcli filename [--binary] [--display tag [--dump filename]] [--freespace size] [tag={|value|filename}]

Description

mp4tagcli is used to read and write tags from an MP4 audio or video file. Existing tags and existing custom tags will not be lost when writing or replacing tags.

mp4tagcli can be used as a command line interface to read and write MP4 audio tags, but it is also intended as an example on how to use the libmp4tag library, and thus includes other less useful options and debugging modes.

Overview

Tags may be specified without the preceding copyright symbol (©). Any tag that is three characters in length will have the copyright symbol pre-pended. This is a function of the mp4tagcli program and not the libmp4tag library.

The gnre tag is automatically converted to ©gen. It is recommended to always use the gen tag.

When specifying a particular tag, a "not found" message will be displayed if the tag is not present (for display) or is not known (when setting a tag).

Arrays

Arrays can be specified by suffixing the tag name with a colon and the index number. e.g. wrt:1. Arrays are only implemented for string data.

Index values are relative, not absolute. There will never be an array with a empty slot.

Cover Images

There may be more than one cover image present. If there is more than one cover image, the subsequent cover images will display a tag name of covr:1 with the appropriate index value.

If there is a name associated with the cover image, the tag name will be displayed as covr:1:name using the appropriate index value.

The indexes are only used if there is already an existing cover image at that index. Setting a cover image at index 1 in a file with no cover image present will place the cover image at index 0.

Custom Tags

Custom tags are specified as ----:APP:tagname. To prevent the command line parser from recognizing a custom tag as an option, the end of option specifier -- must be added to the command line before the custom tag.

e.g. mp4tagcli sample.m4a -- ----:BDJ4:DANCE=Waltz

Displaying Tag Information

Running mp4tagcli without any arguments displays all tags and their values for filename. The duration is also displayed. Each tag is output as tag=value on a separate line.
Prints the duration of the MP4 file without any label.
Processes the filename as a stream. This is purely for debugging purposes.
Display tag and its value.

Setting Tags

Without any value specified, the tag is removed from the MP4 file.
If a value is specified for a tag, the tag is set to value.
For tags with associated binary data (e.g. cover images), the data for the tag is read from filename.
The --binary option is only used when setting a new tag with binary data. It is not necessary to use the --binary option with cover images or tags with existing binary data.
Multiple tags may be specified on the command line.
The --freespace option is used to specify the size of the free space box to create when the audio file is re-written.

Removing All Tags

Removes all tags from the MP4 file.

Copying Tags

Copies the tags from from infile to outfile. Any existing tags in outfile are completely removed.

See Also

libmp4tag(3)

Links

Main: https://sourceforge.net/p/libmp4tag/
Wiki: https://sourceforge.net/p/libmp4tag/wiki/
Change Log: https://sourceforge.net/p/libmp4tag/wiki/ChangeLog/
Bugs: https://sourceforge.net/p/libmp4tag/tickets/

Copyright

Copyright 2023-2024 Brad Lanam Pleasant Hill CA USA

28 Nov 2023