Search code examples
ffmpegvideo-streaminghttp-live-streamingmpeg-dashadaptive-bitrate

Use FFmpeg to create MPEG-DASH files


I know using ffmpeg, we can create MPEG-DASH ready files, including the segments and the .mpd manifest file. For instance, I'm trying this command which works:

ffmpeg -re -i .\video-h264.mkv -map 0 -map 0 -c:a aac -c:v libx264 -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 -window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" -f dash out.mpd

But I don't want to segment the video- so a simpler version where we have multiple versions of the whole video, no chunks. Does MPEG-DASH allow it? If so, how can I use ffmpeg to do it without creating the chunks?


Solution

  • I think you mean that you want a single file (for each bit rate), rather than individual files for each segment (again, for a given bit rate).

    MPEG DASH supports this - in the manifest each segment is referenced by a base URL and a byte range, rather than an individual URL.

    FFmpeg supports generating this format using the single file option:

    single_file single_file

    Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges.

    (https://ffmpeg.org/ffmpeg-formats.html#toc-dash-2)