MPEG DASH
#1
I've set up Kodi 14.2 on my Firefly RK3288 thanks to MAC_L1's work ( freaktab ). I'm hoping to stream HEVC content to it. It plays HD HEVC content from file really well, haven't tested 4k.

So to stream HEVC I've set up a Wowza media server, thing is the only way to stream out HEVC content with Wowza is MPEG DASH. AFAIK, MPEG DASH also seems to be the only mainstream standard currently natively supporting HEVC. I spent a few hours digging, doing my due diligence, the last discussion on MPEG DASH I found on this forum turned into a bit of a cluster#$&*.

I know ffmpeg supports MPEG DASH muxing, I'm very much unclear on whether it supports MPEG DASH demuxing. Ffserver can't do HEVC/MPEG DASH muxing yet, I suspect because of the same issue ffmpeg had which was fixed back in April ( https://trac.ffmpeg.org/ticket/4194 ). Regardless, I don't know the state of ffmpeg support.

I'm not as familiar with Kodi as I'd like, so I'm still exploring. It's hard to tell how far MPEG DASH support has progressed.

The goal is take a manifest.mpd and get working video/audio.

Open issues;
As I understand it playing either the video or audio is doable with Kodi, but taking 2 separate streams for them at the same time is a challenge?
Ideally this'd be done at a plug-in level, unclear whether that's possible. Extremely simplified, it's a parsing step, so hopefully won't take core changes, but I'm clearly not familiar enough to judge.


I'm willing to put in time/work to support this, I'm just not clear on what the current state is and how the work should be outlined.
Reply
#2
Generated an mpd manifest file to have something to work with. MPEG DASH/h264, so no HEVC, to make things easier initially, though I don't know how it'll vary if at all. Replaced HOSTTongueORT because I think it's actually internet facing ;p

Code:
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns="urn:mpeg:dash:schema:mpd:2011"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
     profiles="urn:mpeg:dash:profile:isoff-live:2011"
     type="static"
     mediaPresentationDuration="PT10M34.633S"
     minBufferTime="PT1.5S">
<ProgramInformation>
    <Title>sample.mp4</Title>
</ProgramInformation>
<Location>http://HOST:PORT/vod/_definst_/mp4:sample.mp4/manifest_w109056970.mpd</Location>
<Period id="0" start="PT0.0S">
    <AdaptationSet id="0" mimeType="video/mp4" width="512" height="288" par="16:9" frameRate="30" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
        <SegmentTemplate presentationTimeOffset="0" timescale="90000" media="chunk_ctvideo_cfm4s_rid$RepresentationID$_cs$Time$_w109056970_mpd.m4s" initialization="chunk_ctvideo_cfm4s_rid$RepresentationID$_cinit_w109056970_mpd.m4s">
            <SegmentTimeline>
                <S t="0" d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="900000"/>
                <S d="416970"/>
            </SegmentTimeline>
        </SegmentTemplate>
        <Representation id="p0a0r0" codecs="avc1.42c015" sar="1:1" bandwidth="640000" />
    </AdaptationSet>
    <AdaptationSet id="1" mimeType="audio/mp4" lang="eng" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
        <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
        <SegmentTemplate presentationTimeOffset="0" timescale="48000" media="chunk_ctaudio_cfm4s_rid$RepresentationID$_cs$Time$_w109056970_mpd.m4s" initialization="chunk_ctaudio_cfm4s_rid$RepresentationID$_cinit_w109056970_mpd.m4s">
            <SegmentTimeline>
                <S t="0" d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="480000"/>
                <S d="222384"/>
            </SegmentTimeline>
        </SegmentTemplate>
        <Representation id="p0a1r0" codecs="mp4a.40.2" audioSamplingRate="48000" bandwidth="96000">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
        </Representation>
    </AdaptationSet>
</Period>
</MPD>
Reply
#3
Dash streaming is not supported at all in Kodi. Video codec does not matter. This is why Youtube Kodi plugin is limited to 720p - because Google uses dash streaming for higher resolutions.

I have no idea if they are going to add support for that. It seems it's not going to be added in near future and it seems nobody are working on it currently
Reply
#4
Thanks for your reply.

Getting full HD in the Youtube plugin and being able to stream HEVC (standards apart from MPEG DASH are only in draft stage) sound like decent motivations. It's easy to find information on the standard and there's a reference player http://dashif.org/software/

Libdash is open source and includes the full standard (I believe) https://github.com/bitmovin/libdash

Any of the vets know to what extent this'll require core changes? From @giaur's post I take this'll take more than just a plugin.
Reply
#5
I would think if this gets into ffmepg then we will pretty much automatically be able to handle this?
Also other projects will profit from it.
Reply
#6
If you throw out a quick "ffmpeg -formats | grep dash";
E dash DASH Muxer
DE webm_dash_manifest WebM DASH Manifest

(I'm using a semi recent nightly-build, I don't know from which stable release they included these.)

So ffmpeg only supports mpeg dash muxing and as far as I can tell, you're still dependent on gpac tools and the like (ie. mp4box) to generate manifest files. So correct me if I'm wrong but it's "basically" a segmenter for mp4 and that's it. No demuxing at all.

There is a webm dash muxer/demuxer, but that's obviously vp8/9 only. Isn't that what youtube uses now? webm/vp9? Or is that something they're still working on?

Thinly related note because I'm not that familiar here. In general, is that the approach they favor here? Rather wait for ffmpeg rather than use a third party opensource lib? There's plenty of arguments to be made for both options, mostly just curious.
Reply
#7
(2015-09-03, 16:19)Martijnmumbles Wrote: There is a webm dash muxer/demuxer, but that's obviously vp8/9 only. Isn't that what youtube uses now? webm/vp9? Or is that something they're still working on?

No. There's no virtually no hardware support for VP8/VP9 and many browsers don't support it, so h.264 is the default format for youtube.
While you can optionally persuade (for some streams) youtube to provide VP8/VP9 that's not much good for Kodi where most platforms won't HW decode it
and so won't be able to play the HD streams.
Reply
#8
(2015-09-03, 16:37)popcornmix Wrote:
(2015-09-03, 16:19)Martijnmumbles Wrote: There is a webm dash muxer/demuxer, but that's obviously vp8/9 only. Isn't that what youtube uses now? webm/vp9? Or is that something they're still working on?

No. There's no virtually no hardware support for VP8/VP9 and many browsers don't support it, so h.264 is the default format for youtube.
While you can optionally persuade (for some streams) youtube to provide VP8/VP9 that's not much good for Kodi where most platforms won't HW decode it
and so won't be able to play the HD streams.

Interesting, so they don't use webm? I remember reading an article saying they'd use webm for their html5 player.

Personally, I'm not interested in webm/vp9, I doubt vp9 would decode well on my rk3288. I'd much rather do HEVC, hence mpeg dash.
Reply
#9
(2015-09-03, 17:11)Martijnmumbles Wrote: Interesting, so they don't use webm? I remember reading an article saying they'd use webm for their html5 player.

No support for webm/vp9 from Safari or Internet Explorer, so no iPhone/iPad support basically means youtube have to support H.264.
Reply
#10
(2015-09-03, 17:59)popcornmix Wrote:
(2015-09-03, 17:11)Martijnmumbles Wrote: Interesting, so they don't use webm? I remember reading an article saying they'd use webm for their html5 player.

No support for webm/vp9 from Safari or Internet Explorer, so no iPhone/iPad support basically means youtube have to support H.264.

So from that I take MPEG DASH support would help enable higher quality youtube too. It's pretty clear dash is desirable.

It's about the how and where, specifically, wait for ffmpeg or do it ourselves..
Reply
#11
obviously it'd be highly preferred to have dash support in ffmpeg directly. If thats not possible, cause ffmpeg won't accept it, we'd probably accept libdash in kodi as well.
Reply
#12
I'll start polling ffmpeg then (tbh, did already but it's much less transparent over there). I imagine that either there's people working on it, or there's good reasons why they're not working on it. Either way it'll be good to find out.

For me personally, obviously I'd rather have it downstream in kodi where I want to use it rather than upstream in ffmpeg and wait for it to trickle down, but I'm flexible.
Reply
#13
(2015-09-04, 12:53)Martijnmumbles Wrote: For me personally, obviously I'd rather have it downstream in kodi where I want to use it rather than upstream in ffmpeg and wait for it to trickle down, but I'm flexible.

I'm pretty sure if ffmpeg adds DASH support, there will be a PR to support it in Kodi in no time.
I believe ffmpeg is the right place for this support, and if they already support DASH muxing, then it seems likely they will accept DASH demuxing.
Whether anyone is actively working on it I don't know.
Reply
#14
(2015-09-04, 13:24)popcornmix Wrote:
(2015-09-04, 12:53)Martijnmumbles Wrote: For me personally, obviously I'd rather have it downstream in kodi where I want to use it rather than upstream in ffmpeg and wait for it to trickle down, but I'm flexible.

I'm pretty sure if ffmpeg adds DASH support, there will be a PR to support it in Kodi in no time.
I believe ffmpeg is the right place for this support, and if they already support DASH muxing, then it seems likely they will accept DASH demuxing.
Whether anyone is actively working on it I don't know.

Apparently parsing manifests is already a point for debate. MPDs are xml obviously, and there's discussion as to whether they should want to add a dependency for an xml parser. A good number of them are bloated or worse, suffer from vulnerabilities (following the discussion, I've never had such issues). I'd imagine that wouldn't be much of an issue here.

But that's all before you even get to the real demuxing.
Reply
#15
(2015-09-03, 16:37)popcornmix Wrote:
(2015-09-03, 16:19)Martijnmumbles Wrote: There is a webm dash muxer/demuxer, but that's obviously vp8/9 only. Isn't that what youtube uses now? webm/vp9? Or is that something they're still working on?
No. There's no virtually no hardware support for VP8/VP9
If you are looking for a reference platform to test Kodi/FFmpeg with VP9 in WebM then checkout http://kodi.wiki/view/NVIDIA_SHIELD_TV


Nvidia sais that it should be capable of VP9, H.264, and H.265/HEVC hardware decoding at up to 4K playback at 60 fps.
Reply

Logout Mark Read Team Forum Stats Members Help
MPEG DASH0