Remove and edit metadata with FFmpeg

-map_metadata -1 drops the tags, -map_chapters -1 drops the chapters, and -c copy keeps the video and audio untouched. Add -fflags +bitexact to stop FFmpeg writing its own encoder tag. Every command below ran on a test file loaded with a title, a date, a GPS location and chapters.

Tags Stream copy

Removes what a person or a camera wrote. Instant, the streams are copied.

ffmpeg -i in.mp4 -map_metadata -1 -map_chapters -1 -c copy out.mp4

Title, artist, comment, date, GPS and chapters gone. encoder=Lavf62.3.100 is still there, written by FFmpeg itself.

Removed
title, artist, comment, date, GPS, chapters
Left
encoder=Lavf62.3.100
Run time
89 ms
Output
3.3 MB
Everything Stream copy

Also removes FFmpeg's own tag and the encoder settings stored in the video stream.

ffmpeg -i in.mp4 -map_metadata -1 -map_chapters -1 -fflags +bitexact -bsf:v filter_units=remove_types=6 -c copy out.mp4

Only the file-type tags and the track handler names are left. The x264 settings string inside the video stream is gone too, and every frame decodes the same.

Left
major_brand, handler_name
Pictures
every frame identical
Run time
85 ms
Output
3.3 MB

Run it

Run it on Rendobar

Send the same command from your code. The job fetches each input from its URL and returns the output file's URL when it finishes.

job.ts
import { createClient } from "@rendobar/sdk";
const rb = createClient({ apiKey: process.env.RENDOBAR_API_KEY });
const job = await rb.jobs.run({
type: "ffmpeg",
inputs: {
"in.mp4": "https://cdn.rendobar.com/examples/strip-metadata/in.mp4",
},
params: {
command: "ffmpeg -i in.mp4 -map_metadata -1 -map_chapters -1 -fflags +bitexact -bsf:v filter_units=remove_types=6 -c copy out.mp4",
},
});
console.log(job.output.file.url);

Install with npm i @rendobar/sdk. jobs.run() submits and waits, so it returns the finished job in one call.

terminal
curl https://api.rendobar.com/jobs \
-H "Authorization: Bearer $RENDOBAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "ffmpeg",
"inputs": {
"in.mp4": "https://cdn.rendobar.com/examples/strip-metadata/in.mp4"
},
"params": {
"command": "ffmpeg -i in.mp4 -map_metadata -1 -map_chapters -1 -fflags +bitexact -bsf:v filter_units=remove_types=6 -c copy out.mp4"
}
}'

Returns immediately with a job id. Poll GET /jobs/{id} or register a webhook rather than blocking on the request.

Every variant

Pick the command for your case

Each one ran on the same input. The line under it is what came out. Run times are the best of three runs with FFmpeg 8.0 on one desktop machine, so read them as relative.

  1. View the metadata of a file

    Read only
    ffprobe -v error -show_entries format_tags -of default=nw=1 in.mp4

    Ten lines, among them TAG:title=Sintel, the shaman scene, TAG:creation_time=2026-11-02T09:14:00.000000Z and TAG:location=+48.8584+002.2945/, a GPS position.

    89 ms run

  2. List the chapters

    Read only
    ffprobe -v error -show_entries chapter=start_time,end_time:chapter_tags=title -of csv=p=0 in.mp4

    0.000000,8.000000,Part 1, then Part 2 from 8 s and Part 3 from 17 s to 30 s.

    84 ms run

  3. Set the title

    Stream copy
    ffmpeg -i in.mp4 -c copy -metadata title="The shaman scene" out.mp4

    title=The shaman scene. Artist, comment, GPS and chapters are kept. The creation date is not: FFmpeg drops it on every remux.

    79 ms run 3.3 MB 30.00 s long

  4. Remove only the GPS location

    Stream copy
    ffmpeg -i in.mp4 -c copy -metadata location= -metadata location-eng= out.mp4

    Both location tags gone, title, artist, comment and chapters kept. An empty value deletes a tag.

    81 ms run 3.3 MB 30.00 s long

  5. Add or replace chapters from a file

    Stream copy
    ffmpeg -i in.mp4 -i chapters.txt -map 0:v -map 0:a -map_chapters 1 -c copy out.mp4

    The chapters now read The warning, The question and A dragon at 0, 8 and 17 s, taken from chapters.txt.

    75 ms run 3.3 MB 30.00 s long

  6. Add cover art to an MP4

    Stream copy
    ffmpeg -i in.mp4 -i cover.jpg -map 0:v -map 0:a -map 1 -c copy -disposition:v:1 attached_pic out.mp4

    A second video stream, mjpeg, with attached_pic=1. The file grew by the 52 KB of the JPEG.

    76 ms run 3.4 MB 30.00 s long

  7. Remove the cover art from an MP3

    Stream copy
    ffmpeg -i song.mp3 -map 0:a -c copy out.mp3

    533,089 bytes down to 480,882. The picture is gone, the title, artist and album tags stay.

    72 ms run 481 KB 30.00 s long

  8. Remove all tags and the cover from an MP3

    Stream copy
    ffmpeg -i song.mp3 -map 0:a -map_metadata -1 -fflags +bitexact -c copy out.mp3

    No ID3 tags left. ffprobe still shows encoder=Lavf, read from the MP3's Xing header. Add -write_xing 0 and it goes too.

    76 ms run 481 KB 30.00 s long

Gotchas

Where it goes wrong

Why are the chapters still there after -map_metadata -1?

Chapters are a separate list, and -map_metadata -1 only empties their names:

ffmpeg -i in.mp4 -map_metadata -1 -c copy out.mp4

The three chapters stay at 0, 8 and 17 s with empty titles. The format tags drop to the file-type tags plus encoder=Lavf62.3.100.

Add -map_chapters -1 to drop the chapters, and -fflags +bitexact to stop FFmpeg writing its encoder tag. The same trap works the other way: -map_metadata -1 in a command that adds chapters leaves them without names.

Does stripping metadata remove the encoder settings?

No. x264 writes its version and every setting it used into the video stream itself, in an SEI message, and copying the stream copies it:

grep -a -c "x264 - core" out.mp4

1 after the Tags answer, 0 after the Everything answer.

-bsf:v filter_units=remove_types=6 drops SEI messages from H.264 without re-encoding. Every decoded frame was identical before and after (framemd5 of all 720). SEI can also carry captions and HDR data, so leave it on a file that uses either.

Why does ffprobe still show handler_name and vendor_id?

The MP4 muxer writes them for every track it creates: VideoHandler, SoundHandler and a vendor of four zero bytes. They come from FFmpeg, not from your source. Setting them empty does not remove them:

ffmpeg -i in.mp4 -map_metadata -1 -metadata:s handler_name= -c copy out.mp4

handler_name still reads VideoHandler and SoundHandler.

The same goes for major_brand, minor_version and compatible_brands, which describe the file type.

Can I edit metadata without writing a new file?

No. FFmpeg always writes a new file. With -c copy that is a copy of the bytes, not a re-encode: setting the title took a 3,347,913 byte file to 3,347,905 bytes, and the pictures and sound are the same.

A remux also drops creation_time unless you set it again. The title task lost it. To keep the date, pass it back with -metadata creation_time=2026-11-02T09:14:00Z.

Avoid -map 0 on an MP4 with chapters. It copies the chapter track as a data stream, then the muxer writes its own, and the output had two bin_data streams.

Related: FFprobe video info, Convert audio formats, Add subtitles, Web-playable MP4.

Your command. Our infrastructure.

Bring your own commands. Run them on scalable CPU and GPU infrastructure, and pay only for compute time.