Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate DASH with the adaptive inputstream addon #34

Open
firsttris opened this issue Jun 3, 2021 · 7 comments
Open

Integrate DASH with the adaptive inputstream addon #34

firsttris opened this issue Jun 3, 2021 · 7 comments

Comments

@firsttris
Copy link
Owner

No description provided.

@Miteirao
Copy link

Miteirao commented Aug 9, 2021

Yes please, add DASH support.

@nullket nullket changed the title Implement and or integrate youtube_dl with DASH and the adaptive inputstream plugin of kodi Integrate DASH with the adaptive inputstream addon May 31, 2022
@nullket
Copy link
Collaborator

nullket commented Jun 2, 2022

I did some initial research.

  • Input stream adaptive "just" needs a .mpd file containing the info for the streams (plural in sense of audio + video + different qualities + different codecs)
  • Unfortunately, in many cases the .mpd file is not directly available on the content site (e.g. youtube)
  • We can and must build our own .mpd file based on the result[formats] output of youtube_dl/yt_dlp
    • The youtube/tubed addon is doing something similar with their scrapper/api functions
    • Input stream adaptive requires the mpd to be available on a webserver (to also handle drm etc.). Thus, when we create our own .mpd we must also integrate a webserver in our addon as explained here
    • gerion0 was already on the right track here
    • We might need to manually download the first bytes of the stream to extract the position of the streams meta information within the stream (see the issue linked above) or can get the range meta from youtube_dl/yt_dlp (have not found it there yet)
  • Syntax of input stream adaptive is slightly different over different kodi versions

I see the biggest challenge in creating an initial rudimentary working mpd file for just one quality. We should try this outside of the plugin to simplify things. Everything from there on (adding different formats/codec, offering a http server, integrating it in the addon etc.) should be straight forward.

@nullket
Copy link
Collaborator

nullket commented Jun 11, 2022

I got a very rough first PoC outside of sendtokodi working.

  • If possible find dash or hls manifests URLs in the results of yt_dlp
  • Simply insert this URL with some standard input stream adaptive settings in the playlist - done
  • If no manifest URL could be found directly (e.g. youtube) try to build our own in a temp folder
  • When building the manifest ignoring the range key seems to work for now (according to the standard it "shall" be in there)
  • Start a webserver to provide this custom manifest to kodi
  • Insert the local webserver url to the playlist
  • Stop the webserver after a timeout or after the manifest had been requested

Unfortunately, the input stream adaptive addon does not support all kinds of manifest schemes. We might need to have a blacklist to filter websites where we can not use their original manifests directly.

I am encountering a lot of exceptions and undocumented hurdles so integrating this into sendtokodi might take some weeks.

@nullket
Copy link
Collaborator

nullket commented Aug 15, 2022

I just want to leave quick status update here:

  • I am able to create manifest files (not all things supported yet).
  • This works very good for certain websites (like youtube) but breaks on others (due to streams which are not supported by kodis manifest parser/player)

We still need:

  • Integration of a webserver providing the manifest to kodi (not leaving the server running in the background for ever)
  • Figure out how multiple languages work
  • Figure out how to support other codecs than mp4 and how to deal with multiple options being available
  • Integrate a "max resolution" (at least I think)
  • Need a way to fish out the right format based on all conditions (user preferences, available streams, supported codecs, supported manifest files etc.). This is the biggest issue as the different websites are resulting in many different formats (in terms of yt-dlp formats).

I am sorry but I am super busy for the next months, thus I cannot really work on this and it will take some time. If somebody wants to see it earlier I would need some help (e.g. implement the webserver, user preferences, format fishing (I can provide the input data). etc.)

@laurentbacall
Copy link

Thanks @nullket. Happy to help although I don't think I would have all the skills readily available you would need from me. What I can obviously at least offer is to do some testing on arte.tv streams (see #70 )

@Doktor-X
Copy link

@nullket, i want to ask, do you have poc addon or do you do all work manual to test if it will work, if you have addon can you send it to me i only need it to work on youtube

@nullket
Copy link
Collaborator

nullket commented Apr 28, 2023

I have setup everything manually.

The problem is not to get it working for one site but:

  • dealing with all sites or integrating some kind of whitelist
  • managing the Webserver which is now needed to provide the manifest file to Kodi

Th first one is „real“ problem the second one just work. Currently, I have to much on my hands in order to work on this. I hope it will get better in two months (when a personal project ends). In case somebody else wants to integrate that feature sooner, I will for sure help in the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants