Kodi Community Forum
DASH Support - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: DASH Support (/showthread.php?tid=225696)

Pages: 1 2


DASH Support - cambax - 2015-04-30

What are the requirements that DASH support must meet if it is to be shipped with Kodi?

What work has already been done towards the inclusion of DASH support in a Kodi release? If it is known, what must still be done?

I have not seen productive or even encouraging discussion regarding DASH support. I'd like to see the feature become part of Kodi 16.

I would like answers to the above questions, preferably from Team Kodi members, before others jump in. The answers to these questions will lay the foundation for anything further so there's no point building a house yet.


RE: DASH Support - jjd-uk - 2015-04-30

We use a multimedia library called ffmpeg for our video decoding, so to include DASH support then ffmpeg must first support it. I believe there has been some work on DASH in ffmpeg, but there is currently no demuxer available, which is what we need to support streams from sites such as YouTube.


RE: DASH Support - cambax - 2015-04-30

There is no interest in using a third-party library like libdash?


RE: DASH Support - jjd-uk - 2015-04-30

I'm not one of the coder's so I don't know the details, but I believe that's been looked at but it doesn't include all that we need so we would have to code up a specialised demuxer.


RE: DASH Support - cambax - 2015-04-30

I had an hour long discussion with some people in #ffmpeg this morning regarding this issue.

FFmpeg already has a demuxer which supports the various containers, but a pre-demuxer is necessary to parse the DASH XML manifest and piece together the resulting container (mp4, etc.) This pre-demuxer is unlikely to be implemented by FFmpeg due to the lack of user demand. The feature wouldn't benefit users who typically use browser-based implementations written in Javascript and Flash, or who already have access to players like mpv and tools like youtube-dl.

Services which use the previously mentioned Javascript and Flash implementations (read: services outside education and academia, YouTube and so on) are a moving target, using their in-house implementations to prevent hotlinking, downloading of files (hah) and so on. These implementations are not "proper" DASH.

In order to pre-demux DASH manifests incorporating external tools (youtube-dl and so on) that support those services and plays cat-and-mouse with them is probably the best solution. By compartmentalizing the problems on a service level (or rather by letting the external tool developers do it) a behemoth DASH implementation that fixes all the corner cases of these "kind of DASH" implementations can be avoided. (Non-theoretical: this is what mpv does; mpv calls youtube-dl's Python script internally.)

If what I was told is correct, Kodi plugins cannot feed raw video, only URLs. This may end up being undesirable if this approach is taken.


RE: DASH Support - ironic_monkey - 2015-04-30

you can feed a pipe or run a server from a service so that by itself is not a showstopper. it is how e g spotimc works i believe.


RE: DASH Support - cambax - 2015-04-30

(2015-04-30, 19:01)ironic_monkey Wrote: you can feed a pipe or run a server from a service so that by itself is not a showstopper. it is how e g spotimc works i believe.

You can't natively pipe to a running process so if that approach was taken the process would have to be what has previously been described as hacky and unworkable.


RE: DASH Support - ironic_monkey - 2015-04-30

fine, bad example as such, but use a http server then. that is totally doable.


RE: DASH Support - cambax - 2015-05-01

A high level process for partial DASH support is:
  1. Download XML DASH manifest from an HTTP Server
  2. Parse Manifest to Identify Video and Audio Media Stream Locations
  3. Select Appropriate Media Streams
  4. Merge a Video and an Audio Stream
  5. Play Stream

Passing the results of that merging to Kodi could be done with an HTTP server, if that's what you're suggesting. Would the stream resulting from the merge go into memory the meantime? How would a limit on the memory use be implemented? Could Kodi report the playback position to the component handling the downloading and merging of separate streams and limit the progress to, for example, 20M past the playback position?

EDIT: Here is a presentation discussing proxying DASH for older HTML5 clients. It may be interesting.


RE: DASH Support - Ace - 2015-05-01

I'm still working on external audio support. If the streams can be read with ffmpeg that could probably used.


RE: DASH Support - cambax - 2015-05-01

(2015-05-01, 08:43)Ace Wrote: I'm still working on external audio support. If the streams can be read with ffmpeg that could probably used.

The manifest parsing cannot be done with FFmpeg, that needs to be done in Kodi. If external audio (play a video track simultaneously with an audio track) is in the works then resources should be next dedicated to parsing XML manifests- though at that point addons can do it equally as effectively (if not more since they already play the afformentioned cat-and-mouse game with service providers to get URLs.) Nearly no one benefits from full DASH support. People just want to play the two streams as if they were one.


RE: DASH Support - cambax - 2015-05-02

If the external audio support works the way it looks like it does (after very briefly going through its history) it's what's needed on Kodi's end.

At that point the existing addons just need to handle parsing DASH XML manifests for their relevant service providers, then pass the two (instead of one) URLs to Kodi "business as usual."

EDIT: I've now tested it too. With two local files, one mp4 from a DASH stream (so no audio) and one m4a from the same stream, XBMC (this is Ace's old build) immediately used it. Neat.


RE: DASH Support - MediaPi - 2015-05-03

I'm linking a a post (kodi) and github (page) relevant to this topic

No 1080p anymore
https://github.com/HenrikDK/youtube-xbmc-plugin/issues/33
2013

"
Hm. Could have sworn I'd already put my findings in a comment here a couple of days ago - oh well, probably didn't save.

I've had a look at what's going on. YT no longer serves combined 1080p audio/video streams. 1080p is still available, but only in a different streaming format called "DASH" or "MSE" (which may be different names for one and the same thing, or it may be two different new formats - didn't dig deep enough).

This new format has audio and video in two seperate streams (with matching PTS one would hope, didn't check).

Inspired by the script that grew out of http://userscripts.org/topics/132206?page=2#posts-519028 I got the "DASH" video stream to work; but for playback including audio the two seperate streams - audio and video - will need to be fed to XBMC.

I've had a look at the XBMC code; I didn't see a way how that would be possible out of the box. Looking further, it certainly seems that writing a InputStream / Demuxer implementation for XBMC's DVDPlayer core is possible. But that's not something I'd manage to do in an afternoon, so that goes on the back burner for now.

My patch to get at the 1080p DASH video stream is available here: jmbreuer/youtube-xbmc-plugin@75b2789. This patch shows the 1080p video stream when playback resolution is configured to "Ask" and 1080p is chosen from the list (it's not automatically chosen, since it won't have audio). Currently there's nothing in the UI to get at the audio stream next to this video, but the access mechanism should be exactly the same.

Regarding the InputStream/Muxer, I'll drop another line when I decide to start working on that. Until then, if someone else wants to have a go at it, feel free to ask me for any pertinent information I might have omitted above.
"

Integrating V8 and PyV8
http://forum.kodi.tv/showthread.php?tid=200309

I'm assuming everyone that wants this to work is for the youtube plugin?


RE: DASH Support - cambax - 2015-05-03

The two services I can think of that will benefit from any kind of DASH support right now are TED and YouTube. At this time I don't know of anything else.

I had seen that thread and forgotten about it. So in a way manifest parsing is somewhat done, external audio is somewhat done, and a basic prototype may be possible already.


RE: DASH Support - cambax - 2015-05-17

Quality selection is now standard in the YouTube add-on, according to this post. This type of menu would be useful for selecting the desired video and audio streams. Of course defaults could also be used instead but the interface broxmix made looks nice, simple and to the point.