How to add new — and non-defined — metadata to an MP4 file?

I have been trying to understand how to add some additional metadata to a MP4 file. I understand how to add metadata, like this:

ffmpeg -i bb.mp4 -metadata title="my title" bb2.mp4

But what I am looking for is how to add some new tags something like this:

ffmpeg -i bb.mp4 -metadata newTag="newTag" bb2.mp4

newTag might be something like author's birthday, anything new not already existing!

Is this even possible?


By default, FFmpeg supports the limited number of iTunes tags in the MP4 format. These are listed below. But custom tags can be written if -movflags use_metadata_tags is added. This applies both for adding new tags or carrying over custom global tags from the input.

iTunes tags supported in MP4:

"title"    
"artist"   
"album_artist"
"composer" 
"album"    
"date"     
"encoding_tool"
"comment"  
"genre"    
"copyright"
"grouping" 
"lyrics"   
"description"
"synopsis" 
"show"     
"episode_id"
"network"  
"episode_sort"
"season_number"
"media_type"
"hd_video"
"gapless_playback"
"compilation"

The Matroska format accepts custom tags.


I've found that for my needs I wanted the exif metadata and the exiftool was the right solution.

You can copy metadata between video files: https://unix.stackexchange.com/a/492338/83370

There's a trick to copy all metadata using the option -all:all>all:all: https://exiftool.org/forum/index.php?topic=3440.0