asciidisco / plugin.video.netflix

Inputstream based Netflix plugin for Kodi
MIT License
1.24k stars 226 forks source link

Hardware decoding on linux. #422

Closed zylxpl closed 6 years ago

zylxpl commented 6 years ago

I'm submitting a ...

General infomration

I was thinking that it is impossible to use hardware decoding in linux with widevine and inputstream.adaptive. However, recently i found that plugin for HBO GO (Poland only) has working hardware decoding. Plugin has same requirements as netflix plugin: Kodi 18 Leia, InputStream.Adaptive 2.1.0, WideVine CDM and work very similar to netflix plugin. It is possibile to implement hardware decoding on netflix plugin?

Screenshots

https://postimg.cc/image/vapr0o2hp/

caphm commented 6 years ago

Netflix's license policy for WideVine restricts decoding to software only (see this comment). Maybe the HBO plugin uses a different policy which allows for HW decoding. For Netflix there's no way.

truedread commented 6 years ago

@caphm HBO probably uses the SW_SECURE_CRYPTO policy, which means the Widevine library only handles decrypting the frames and leaves it to the CPU/GPU to decode, meaning HW decoding is supported.

caphm commented 6 years ago

Closing, because it can't be implemented with Netflix's policy.

alorbach commented 6 years ago

I know its closed, but just to get a better understanding of this problem. NetFlix permits widevine to use hardware decoding, so widevine forces the CPU to do the decoding. Is that right? There is no way arround to tell widevine library to use hardware acceleration?

asciidisco commented 6 years ago

@alorbach Yes that´s correct. Hardware acceleration isn't possible with the Widevine library, only on certain Android devices which do have an appropriate Widevine level / license.

// Edit: Theoretically it´s possible with the library, it does support it, but Netlfix doesn't permit it in general.

alorbach commented 6 years ago

Thanks! According to your response, I tested your netflix plugin Kodi18 on CoreElec with widevine from ChromeOS and Kodi 18 on Android 7 with inbuild widevine on my S912 device.

On CoreElec, not even 720p is playable. On Android, FullHD runs smooth ... same inputstream settings.

Do you think it would be possible to use the Android widevine library in linux (LIbreElec / CoreElec)?

asciidisco commented 6 years ago

Nope, that won't be possible, as the Widevine library is baked into the Android OS. Which kind of device you´re running CoreeEec on? Also, some shows/movies on Netflix are restricted to SD on only when software decoding is used, this is another limitation and even Netflix can't do a thing about it, as those restrictions come from the Content Owners.

Might be good to a) Try a different show (I believe Star Trek Discovery does HD playback whilst being software decoded) b) Please post your inputstream config (maybe a picture or a screenshot) fro your CoreElec device. You could also try and set the Inputstream setting to manual and try to switch the resolution while a show is playing. It also shows the available resolutions of that particular stream when you do.

alorbach commented 6 years ago

I am using "MeCool M8S Pro L" which runs on armlogic S912 and Android TV 7.1 It's possible to enable FullHD streaming in Netflix APP for this device in Android. Besides that I have latest CoreElec 8.95 installed on a SD Card and can boot from it. Both run KODI 18 Beta / Alpha Versions.

I am using Inputstream adaptive settings like this (With manual stream selection): https://user-images.githubusercontent.com/24846265/42654553-49435c88-8619-11e8-8107-385b0bca6cea.png

In CoreElec, I can run all Netflix Shows in 1080p and lower. But only 480p is watchable. I have another S905 device (Odroid C2) where at least 720p is watchable in CoreElec.

On Android, with same settings it runs smooth in 1080p.

raven6679 commented 6 years ago

Similar here. I'm using Odroid C2 @AMLogic905 and I have UltraHD Netflix account, which allows me to play FullHD+ (and higher), but in CoreElec v9 Netflix plugin cannot play FullHD content correctly - there's low fps, frame skipping and av desync... Basically it's unwatchable.

asciidisco commented 6 years ago

@raven6679 Yes, that´s true. It´s just not powerful enough for FullHD encoding when using Widevine.

@alorbach Same´s true for you, the CPU just can't do better. When you´re using Android (with a properly Widevine L3 device), then inputstream can use hardware decoding with the Android stack, so 1080p is possible.

raven6679 commented 6 years ago

I understand, that's not currently possible to hw decoding Netflix streams in add-on? And nobody know, would it ever be possible, right?

asciidisco commented 6 years ago

@raven6679 Exactly.

raven6679 commented 6 years ago

Maybe we should start massive petition to Netflix in order to open their APIs for Kodi?

caphm commented 6 years ago

Team Kodi is already approaching content providers that they open their APIs or provide official addons. Generally Netflix is not very friendly when it comes to third party access to their APIs.

truedread commented 6 years ago

Hardware decoding works on Android because most Androids contain a level 1 Widevine client library, meaning a hardware-based trusted execution environment decodes video, so hardware decoding is possible. For Netflix to allow hardware decoding on level 3 devices such as a standard desktop, it would have to change its license policies to be SW_SECURE_CRYPTO. The problem with this is that it would allow anyone to invoke the CDM API outside of Chrome and save decrypted frames when the CDM is processing encrypted media. Because of this, I don't see Netflix ever changing their current license policy, which works well for the majority of their customer base.

raven6679 commented 6 years ago

Well, to be honest, personally for me Netflix UI is crap and with almost no option at all. What's worse, there's no native apps for Linux/ARMs. That's why I'm using it inside Kodi.

But in the light of things, that you are saying, I'm really REALLY wondering why I should pay for Netflix and experience their close-minded policy. Especially, that the library of movies & tvs here where I live, in Poland is very limited comparing to other countries.

Personally I believe that this is one of the reasons that privacy still exists in relatively "good shape". I really don't mind paying for stuff - I already have subs for videos, music (Google Play) and ebooks, but I don't like to be treated in that way as Netflix acts.

alorbach commented 6 years ago

That would have to be a massive petition to get Netflix to open up their API to the OpenSource community. There is only a handfull of Android TV devices even certified to run NetFlix HD.

And on my S912 device, it only runs in HD with the stock app because I had to install some inofficial stuff ;)

caphm commented 6 years ago

This discussion is pointless. There is no (and probably never will be) hardware acceleration except for L1 Android devices.

raven6679 commented 6 years ago

I beg to differ. Discussion ALWAYS has a point. Without communication, no idea would be ever born.

Krzmbrzl commented 5 years ago

Maybe a dumb question but what is necessary for a piece of hardware to get that L1 licence?

giaur500 commented 5 years ago

Does anybody know, can we force 720p to make stream playable?

MattHillUK commented 5 years ago

@giaur500 Go to the settings on the Netflix plugin > Inputstream Addon Settings > Max Resolution Secure Decoder, then set the max resolution to 720p.