How to Set DASH Update Period and Buffer Depth in FFmpeg

This article provides a straightforward guide on how to configure the minimum update period (@minimumUpdatePeriod) and the time shift buffer depth (@timeShiftBufferDepth) in a DASH (Dynamic Adaptive Streaming over HTTP) manifest using FFmpeg. You will learn the specific command-line options required to control these parameters, which are essential for optimizing live streaming latency and enabling DVR-like playback controls for your viewers.


When packaging a live stream using FFmpeg’s DASH muxer (-f dash), you can control how players interact with your live manifest (MPD) by modifying the update frequency and the size of the sliding playback window.

To configure these settings, FFmpeg provides two specific private muxer options: -min_update_period and -time_shift_buffer_depth. Both of these options expect values defined in microseconds (where 1 second = 1,000,000 microseconds).

Key Parameters Explained

  1. -min_update_period <microseconds>
    This maps to the @minimumUpdatePeriod attribute in the MPD file. It tells the media player how often (at a minimum) it should fetch the updated manifest file to discover new segments.
    • Example: To set an update period of 5 seconds, use 5000000.
  2. -time_shift_buffer_depth <microseconds>
    This maps to the @timeShiftBufferDepth attribute. It defines the duration of the sliding window of media segments that remain available for playback. This allows viewers to seek backward (DVR functionality) during a live stream.
    • Example: To allow viewers to rewind up to 60 seconds, use 60000000.

FFmpeg Command Example

Below is a practical FFmpeg command demonstrating how to apply these settings during a live DASH encoding process:

ffmpeg -re -i input.mp4 \
  -c:v libx264 -b:v 3000k -g 60 -keyint_min 60 -sc_threshold 0 \
  -c:a aac -b:a 128k \
  -f dash \
  -seg_duration 2 \
  -min_update_period 5000000 \
  -time_shift_buffer_depth 60000000 \
  -use_timeline 1 \
  -use_template 1 \
  -window_size 30 \
  manifest.mpd

Command Breakdown