Guide
Community memory
Embed custom metadata tags
FFmpeg can attach arbitrary key/value metadata to the container and to individual streams. The most common use is to set the title, artist, year, or comment on a finished audio or video file so media players show it in the info panel.
The command
ffmpeg -i in.m4a -metadata title="My Podcast Episode 1" -metadata artist="My Name" -metadata date=2026 -c copy out.m4aWhat it does
The `-metadata key=value` flag sets a single container-level tag. Repeat it to set multiple fields. The change is written into the output container header during the muxer phase, so no re-encode is needed. Stream-level metadata is set with `-metadata:s:0 key=value` (where `0` is the stream index).
Requirements
Any container that supports metadata. Most modern containers do; some older or specialty ones (raw streams, some image formats) do not. Stream copy is sufficient, so no encoder is required.
Things to avoid
- Setting metadata on a format that does not support it. Some encoders silently drop unknown fields. Test by reading the file back with ffprobe.
- Using `-metadata` with values that contain shell-special characters without quoting. Spaces, quotes, and `;` will need escaping or single-quoting.
- Forgetting that `-metadata` writes the value as-is. FFmpeg does not validate ISO dates, language codes, or BPM fields — the player may reject malformed values.
- Overwriting a tag the player relies on, like `encoder` or `major_brand`. Use `-metadata` only for tags you control.