s0faking / plugin.video.orftvthek

ORF TVthek - This KODI plugin provides access to the Austrian "ORF TVthek"
GNU General Public License v2.0
42 stars 19 forks source link

Feature request: Support for new UHD HEVC streams #69

Closed infinity85 closed 6 years ago

infinity85 commented 6 years ago

Hello, since the soccer championship started, orf also offers uhd 4k and/also adaptive quality in their orf tvthek apps. As far as I see it in my Amazon Fire TV orf App, the old quality settings (same as in your addon) remain for h264 up to 720p with 24 frames. Then there is also an adaptive setting (also h264 up to 720 and max ~3,5mbit, 24fps) and then there is a New UHD quality setting:

This UHD setting is also adaptive and 50fps (ideal for soccer) and starts with 720p50 at ~7,5mbit, goes to 1080p50 at ~11mbit and should offer 2160p50 as well (cannot test, as no 4k tv here). But even for fullhd tvs it would be a huge benefit to make use of this uhd stream, as the 1080p50 picture is simply a huge step forward.

Would it be possible to add support for this new higher quality step? Only a few programs offer this uhd setting, I did see it only for the soccer matches so far. UHD is mentioned in the epg titles for these programs.

My very best regards :)

s0faking commented 6 years ago

hi,

i think this already works with the serviceapi option by @Rechi. when i list the livestreams with the option enabled i can see [ORF1 UHD ...] Items, but the resoultion is still 720p. they might switch that tough when a game starts.

as for the htmlscraper: i will add those options for the live streaming section

cheers, s0fa

Rechi commented 6 years ago

I had a quick look and for serviceapi it should be a simple change, but with current code it won't work.

infinity85 commented 6 years ago

@s0faking Yep, it starts here with 720p50 as well, then climbs up to 1080p50 after 30s to 1 minute. It's adaptive, so it adjusts then to the given bandwidth. Cannot test 2160p uhd, as my tv is only an old fullhd one.

@rechi Sad to read it, though it might be something for the future :)

Rechi commented 6 years ago

@infinity85 can you try the following changes? It will break everything else then WM livestream, just a quick workaround.

+++ b/resources/lib/serviceapi.py
@@ -119,9 +119,9 @@ class serviceAPI(Scraper):

        def JSONStreamingURL(self,jsonVideos):
                source = None
-               if jsonVideos.get('progressive_download') != None:
-                       for streamingUrl in jsonVideos.get('progressive_download'):
-                               if streamingUrl.get('quality_key') == self.videoQuality:
+               if jsonVideos.get('hls') != None:
+                       for streamingUrl in jsonVideos.get('hls'):
+                               if streamingUrl.get('quality_key') == 'UHDBrowser':
                                        return generateAddonVideoUrl(streamingUrl.get('src'))
                                source = streamingUrl.get('src')
s0faking commented 6 years ago

@infinity85 please try the latest commit on the devel branch. i fixed the UHD stream for the htmlscraper and the adaptive quality setting should also work with both scrapers

infinity85 commented 6 years ago

Man, I decided to delete my last post, as it does not help anybody :-D...

Now I figured it out...So I install the devel build, enable in settings @Rechi s service api and, edit those three lines and now I get the ORF UHD stream. Also the categories are working now as expected and the live match titles contain UHD.

The stream has a lot of dropped frames, either it is my internet connection or my Odroid seems to be a bit overstressed with this. Is there a way to force the adaptive uhd stream to choose 1080p50? Accodring to kodis codec info the stream tunes with with 2560x1440 with 25 frames. On the firetv orf mediathek app it chose automatically 1920x1080 with 50 frames. As I do not have a 4K TV, the odroid seems to be overloaded with downscaling the stream from 2560x1440 to 1080p for my TV, which is only FullHD capable.

EDIT: Well about choosing the quality of the UHD stream:

I managed to download the corresponding m3u8 manifest file. And there are the following quality steps:

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-STREAM-INF:BANDWIDTH=17207855,RESOLUTION=2560x1440,CODECS="hvc1.2.4.L150.B0,mp4a.40.2",AUDIO="audio"
orfdev01cmaf-abr_1.m3u8?m=1528727071
#EXT-X-STREAM-INF:BANDWIDTH=9198333,RESOLUTION=1920x1080,CODECS="hvc1.2.4.L150.B0,mp4a.40.2",AUDIO="audio"
orfdev01cmaf-abr_2.m3u8?m=1528727071
#EXT-X-STREAM-INF:BANDWIDTH=7559413,RESOLUTION=1280x720,CODECS="hvc1.2.4.L150.B0,mp4a.40.2",AUDIO="audio"
orfdev01cmaf-abr_3.m3u8?m=1528727071
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="audio_1",LANGUAGE="und",AUTOSELECT=YES,URI="orfdev01cmaf-abr_4_3.m3u8?m=1528727071"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="audio_2",LANGUAGE="und",AUTOSELECT=NO,URI="orfdev01cmaf-abr_4_4.m3u8?m=1528727071"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="audio_3",LANGUAGE="und",AUTOSELECT=NO,URI="orfdev01cmaf-abr_4_5.m3u8?m=1528727071"

I'd love to be able to tune in the 1920x1080p stream. Would it be possible to integrate such a quality selection?

s0faking commented 6 years ago

hey @infinity85 ,

thx for testing. i've fixed the error you described in your last post (child_restart missing ...). uhd with the htmlscraper should work now.

the uhd stream stutters on my desktop hardware too. i will try this on my shield tv tonight, but i guess this is not an addon bug.

regards, s0fa

s0faking commented 6 years ago

@infinity85

Is there a way to force the adaptive uhd stream to choose 1080p50?

yes this is already builtin in kodi. open the osd video settings and choose "select program". then you should see a list of qualities to choose from