How to Enable Edit Lists (elst) in FFmpeg MOV Muxer

This article explains how to configure the FFmpeg MOV and MP4 muxers to write edit lists (elst atoms). You will learn the specific command-line flags required to enable or disable edit lists, why they are used for audio-video synchronization, and how to verify their presence in your output media files.

Understanding Edit Lists (elst)

In MP4 and MOV containers, an edit list (elst atom) is a metadata structure that instructs the media player how to map the media timeline to the presentation timeline. They are most commonly used to: * Handle initial delays caused by B-frames (video GOP structure). * Synchronize audio and video streams that have different start times. * Define precise start and end points for playback without re-encoding the media.

Configuring the Muxer in FFmpeg

By default, FFmpeg’s mov and mp4 muxers write edit lists automatically if the input stream requires them (for example, when using video codecs with B-frames like H.264 or H.265).

You can explicitly control this behavior using the -use_editlist private muxer option.

Force Enable Edit Lists

To explicitly force the muxer to write edit lists, set the -use_editlist flag to 1:

ffmpeg -i input.mkv -c:v libx264 -c:a aac -use_editlist 1 output.mp4

Disable Edit Lists

Some older hardware players, legacy browsers, or specific streaming servers do not support edit lists, which can cause playback failures or audio sync issues. To disable edit lists entirely, set the flag to 0:

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

Note: When you disable edit lists, FFmpeg will attempt to adjust the sample packet timestamps directly to maintain synchronization, but this may result in a negative initial packet timestamp which some players also dislike.

Verifying the Presence of elst Atoms

You can check if your output file contains edit lists by using ffprobe to inspect the container layout. Run the following command in your terminal:

ffprobe -v trace output.mp4 2>&1 | grep elst

If the output file contains edit lists, you will see lines indicating the detection of the elst atom. If there is no output, edit lists were not written to the file.