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…

1 year ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

1 year ago

FTP getting array of file details such as size using PHP

Using FTP and PHP to get an array of file details such as size and…

2 years ago

Creating Laravel form requests

Creating and using Laravel form requests to create cleaner code, separation and reusability for your…

2 years ago

Improving the default Laravel login and register views

Improving the default Laravel login and register views in such a simple manner but making…

2 years ago

Laravel validation for checking if value exists in the database

Laravel validation for checking if a field value exists in the database. The validation rule…

2 years ago