Add Custom Metadata to MP4 with FFmpeg
This article provides a quick guide on how to inject custom metadata keys, such as copyright, description, and custom tags, into an MP4 container using the FFmpeg command-line tool. You will learn the exact syntax required to write these tags efficiently without re-encoding your video.
The Basic FFmpeg Metadata Syntax
To add metadata to an MP4 file, you use the -metadata
flag followed by a key="value" pair. To avoid re-encoding
the video and audio streams—which saves time and preserves quality—you
should also include the -c copy (or
-codec copy) stream copy flag.
The basic command structure is as follows:
ffmpeg -i input.mp4 -metadata key="value" -c copy output.mp4Writing Standard Metadata Keys
MP4 containers support several standard metadata keys that are widely
recognized by media players, operating systems, and file explorers.
Common standard keys include title, author (or
artist), copyright, and
description.
Here is how to write multiple standard tags in a single command:
ffmpeg -i input.mp4 \
-metadata title="My Professional Video" \
-metadata artist="Jane Doe" \
-metadata copyright="Copyright © 2026 Jane Doe" \
-metadata description="This is a detailed description of the video content." \
-c copy output.mp4Writing Custom Metadata Keys
You can also define completely custom metadata keys that are not part of the standard MP4 specification (e.g., “Camera_Model” or “Project_ID”). FFmpeg will write these custom keys into the MP4 file’s user-data or metadata atom.
Use the exact same -metadata syntax with your custom key
name:
ffmpeg -i input.mp4 \
-metadata Custom_Key_Name="Custom Value" \
-metadata Project_ID="98765" \
-c copy output.mp4Verifying the Metadata
Once the process is complete, you can verify that the metadata was
successfully written to the MP4 container by running the
ffprobe tool, which is included with FFmpeg:
ffprobe -show_entries format_tags input.mp4This command will output a list of all metadata tags embedded in the container, allowing you to confirm that both your standard and custom keys are present.