Skip to content

Conversation

@cotid-qualabs
Copy link

@cotid-qualabs cotid-qualabs commented Aug 19, 2025

L3D-DASH Support

This pull request introduces the support for Low-Latency & Low-Delay DASH (L3D)

Functionality Overview

The L3D implementation generates individual chunks from full segments, enabling progressive media delivery. The system uses writeSubSegment to handle chunk requests and prepareChunks to divide segments into smaller temporal units. Chunk duration can be configured explicitly via URL parameters.

Main Changes

  1. MPD Generation Enhancements (when Low Delay/SSR is enabled)
    Added DASHProfileLinear profile for SSR streaming compliance
    Implemented EssentialProperty with urn:mpeg:dash:ssr:2023 schema reference
    Implemented SupplementalProperty with urn:mpeg:dash:adaptation-set-switching:2016
    Set startWithSAP=1 for proper stream initialization
    Added SegmentSequenceProperties with sapType=1 and cadence=1 to enable playback initialization on any chunk
    Implemented SubNumber on media Segment Template
  2. Segment Timeline Improvements
    Introduced calculateK function to compute S@k value for proper segment indexing
    Enhanced sub-segment chunking support for low-latency & low-delay delivery
  3. URL Configuration System
    Created SSR UI section in the URL generator for easy configuration
    Added ssrAS and chunkDurSSR URL parameter for enabling Low Delay mode for both video and audio adaptation sets.
    Updated URL generation logic to properly handle low-delay streaming parameters
  4. MPD Generation Enhancements (when Low Delay and Low Latency is enabled)
    Implemented EssentialProperty with urn:mpeg:dash:ssr:2023 schema reference
    Implemented SupplementalProperty with urn:mpeg:dash:adaptation-set-switching:2016
    Set startWithSAP=1 for proper stream initialization
    Implemented SubNumber on media Segment Template
    Compute S@k
  5. Library and Dependency Updates
    Updated dash-mpd library to v0.13.0 for improved MPD parsing and generation capabilities
    Adapted to new S type struct from the updated dash-mpd library

How to generate a Low Delay URL

  1. Select the testpic_2s_low_delay asset
  2. Navigate to the SSR section
  3. Set the SSR configuration using the following format: adaptationSetId,ssrValue;adaptationSetId,ssrValue;... where ssrValue is the value of ssr EssentialProperty (supports both video and audio adaptation set)
  4. Set the chunk duration for the low delay using the following format: adaptationSetId,chunkDuration;adaptationSetId,chunkDuration;... (supports both video and audio adaptation set)

How to generate a L3D (Low Delay & Low Latency) URL

  1. Select the testpic_2s_low_delay asset
  2. Navigate to the Low latency section
  3. Set chunk duration for low-latency
  4. Navigate to the SSR section
  5. Set the SSR configuration using the following format: adaptationSetId,ssrValue;adaptationSetId,ssrValue;... where ssrValue is the value of ssr EssentialProperty (supports both video and audio adaptation set)
  6. Set the chunk duration for low delay using the following format: adaptationSetId,chunkDuration;adaptationSetId,chunkDuration;... (supports both video and audio adaptation set)

Supported Use Cases

  • Basic Low Delay to Low Latency Video Content Switching: Start with low delay content and fall back to low-latency content.

Configuration example:
SSR Configuration: 1,0
Switching Logic:
AS1: SSR value="0" → Next reproduction is AS0
AS0: No SSR → Final low-latency regular content

  • Progressive Low Delay Video Degradation Chain: Start with the most aggressive low delay setting, progressing through intermediate low-delay configuration, and finally falling back to low-latency content.

Configuration example:
SSR Configuration: 2,1;1,0
chunk duration for low delay: 2,0.2;1,0.5
Switching Logic:
AS2: SSR value="1" → Next reproduction is AS1
AS1: SSR value="0" → Next reproduction is AS0
AS0: No SSR → Final low-latency regular content

  • Basic Low Delay to Low Latency Audio Content Switching: Start with low delay video and audio content and fall back to low-latency video and audio content.

Configuration example:
SSR Configuration: `3,2;1,0
Switching Logic:
**AS1 (video) **: SSR value="0" → Next reproduction is AS0 (video)
AS0 (video): No SSR → Final low-latency regular content
**AS3 (audio) **: SSR value="2" → Next reproduction is AS2 (audio)
AS2 (audio): No SSR → Final low-latency regular content

  • Switching from low delay to regular renditions (non low latency) should work with the current logic, but haven't been tested since it is out of this PR scope

Wiki Update Suggestion

1. Preparing Content for L3D Assets

Target Wiki Page: Preparing Content for livesim2

Suggested Addition: L3D Content Requirements

Add a new section covering content preparation for L3D streaming:

L3D Content Preparation

For L3D to work, content should be encoded with the following considerations:

Video Encoding Parameters: GOP size must be aligned with the chunk duration in frames (e.g. if your video has a GOP size of 6 frames and a frame rate of 30fps, the GOP duration is 6 / 30 = 0.2 seconds. The chunk duration should be a multiple of this value (e.g., 0.2, 0.4))

FFmpeg sample

ffmpeg
-f lavfi -i smptebars=size=1920x1080:rate=30:duration=8
-vf "drawtext=text='1920x1080@30fps':x=(w-text_w)/2:y=80*(h/1080):fontsize=72*(h/1080):fontcolor=white:box=1:[email protected]:boxborderw=18,
drawtext=timecode='00:00:00:00':rate=30:x=(w-tw)/2:y=280*(h/1080):fontsize=144*(h/1080):fontcolor=white:box=1:[email protected]:boxborderw=30,
drawtext=text='2000 kbit/s - Low Delay':x=(w-text_w)/2:y=480*(h/1080):fontsize=72*(h/1080):fontcolor=white:box=1:[email protected]:boxborderw=18"
-c:v libx264 -g 6 -r 30 -keyint_min 6 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*0.2)" -b:v 2M
-y low_delay_1080p.mp4

gpac example

gpac -r
-i sources/low_delay_1080p.mp4:#ASID=1
-i sources/audio.mp4:#ASID=2
-o out/Manifest.mpd:template='r$RepresentationID$_seg$Number$':timescale=1000:segdur=2:dmode=static:profile=live

2. New URL Parameters

Target Wiki Page: URL Parameters

Suggested Addition: Low Delay Parameters

Add documentation for the new Low Delay URL parameter:

Low Delay Parameters

Parameter Description Example
ssrAS Enables Low Delay (SSR) mode on the specified adaptation sets. The following format is required: adaptationSetId,ssrValue;adaptationSetId,ssrValue;... where ssrValue is the next adaptation set id /livesim2/ssras_{adaptationSetId, ssrValue}/testpic_2s_low_delay/Manifest.mpd

Low Delay Mode Effects: When ssrAS is specified in the URL path, the following modifications are applied to the generated MPD:

  • Profile: Set to DASHProfileLinear for L3D compliance
  • Essential Property: Includes urn:mpeg:dash:ssr:2023 specification
  • SupplementalProperty: Includes urn:mpeg:dash:adaptation-set-switching:2016 specification
  • SAP Configuration: AdaptationSet@startWithSAP=1 for proper stream access points
  • SegmentSequenceProperties element is included in the low-delay AdaptationSet with the sapType=1 and cadence=1 attributes

Usage Pattern:
/livesim2/[other-params]/ssras_{adaptationSetId, ssrValue}/[asset-name]/Manifest.mpd

Compatibility Notes:

  • Low Delay requires Low Delay Chunk Duration URL Parameter
  • Low Delay mode works in combination with Low Latency URL parameters
  • Low Delay mode works in combination with other URL parameters
  • Requires properly encoded content with an appropriate GOP structure

Suggested Addition: Low Delay Chunk Duration Parameters

Add documentation for the new Low Delay Chunk Duration URL parameter:

Low Delay Chunk Duration Parameters

Parameter Description Example
chunkDurSSR Enables sub segment generation on the specified adaptation sets using the specified chunk duration. The following format is required: adaptationSetId,chunkDur;adaptationSetId,chunkDur;... where chunkDur /livesim2/chunkdurssr_{adaptationSetId, chunkDur}/testpic_2s_low_delay/Manifest.mpd

Low Delay Chunk Duration Mode Effects: When chunkDurSSR is specified in the URL path, the following modifications are applied to the generated MPD:

  • Sub-segment Generation: Enhanced timeline generation with chunk duration support

Usage Pattern:
/livesim2/[other-params]/chunkdurssr_{adaptationSetId, chunkDur}/[asset-name]/Manifest.mpd

Compatibility Notes:

  • Low Delay Chunk Duration requires Low Delay URL Parameter ssrAS
  • Low Delay mode works in combination with other URL parameters
  • Requires properly encoded content with an appropriate GOP structure

cotid-qualabs and others added 13 commits August 19, 2025 17:22
This follows CMAF that only allows a shift of all timestamps.
The edit list is kept, and all times in the MPD are shifting accordingly.
A new test asset combining WAVE video and audio has been added.
Also documented in the README.md together with video edit list support.
@cotid-qualabs cotid-qualabs changed the base branch from feature/l3d-dash to main August 27, 2025 18:09
Copy link

@tobbee tobbee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks fine. I had some minor comments. The main description text should also be scrutinized so that it is updated.

For example, it says something about implicit chunk duration which is no longer there. It also talks quite a lot about switching between low-delay and low-latency, but it may happen that you switch between low-delay and normal segments as is done in LL-HLS when you go back in the timeline.

There are also way too many commits, so it would be good to either squash them ton one, or preferably, to combine them into a few big but "independent" commits its that is possible. It may be quite some work though, so I leave that decision to you.

In the future, I think we should also support that not all chunks start with an IDR-frame, so I think it should be documented as a current limitation.

@cotid-qualabs cotid-qualabs changed the base branch from main to feature/l3d-dash-old November 4, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants