How to Configure FFmpeg DASH Muxer for WebM

This guide provides a straightforward walkthrough on how to configure the FFmpeg DASH muxer to generate WebM segments instead of the default MP4. You will learn the necessary command-line arguments, compatible video and audio codecs, and specific muxer flags required to output a WebM-compliant Dynamic Adaptive Streaming over HTTP (DASH) manifest and segment files.

To configure FFmpeg’s DASH muxer (-f dash) to output WebM segments, you must use WebM-compatible codecs (VP9 or VP8 for video, and Opus or Vorbis for audio) and explicitly instruct the muxer to use the WebM container format for its segments.

The FFmpeg Command

Below is the standard command structure to convert an input video into WebM DASH segments:

ffmpeg -i input.mp4 \
  -c:v libvpx-vp9 -keyint_min 150 -g 150 -sc_threshold 0 \
  -c:a libopus -b:a 128k \
  -f dash \
  -dash_segment_type webm \
  -seg_duration 5 \
  -init_seg_name "init-\$RepresentationID\$.webm" \
  -media_seg_name "chunk-\$RepresentationID\$-\$Number%05d\$.webm" \
  manifest.mpd

Parameter Breakdown

Once the process is complete, FFmpeg will output an XML-based Media Presentation Description file (manifest.mpd) alongside a series of .webm initialization and media segment files ready for streaming.