How to Add ID3v2 Tags to MP3 Using FFmpeg

This guide provides a straightforward tutorial on how to use FFmpeg to add or update ID3v2 metadata tags—specifically the Year, Genre, and Track Number—in an MP3 file. By using the command line, you can quickly embed this metadata into your audio files without needing to re-encode the audio stream, preserving the original sound quality.

To add or modify ID3v2 tags in an MP3 file, you will use FFmpeg’s -metadata option along with the -c:a copy flag to copy the audio stream without re-encoding.

The FFmpeg Command

Run the following command in your terminal or command prompt to apply the Year, Genre, and Track Number tags:

ffmpeg -i input.mp3 -metadata date="2023" -metadata genre="Synthwave" -metadata track="5" -id3v2_version 3 -c:a copy output.mp3

Command Breakdown

Verifying the Changes

To verify that the metadata was successfully written, you can inspect the newly created file using FFmpeg with this command:

ffprobe output.mp3

The output will display the metadata block at the top, showing your updated date, genre, and track tags.