-
Notifications
You must be signed in to change notification settings - Fork 7
Preparing Content for livesim2
At startup, livesim2 tries to scan and import all
DASH VoD assets it finds under vodroot
.
These VoD assets need to have MPDs in isoff-live
profile
with individual files for the init segment and each media segment.
If a VoD asset is not accepted, there should be log lines about it. See the Trouble-shooting section for more info.
Currently, livesim2 can import VoD assets with MPDs using either
- SegmentTemplate with
$Number$ - SegmentTemplate with SegmentTimeline with
$Time$
There is a further restriction that the SegmentTemplate
must be on the AdaptationSet level, and not inside a
Representation.
The SegmentTemplate should ideally use the $RepresentationID$
pattern like
<AdaptationSet id="0" contentType="video" mimeType="video/mp4" width="640" height="360" frameRate="30/1" segmentAlignment="true" par="16:9">
<SegmentTemplate timescale="15360" initialization="V300/init.mp4" media="V300/$Time$.m4s" startNumber="1">
<SegmentTimeline>
<S t="0" d="122880" r="8"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="V300" bandwidth="308820" codecs="avc1.64001e" sar="1:1"/>
</AdaptationSet>
The attributes contentType
and mimeType
should be inside the AdaptationSet, but will
be transferred from Representation-level if only present there. In the latter case, it is required
that there are no conflicting values between representations.
There may be more than one MPD per asset. It is important that they are all consistent. All requests for live content uses one of the provided VoD MPDs as starting point in the URL.
The video segments should have a fixed duration for all segments, while audio may have any duration. Livesim2 will, if necessary, resegment the audio segments so that they start at the same time or right after the video segments. If possible, it is preferable that all video and audio segments have exactly the same duration like 1.92s for 50fps video and 48kHz AAC audio. Subtitle segments are not resegmented and should have exactly the same duration as the video segments.
CMAF allows for edit lists that shift all timestamps by a fixed amount. Livesim2 does not yet have support for this, but there is an issue for supporting a shift of audio timestamps. A reason for this is to support the audio test streams from CTA-WAVE.
A single sidx box at the start of each segment should be fine. Its time will be updated and its timescale aligned with the timescale of the media timeline.
Livesim2 supports DASH-IF ECCP (Enchanced ClearKey Content Protection) including on-the-fly encryption of video and audio. The encryption can be in either "cenc" or "cbcs" format. At startup, init segments with encryption boxes are generated.
Pre-encrypted content should be supported from v1.5.1, see Issue 23 for background. Note that it is required that the audio segments have exactly the same total duration as the video. Ideally, they should also be aligned on the segment level.
It should be noted that some packagers, like shaka-packager, by default leaves the first segment(s) of unencrypted, even when encrypting the asset. This is for faster startup of the VoD asset, but is not good for looping the content. Use the appropriate option to turn that feature off, see below
To avoid a non-encrypted start and sidx boxes in the segments, the following two shaka-packager options should be used:
--clear_lead 0 --nogenerate_sidx_in_media_segments
The first step is to verify that the asset could be read properly.
For this, one can look at the initial log output as the vodroot
tree of
assets is scanned and parsed as part of the startup.
Warnings like:
{"time":"2024-10-02T08:17:05.726916+02:00","level":"WARN","msg":"Asset loading problem. Skipping","asset":"enc/live.mpd","err":"no SegmentTemplate in adaptation set"}
{"time":"2024-10-02T08:17:05.726967+02:00","level":"WARN","msg":"Asset consolidation problem. Skipping","error":"setReferenceRep: no video or audio representation found"}
indicate that an asset has not been loaded. In this case, it gives an indication that the SegmentTemplate is not found in the AdaptationSet.
All assets that have been loaded should be visible in the listings available
from the server at /assets
and /vod
.
For an example, look at the public livesim2 deployment.