How to Add, Edit, or Remove Metadata in Media Files

FFmpeg is a powerful command-line tool used for handling multimedia files, including editing metadata, which contains essential information such as title, artist, album, genre, creation date, and encoding details.

Modifying metadata is useful for organizing media libraries, improving searchability, and adding copyright or author details to media files.

This guide explains how to modify media metadata using FFmpeg with practical examples in Linux.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.

Understanding Media Metadata

Metadata in media files is stored in containers such as MP4, MKV, MP3, and FLAC.

These metadata fields include:

  • Title – Name of the media file.
  • Artist – Creator of the file.
  • Album – Album name (for audio files).
  • Genre – Category of the media.
  • Year – Release or creation date.
  • Comment – Additional information.
  • Copyright – Ownership details.

FFmpeg allows you to edit metadata without re-encoding the media, making the process fast and efficient.

Checking Metadata of a Media File

Before modifying metadata, check the existing metadata of media file using the following command, the option -hide_banner remove the version details.

ffmpeg -hide_banner -i planetearth.mp4
Check Metadata of Media File
Check the Metadata of Media File

Updating Metadata in Audio/Video Files

To modify metadata fields of audio files such as title, artist, album, or genre, use:

ffmpeg -i awesome.mp3 -metadata title="New Title" -metadata artist="New Artist" -metadata album="New Album" -metadata genre="Rock" -codec copy awesome-output.mp3

For video files, use a similar command:

ffmpeg -i input.mp4 -metadata title="My Video" -metadata author="John Doe" -codec copy output.mp4

Here:

  • -metadata title="New Title" updates the title.
  • -metadata artist="New Artist" changes the artist’s name.
  • -metadata album="New Album" modifies the album name.
  • -metadata genre="Rock" sets the genre.
  • -codec copy prevents re-encoding, making the process lossless.
Updating Metadata of Media File
Updating Metadata of Media File

To add or modify the description of a file, use:

ffmpeg -i input.mp4 -metadata comment="This is a sample video" -codec copy output.mp4

To add copyright details to a media file:

ffmpeg -i input.mp4 -metadata copyright="© 2025 Your Name" -codec copy output.mp4

You can add an album cover to MP3 or FLAC files:

ffmpeg -i input.mp3 -i cover.jpg -map 0 -map 1 -metadata:s:v title="Album Cover" -metadata:s:v comment="Cover Image" -codec copy output.mp3

You can extract metadata and save it as a text file.

ffmpeg -i input.mp4 -f ffmetadata metadata.txt

To modify the metadata, edit metadata.txt and then apply it to a file:

ffmpeg -i input.mp4 -i metadata.txt -map_metadata 1 -codec copy output.mp4

Removing Metadata from Media Files

To completely remove all metadata from a media file:

ffmpeg -i input.mp4 -map_metadata -1 -codec copy output.mp4

For audio files:

ffmpeg -i input.mp3 -map_metadata -1 -codec copy output.mp3
Conclusion

FFmpeg provides a simple yet powerful way to modify media metadata without re-encoding files. Whether you’re updating titles, adding copyright information, embedding album art, or removing metadata, FFmpeg makes the process efficient.

If this article helped, with someone on your team.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.
TecMint has been free for 14 years. Help keep it that way.
Google AI Overviews and tools like ChatGPT have cut into search traffic for independent tech sites like TecMint. Running this site costs over $2,000 every month for hosting, infrastructure, and paying authors to keep the content accurate and tested.

If this article helped you solve a problem, consider buying a coffee. It helps keep TecMint free, supports the authors, and keeps the project going.
☕ Buy Me a Coffee
Ravi Saive
I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

6 Comments

Leave a Reply
  1. This guide was exactly what I needed!

    I had a bunch of MP3 files with missing metadata, and using FFmpeg saved me a ton of time. The batch editing script worked like a charm!

    Reply
  2. I never knew FFmpeg could handle metadata like this! I’ve always used it for video conversion, but now I’ll be using it to clean up my media library.

    Thanks for the detailed examples

    Reply
  3. Removing metadata from video files was a lifesaver for me. I had some old recordings with incorrect timestamps, and your guide helped me clean them up.

    Appreciate the clear instructions!

    Reply
  4. Great tutorial!

    I was able to add cover art to my FLAC collection without any issues, FFmpeg is truly a Swiss Army knife for media files!

    Reply
  5. I used this to fix incorrect artist and album names in my MP3 files. Worked flawlessly! One quick question – can FFmpeg also update metadata in WAV files, or does it only support compressed formats?

    Reply
    • Yes, FFmpeg can update metadata in WAV files as well! While WAV files don’t support as many metadata fields as formats like MP3 or FLAC, you can still modify basic tags such as title, artist, album, and comment.

      ffmpeg -i input.wav -metadata title="New Title" -metadata artist="New Artist" -metadata album="New Album" -codec copy output.wav
      
      Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Free Course
Get a free Linux course before you go.
Subscribe to TecMint Weekly and get the Learn Linux 7 Days Crash Course free. Read by 34,000+ Linux professionals every Thursday.
Something went wrong. Please try again.
Check your email for a magic link to get started.