Categories: Development

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:

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 key Tag
album TALB
composer TCOM
genre TCON
copyright TCOP
encoded_by TENC
title TIT2
language TLAN
artist TPE1
album_artist TPE2
performer TPE3
disc TPOS
publisher TPUB
track TRCK
encoder TSSE
lyrics USLT
compilation TCMP
date TDRC
date TDRL
creation_time TDEN
album-sort TSOA
artist-sort TSOP
title-sort TSOT
album TAL
genre TCO
compilation TCP
title TT2
encoded_by TEN
artist TP1
album_artist TP2
performer TP3
track TRK
Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

2 years ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

2 years ago

Early September spring shots

Some early September spring shots from a bushwalk, It is still too early for wildflowers.

3 years ago

Cloning an NVMe to SK Hynix Platinum P41 NVMe

I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…

3 years ago

Using Laravel’s deleteDirectory to delete folders and their contents

If you ever needed a simple solution in Laravel to delete an entire directory and…

3 years ago

How to allow only 1 user to register in a Laravel application

How to enforce only one user to register or be registered in a Laravel web…

3 years ago