Skip to content

What's the best way to offload video decoding to the GPU

Have any of you examined which combinarion of nVidia drivers and internet browsers results in the lowest cpu usage while watching 4k video from say youtube? If so I'm interisted in what you found.

56 points32 comments
Open on Reddit
About this post
Posted
Archived
Score
56 · 100% up
Kind
Text
ID
e61peg

Author

2
posts
19
comments
0
media
View profile

35 comments

unknown author13 hidden

Deleted before we saved it.

27 points

Is this project still active? I see the native client hasn't been updated in two years.

2 points
unknown author

Deleted before we saved it.

6 points

Can you watch Netflix in full hd with that combination? I never got it to work

0 points

No, this works by running the youtube video via mpv and youtube-dl
Meaning you can basically give it everything that works with youtube-dl, which isn't Netflix

2 points

I've used this browser add-on for 1080p Netflix on Linux in the past. Apparently it stops working from time to time but you might wanna give it a shot. I've mostly moved to other devices for Netflix but for other reasons.

Edit: obviously this has nothing to do with gpu rendering, but I wasn't sure what was meant by 'never got it to work' ;)

2 points
unknown author

Deleted before we saved it.

1 points

mpv with youtube-dl (just give mpv the youtube link) is an easy way of watching videos with hardware decoding. Though obviously you lose the benefits of being in the browser like autoplay etc. Still you could use the browser to actually browse you video site of choice, and then set up a keybinding through your window manager that launches mpv witb the link from the primary selection. That way you dont even have to copy anything, its like 3 button presses and youre done.

12 points

chromium vaapi

8 points

or you can be lazy like me chromium vaapi bin. make sure you follow the instructions and ignore the gpu blacklist and install the nvidia vaapi stuff. but its all there step by step in the wiki

6 points

This worked really well on my netbook with Celeron N4000. 4k video playback is smooth as silk, although it still sips quite a bit of power, compared to Windows 10. On Ubuntu Mate + Chromium VAAPI build i get about 5,5 hours of YT playback, Chrome + Win10 gives me over 8 hours. Not a biggie though.

2 points

yeah it is awesome but i really prefer firefox and i have to build it periodically which takes like 3x more time than the kernel

0 points

Thank you all for your kind suggestions I recently switched to chromium-vaapi and made sure all the chromium hardware acelation settings were on but didn't notice any difference in the amount of cpu used. 6th gen core i3 with nvidia 1050 proprietary drivers for those that were wondering. Firefox with mpv looks promising so I'll try it next

3 points

Did you make sure to go into "chrome://flags" and turn on the Ignore GPU Blacklist Option? I've also found that Firefox and turning on the "layers.acceleration.force-enabled" option in "about:config" usually does the trick for me as well, if you don't want to use a Chromium based browser.

1 points

Remember if you're using a mesa driver to also install libva-mesa-driver and mesa-vdpau.

If you're using the proprietary nvidia driver you shouldn't need anything else other than browser support.

3 points

In general, it's very strongly advised to avoid hardware decoding unless absolutely necessary, i.e. if your CPU is insufficient to decode the file in questions. If you run into any weird decoding issues, frame glitches or discoloration, and you have --hwdec turned on, the first thing you should try is disabling it.

https://mpv.io/manual/stable/#video

Also in KDE you can use Klipper actions to open videos straight from the buffer with regexp like this - ^http.+(vi[dm]eo|youtu|\btv\b) and mpv %s command. It'll work with any browser.

-4 points

Where did you read that it should be avoided? Seems counterintuitive.

7 points

I believe that was written many years ago. When hardware drivers were buggy. Or glitches in hardware or drivers locked up system or smth like that.

Nowadays hardware decoding works pretty good. I'm using it everywhere for many years - Windows or Linux, both with mpv.

4 points

From the same link:

vdpau is usually safe, except for 10 bit video. If deinterlacing enabled (or the vdpaupp video filter is active in general), it forces RGB conversion. The latter currently does not treat certain colorspaces like BT.2020 correctly.

vaapi and d3d11va are safe. Enabling deinterlacing (or simply their respective post-processing filters) will possibly at least reduce color quality by converting the output to a 8 bit format.

For most users, VDPAU or VA-API are fine. Interlaced video is very rare in 2019.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.