I am looking to convert between HLS and MPEG Dash. I do not access to the original fully concatenated video file, only the individual HLS segments.
In doing this transformation to MPEG Dash I need to supply an initialziation segment for the Dash manifest .mpd file.
My questions are:
- What is the structure of a Dash video initialization segment?
- How can I generate/create one without the need for the original full file?
Perhaps a solution would involve getting MP4Box
to convert the '.ts' HLS segments to Dash '.m4s' segments which are self initializing, but I am unsure how to go about this this?
Any ideas are much appreciated.
Many thanks.
UPDATE:
Snippet to stream using original hls segments. Video plays all the way through but is just black.
<Representation width="426" height="238" frameRate="25" id="238p 400kbps" bandwidth="400000">
<SegmentList timescale="25000" duration="112500">
<SegmentURL media="video_0_400000/hls/segment_0.ts"/>
<SegmentURL media="video_0_400000/hls/segment_1.ts"/>
<SegmentURL media="video_0_400000/hls/segment_2.ts"/>
</SegmentList>
</Representation>
</AdaptationSet>
Best Answer
The initialization segment contains information required to initialize the video decoder. The initialization segment is optional (refer to ISO/IEC 23009-1).
For ISO BMFF (commonly known as mp4) this includes the
moov
box (specified in ISO/IEC 14496-12). For MPEG-TS usually there is no initialization segment. When present it contains several packets that carry the initialization data in a PES.Converting
HLS
toMPEG-DASH
is trivial if your target player supports the required features. First you need a player that supports MPEG-TS. Then you don't actually need an initialization segment because the initialization data is contained inside each HLS segment. To convert and HLS playlist to a MPEG-DASH mpd you have to create asegment list
or asegment template
. Here is an example:HLS:
MPD:
If your target player does not support MPEG-TS or
SegmentList
then you have to convert the HLS stream to MPEG-DASH by the use of some external tool likeMP4Box
.