yuliskov / SmartTubeLegacy

Watch YouTube videos on your TV and set-top-box with comfort
Mozilla Public License 2.0
4.43k stars 598 forks source link

No HDR playback via Nvidia Shield #242

Open Sinbrad opened 5 years ago

Sinbrad commented 5 years ago

Was in contact via other medium as am unable to play any HDR content via Nvidia Shield due to app crashing but Fire TV 4K plays without problem. Possible problem with Shield and not SYT?

yuliskov commented 5 years ago

Thanks. I'll try to find a solution.

gtabmx commented 5 years ago

Seconded. This app works awesome on Sony x930e, allowing for HDR video selection, but refuses to continue playback if a HDR video option is selected on the nVidia Shield. Hope you can find a solution!

Pmant commented 5 years ago

Shield does not support VP9.2 profile.

forkymcforkface commented 5 years ago

Hello, the shield has been updated to android pie and now has the vp9.2 profile. HDR is still not working when that quality is selected

M2k80 commented 4 years ago

its correct shield is on pie, but there is NO VP9.2 support and there will never be one, that includes the new 2019 version too. the answer is on the nvidia shield forum, but if you dont find it, you are free to ask again

fgl27 commented 4 years ago

some more context on this https://github.com/yuliskov/SmartYouTubeTV/issues/390

fgl27 commented 4 years ago

@yuliskov I manage to make HDR working barely but it does using two methods.

using exo VP9 lib https://github.com/fgl27/SmartYouTubeTV/commit/51d1119e817407e85e66f1b06ea21d88f05353b8

forcing vp9 software decoder https://github.com/fgl27/SmartYouTubeTV/commit/97e2e9bed5e43293ae7f5f8b135970cc98580213

None of those are suitable as they are hard coded option the proper option must be a dynamically enable one, but I was just testing the concept.

None are OK as they can only play HDR videos up to 720p60, the software decoder method is the best, as it almost works OK in 1080p60, but even it be better option in relation to use vp9 lib some time it drops too many frames in 1080p60 or up, so the maximum usable resolution is 720p60 (maybe 1080p30 didn't try that).

I assume you may already test this if not those are the result.

my opinion is... that the best solution would be remove HDR options from the list on this device and any others that has this issue, one can query the codec info and see that it doesn't supports vp9 profile 2 as the app: https://play.google.com/store/apps/details?id=com.ellevsoft.mediacodecinfo&hl=en

and using that info remove the capability...

but is only my opinion not a thing you must do.

yuliskov commented 4 years ago

@fgl27 wow, great work. I'll check it!

mikefaille commented 4 years ago

I can reproduce the problem too. I run the latest stable version on my Shield fully updated with Android 9. I use the Pro player with default options and it doesn't work.

bali0703 commented 4 years ago

Latest Nvidia Shield update support Hdr on Youtube, unfortunatelly still not working on Smart Youtube TV :(

fgl27 commented 4 years ago

What shield? 2017 model has no update.

Also as far as I know YouTube only produce one link for a particularly type, meaning the link is the same how it works on one app and not on the other.

More info is needs here @bali0703 ... Are you sure HDR is working? How? Where is the update changelog?

M2k80 commented 4 years ago

Latest Nvidia Shield update support Hdr on Youtube, unfortunatelly still not working on Smart Youtube TV :(

neither 2019 or 2017 supports hdr on youtube

@bali0703 pls show a vid of proof of hdr with the original youtube app, thx

forkymcforkface commented 4 years ago

https://redd.it/h0roe0

Example videos

fgl27 commented 4 years ago

Seems only a sw decode workaround from YouTube app with doesn't trigger in my TV. That is not a fix, I already inform on preview post how sw decode works and is not a solution.

bali0703 commented 4 years ago

I just realised now the max resolution is 720p for HDR videos (version 8.0.2.) 1080p isn't smooth and no option for 4K : https://youtu.be/zDa-tcl84AQ

fgl27 commented 4 years ago

Unexpected decision to allow sw decode, doesn't feels right maybe was enable for testing and eventually will be removed.

I prefers no HDR and 4k over hdr 720p.

roblav96 commented 3 years ago

@yuliskov @fgl27 I hope this is the definitive thread for HDR playback on the Nvidia Shield TV? 😅

I've been using ExoPlayer for a few years now on numerous projects, I personally use both Shield TV Pro 2017 at mom's house and Shield TV Pro 2019 at home, few tips on how to get HDR playback working:


<com.google.android.exoplayer2.ui.PlayerView app:surface_type="surface_view" />

The ExoPlayer PlayerView container must render using the surface_view option in order to utilize hardware decoders.


DefaultTrackSelector.ParametersBuilder builder.setRendererDisabled(C.TRACK_TYPE_VIDEO, true);

Force disable any software renderer decoders.


Although I do not have any experience with VP9 decoder and HDR, latest ExoPlayer v2.12.0 should handle the VP9 decoder pipeline for you.

I'll play around with this and report back. Personally I've never even come across any HDR content on YouTube so this doesn't really seem like a major feature anyway. 😅

fgl27 commented 3 years ago

@roblav96

You seem to be confusing things...

The device doesn't have HW support for the codec that youtube uses for HDR content (vp9 profile 2), so I don't expect any improve unless the device receive a update, as is a HW issue will probably never receive, you can just search for "HDR" on youtubetv app to see HDR content.

there is other then surface_view views for the player view, and some of those can also access any codec.

setRendererDisabled doesn't seems to do what you say it does, just read the bellow link.

https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.ParametersBuilder.html#setRendererDisabled-int-boolean-

The only really effective way that I know to block a codec is using the bellow class

https://github.com/yuliskov/SmartYouTubeTV/blob/9f92e3b84f0f1cdc29c0b3ad36533ed2f4804d74/exoplayeractivity/src/main/java/com/liskovsoft/smartyoutubetv/flavors/exoplayer/player/BlackListMediaCodecSelector.java#L12

Any way have fun and let us know what you can find, if you can please explain better what you mean from the use of the view and ExoPlayer functions.

roblav96 commented 3 years ago

@fgl27 You are correct, my apologies.

The setRendererDisabled was used To turn off close captions from video track which I forgot about and confused it for something else. 🤦‍♂️ lol

roblav96 commented 3 years ago

@fgl27 Actually come to think of it, builder.setRendererDisabled(C.TRACK_TYPE_VIDEO, true) had something to do with enforcing video tunneling when maybeConfigureRenderersForTunneling is called since enableTunneling is initially true and if rendererType == C.TRACK_TYPE_VIDEO could potentially set enableTunneling = false, calling setRendererDisabled would make sure rendererType is never C.TRACK_TYPE_VIDEO to begin with.

fgl27 commented 3 years ago

@roblav96 you seem too confusing, what you are informing will not help to make HDR to work.

setting .setRendererDisabled(C.TRACK_TYPE_VIDEO, true) to a trackSelector will cause it to disable all TRACK_TYPE_VIDEO

so can that help fixing HDR? as that will just prevent any track that is a video from be used?

Can you explain what you are trying to do?

This issue is to try to fix HDR noting else, something that is probably impossible unless Nvidia provide a solution, as they say is a HW problem probably will never be a solution, unless they make a new device, but that is not a solution for older devices.