Page 1 of 1

Using GPU on decoding

Posted: 12 Jun 2014 21:12
by imanafa
Hi guys.

I am developing an application using libvlc and c#. The application opens multiple instances of vlc player in multiple screens and plays media in them. Everything is working good and the application works great.

There is one problem though which I was expecting from start. As the number of player instances grow so does the CPU usage. I was hoping to be able to activate the hardware acceleration on vlc so the cpu wouldnt have to work so hard. From my understanding this option is enabled in vlc 2.1.3, which is the version I'm using. I tried --avcodec-hw=any and it didnt make any difference, the GPU capacity used by vlc is at most close to 12.5%. (I have AMD Graphics card and monitored the GPU using their monitoring application).

I was hoping to be able to use the maximum GPU capacity on video decoding.

Is there anyway to achieve this? Is it possible to actually manage the GPU usage through libvlc?

Re: Using GPU on decoding

Posted: 12 Jun 2014 21:40
by Rémi Denis-Courmont
Most GPUs can only accelerate decoding of one video at a time (or two if capable of stereography). You definitely do not want to use the GPU to scale up.

Re: Using GPU on decoding

Posted: 16 Jun 2014 21:03
by imanafa
Rémi thank you for your response.

When I use avcodec-hw=any, after opening the second or third(depending on video quality) the videos get laggy and pixelated and if i open enough player instances in my application, usually 4 or more, my application will crash.(the cpu usage is much lower as expected but seems like DXVA is not capable of managing multiple instances)

The same thing happens with VLC itself if i open multiple instances of VLC player, it crashes. i tried using ffmpeg-hw , no lags but still to much CPU usage which leads me to believe that its not effective in my situation.

Is there a way i can use less CPU capacity and more of GPUs?

Re: Using GPU on decoding

Posted: 16 Jun 2014 22:02
by Rémi Denis-Courmont
You can use the GPU to offload decoding, but only one or maybe two videos. If you want to decode many videos simultaneously, you need a powerful (in practice, multicore) CPU. Period.