Skip to main content

USE HARDWARE ACCELERATION FOR VIDEO PLAYBACK | 4K HEVC 10bit | GPU DECODING GOOD or BAD ?

So as it seems that 4K is getting popular these days, but some people who have older computers may have some trouble playing 4K videos. Especially 10bit HEVC (x265) format. But the support for hardware decoding of HEVC 10 bit videos has been added few years ago.
First of all lets see whether this hardware decoding is better than normal software(CPU) decoding compared with power.



We won't be playing a game while watching a movie of course, at least not with a single monitor setup. So we can stop worrying about GPU usage going for 100% while watching a movie. But you could be doing many tasks with CPU while watching a movie. It is very practical. So lets turn into power consumption. This is very important for laptops. The following details are from a laptop with Intel Core i5 8250u with Intel HD graphics 620.

File details.
file details

I used VLC media player latest version.
All the Nvidia and Intel drivers used here are uptodate.
Make sure you have the latest software and drivers before trying Hardware decoding.

Without hardware acceleration.


CPU usage
CPU usage by VLC

CPU usage was typically around 35% to 50%. This is a mobile CPU but with the latest technology.

CPU power consumption
CPU power consumption for video HEVC 4K

Here you can see under powers theres Package, IA cores, GT. Other two are irrelevant for our purpose. The usage for IA cores went high as 20W during non hardware accelerated video playback. The average I can say somewhat around 15W. Which is very high for a laptop. The GT referes to the power consumption of the Intel integrated graphics UHD 620. It's around 0.3W, extremely low as we should expect as we are not using the GPU for decoding. Package power consumption is the total of all the other 4.

Now lets turn on Hardware decoding.


CPU consumption
CPU consumption
As you can see it was below 5% all the time for the VLC media player.
I don't know what the hell Chrome is using the CPU for. It just eats up resources :(

GPU consumption
GPU consumption
Usage under Video Decode was around 20%. Taskmanager shows the maximum used resource value under the usage. Not bad for a GPU that is capable of decoding HEVC 10bit at 8K. Surprising right? Intel UHD graphics is somewhat powerful after all.Notice here 1.3GB, a large amount of GPU memory is being used. That's actually coming up from my RAM, you can see the RAM usage is also high for VLC media player. That is Intel's DVMT (Dynamic Video Memory Technology) in action. It has allocated RAM for the use of Intel GPU.

Power Consumption

CPU power consumption for video HEVC 4K


In the first image you can see that the GT power is around  0.5W, which was the case for most of the time.We can say that on a average it used around 0.5W. 0.5W!!! previously it was 0.3W. Now look at the CPU power consumption the whole package ran below 10W all the time. This total power went down below 5W when I closed all the other applications. Don't just trust me check for yourselves. Here I've used CPUID HWMonitor.

So it is now clear that hardware decoding is very power efficient. I can say that the GPU decoding alone only raised its power consumption by a little figure as 0.2W . This is very important for a laptop. These values will be different on a dedicated desktop graphics card.

Here we are trying to use GPU to decode HEVC 10bit media as it is very CPU intensive. Here my CPU has no trouble handling it at around 35-50% percent. But I've seen 6th gen Core i3 desktop CPUs unable to play this file smoothly.

Check for capability


Before going any further you need to check whether your GPU supports HEVC 10bit video decoding. Unlike in software (CPU) decoding you can't get this capabilty just by using software.As the name says Hardware must be made to be compatible. To check whether your GPU support this go to the following links.

NVIDIA GPU
INTEL GPU
AMD GPU
(The VP9 format is used by Youtube.)

Check your GPU's compatibility. If you can't find your model under the list download DXVA checker. Simple 1.5MB tool that will give us all the information that we need here.

Open it , make sure the correct GPU is selected at the bottom left. If you have a laptop with a dedicated GPU like mine, although you have the NVIDIA or AMD graphics processor you must select the Intel integrated one. That is because in dual gpu setups the dedicated one is mainly for 3D and computing. It doesn't come with the encoding/decoding chip. However if you have a desktop graphics card in your laptop like GTX1050 upwards it may be the only card (The CPU doesn't come with integrated graphics). Check for an entry HEVC_VLD_Main10. If you don't see an that listed there , sorry mate your GPU doesn't support 4K HEVC 10bit decoding. But it may support normal 8bit decoding for HEVC and many other file formats. So remember there's a great advantage on power consumption. So follow the rest of this post and find out how to use it.

DXVA checker Intel UHD graphics 620

DXVA checker Nvidia MX150

I kindly ask you to upload a screenshot of yours in the comments if you are following this.

Turning hardware decoding on


If you're using windows 10, Movies & TV uses hardware decoding by default. But for HEVC you have to buy decoders from widnows store. Which is not an option for many. It is just 0.99$ by the way. So if you don't like using any other software just buy it.
Others if you're using VLC media player, goto Tools > Preferences > Input / Codecs.
There you can see Hardware Accelerated decoding. Choose DirectX Video Acceleration (DXVA 2.0). Here we are trying to force Hardware Acceleration so Automatic won't work all the time.

VLC media player Hardware Acceleration

Save settings. Restart VLC and play the file. You should notice in task manager that GPU is in use for video decoding.

If you are using media player classic.

While the media is playing goto Play > Filters > LAV video decoder.

Media Player Classic Hardware acceleration

Select DXVA2(copy-back). It is advised to use DXVA2 (native) if only DXVA2(copy-back) fails. CUVID and QuickSync are outdated actually, DXVA2 can beat them. You can see checkboxes for Resolutions. But these checkboxes are really for turning off Hardware decoding for those file formats. If the resolution is not listed in DXVA checker, checking the box here won't turn it on.

Here the hardware decoding is being used. That's why the Intel UHD graphics is listed as Active Hardware Accelerator.

Click OK and restart MPC HC.

Comments

Popular posts from this blog

How To Move Blogger Inline Styles CSS to External CSS file with Google Drive Within 5 mins

Inline style are the major barrier between good SEO score and your blog.Inline styles make the code too big, so how long you write the code to text ration won't rise up.In blogger, inline styles are used by default.But most of the websites on internet use external style sheets as they are self hosted and the designers are very likely to use external CSS.Sometimes Blogger use internal styles.You can learn the difference between Internal CSS,Inline CSS and External CSS from W3 schools .Read this article on Inline VS External CSS . Probably you may have tried copying CSS between <b:skin> tags of your Blogger blog.If you tried that you already know that it doesn't work.Because Blogger has more CSS coding that won't show in Template>Edit.So to find the real exact CSS code of your blog follow these steps.For this tutorial you need a Google Drive account,if you have a Blogger account you may already have one.If you don't have a Google Drive account create one now

DC Motor,Computer Cooling Fan Speed Controller Circuit DIY using Single Transistor And a Potentiometer

The circuit above can control speed of your DC motors or Computer Fans.If you use this to control speed of DC motors please use a diode to protect the Transistor,brush-less fans -OK.You can change the variable speed range by changing the value of R1 potentiometer.But don't use very high values,its pointless. The transistor used here is a NPN 2n3055,it can handle up to 15A and 115W of power.And this transistor can handle up to 60V.So if you're using this for PC fans you can add more in parallel.Normally a computer fan uses about 0.4W of power.Some powerful ones may use about 7W of power.If you don't use so much power then you can use a low power transistor like C1061,D313 etc. If you don't want to change the speed too often or hard to find a potentiometer or just willing to make this out of scrap you can use a Trim resistor for R1. The transistor may heat up very much and its essential to use a Heat sink.If you can,do not solder the transistor to the PCB s