FFmpeg: Copy Global Metadata but Discard Stream Metadata

This article explains how to use FFmpeg to preserve global container-level metadata—such as title, artist, or genre—while stripping away individual stream-level metadata, such as encoder details, handler names, or language tags from specific video and audio tracks.

By default, FFmpeg attempts to copy both global and stream-level metadata from the input file to the output file. To override this behavior and isolate the global metadata, you must explicitly map the global metadata while disabling the stream-level metadata mapping using the -map_metadata option.

The FFmpeg Command

To copy global metadata and discard stream-level metadata, use the following command structure:

ffmpeg -i input.mp4 -map_metadata 0 -map_metadata:s -1 -c copy output.mp4

Command Breakdown

Target Specific Streams (Optional)

If you want to discard metadata for only specific stream types rather than all streams, you can define them individually: