Copy Chapters from Input to Output in FFmpeg

This article explains how to preserve and copy chapter markers from a source video or audio file to a newly generated output file using FFmpeg. You will learn the exact command-line arguments required to map chapter metadata successfully, whether you are transcoding the file or simply copying the streams.

By default, FFmpeg does not always copy chapter markers automatically, depending on the input and output container formats. To guarantee that chapters are copied from the first input file to the output file, you must use the -map_chapters option.

The Standard Command

To copy chapters along with the video and audio streams without re-encoding, use the following command:

ffmpeg -i input.mp4 -c copy -map_chapters 0 output.mp4

Command Breakdown

Copying Chapters While Re-encoding

If you are transcoding the video or audio instead of stream-copying, the -map_chapters flag works exactly the same way:

ffmpeg -i input.mkv -c:v libx264 -c:a aac -map_chapters 0 output.mp4

Important Considerations