Adding metadata to a video or audio file with FFmpeg

Depending on a video or audio container it can store various metadata or information like title, description, year, author, episode, album, track etc.

Using FFmpeg to add this metadata to a media file is a simple task. The parameter is

-metadata X=

With X being the type of metadata being added, you can find this information in the tables below. If I wanted to add a title to my video here is the command:

ffmpeg -i input.mp4 -metadata title="The video titile" -c copy output.mp4

This will produce:

ffmpeg add video metadata title

As i used copy no encoding was done and this process happened instantly.

Here are the metadata keys:

MP4, MOV, and Quicktime

Data key
“title”
“author”
“album_artist”
“album”
“grouping”
“composer”
“year”
“track”
“comment”
“genre”
“copyright”
“description”
“synopsis”
“show”
“episode_id”
“network”
“lyrics”

MP3

 

Data keyTag
albumTALB
composerTCOM
genreTCON
copyrightTCOP
encoded_byTENC
titleTIT2
languageTLAN
artistTPE1
album_artistTPE2
performerTPE3
discTPOS
publisherTPUB
trackTRCK
encoderTSSE
lyricsUSLT
compilationTCMP
dateTDRC
dateTDRL
creation_timeTDEN
album-sortTSOA
artist-sortTSOP
title-sortTSOT
albumTAL
genreTCO
compilationTCP
titleTT2
encoded_byTEN
artistTP1
album_artistTP2
performerTP3
trackTRK