Remove All Metadata with FFmpeg map_metadata

When sharing or publishing media files, removing personal or unnecessary metadata is crucial for privacy and file size optimization. This article provides a quick, straight-to-the-point guide on how to strip all metadata from any audio or video file using the FFmpeg command-line tool, specifically utilizing the powerful -map_metadata -1 option.

The Basic Command

To clear all global metadata from an input file without re-encoding the video or audio streams, use the following command structure:

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

How the Command Works

Advanced: Removing Stream-Specific Metadata and Chapters

While -map_metadata -1 clears global metadata, some files may contain metadata embedded within individual streams (like specific audio track titles) or chapter information. To ensure an absolutely clean file, you can expand the command:

ffmpeg -i input.mp4 -map_metadata -1 -map_metadata:s:v -1 -map_metadata:s:a -1 -map_chapters -1 -c copy output.mp4