Page 1 of 1

GPU acceleration for ActiveX in .NET Desktop App

Posted: 10 Aug 2010 14:02
by delusion
I have successfully integrated the "VLC ActiveX plugin v1" in my project and it plays the test video :) . Unfortunately gpu acceleration is not used although i activated it in the VLC player options. When i play the test video with the VLC player the gpu acceleration is used (win7, gpu: ati4890).

I've searched the forums for some possibilities of setting options:
- via command line options, but there seems to be no option for enabling "gpu acceleration"
- via changing the vlc defaults in the vlcrc file , but i couldn't find any option related to "gpu acceleration" (if there is any)
- via the get/setVariable, but there also seems to be no "gpu acceleration"

Did i miss something?
Or am i trying something that cannot be done with the VLC ActiveX Element v1 but with VLC ActiveX Element v2?
Or can it only be done with libVLC?


Since i need to play HD videos which would consume almost all cpu power but still need cpu power for other things i need to use the gpu acceleration :(

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 10 Aug 2010 15:16
by Jean-Baptiste Kempf
--ffmpeg-hw

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 11 Aug 2010 17:53
by delusion
Thanks for your help :) !
I tried to utilize this command and it works, but only from the commandline :(

e.g. vlc.exe Video.m2ts --ffmpeg-hw

plays the video file with hardware acceleration ignoring the value that was set in the VLC main application.
But if i try to use it in my application nothing happens.
It doesn't matter if i use "VLC ActiveX plugin v1" or "VLC ActiveX plugin v2"

Code: Select all

string[] options = new string[1]; options[0] = "--ffmpeg-hw"; string fileName = "Video.m2ts" string metaName = "Simuilationsfahrt"; axVLCPlugin21.playlist.add(fileName, metaName, options); axVLCPlugin21.playlist.play();
Using ":ffmpeg-hw" instead of "--ffmpeg-hw" leads to the same result.
Even using a logger doesn't work (but also works from the command line), so i can't find the cause of the error.

Code: Select all

string[] options = new string[4]; options[0] = "--extraintf=logger"; options[1] = "--log-verbose==3"; options[2] = "--logtype=text"; options[3] = "--logfile=\"C:\\Users\\Admin\\Desktop\\file_log.txt\""; string fileName = "Video.m2ts" string metaName = "Simuilationsfahrt"; axVLCPlugin21.playlist.add(fileName, metaName, options); axVLCPlugin21.playlist.play();
However from doing a search on the forums it seems as if some command line options are disabled for the ActiveX plugin for security reasons. I don't know why the default setting for hardware acceleration would be disabled for the ActiveX Plugin even when it was manually enabled in VLC. If it is not possible manually enable it for the ActiveX plugin it would result in no hardware acceleration at all for the ActiveX plugin :?

Going back to an older version which does not disable commandline options is not an alternative since gpu acceleration is only supportet in the latest releases. Some options are working. If i replace "--ffmpeg-hw" by ":novideo" it shows no video.

Is there an error in my approach or is there any workaround to pass options to the plugin?
Has anyone managed to get the hardware acceleration working for the activeX plugin?
Can it be done with the libvlc .net wrapper?

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 28 Aug 2010 10:15
by ojrn
I also have the same VLC ActiveX problem when using the ffmpeg-hw option -- the option does not appear to have any effect at all. Tried on combinations of Windows Vista and 7, x86 and x64. Development environment is .Net 2.0.

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 04 Sep 2010 16:45
by Jean-Baptiste Kempf
Ok, this is very likely. File a bug.

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 16 Oct 2010 17:03
by ojrn
@j-b, thanks for helping.

There are over a thousand open tickets in the VLC bug trac, and most of which are never responded to :? . This is a severe bug for all developers integrating the VLC player. Is there another channel we can use to notify the devs?

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 17 Oct 2010 18:03
by Jean-Baptiste Kempf
Well, after thoughts, we don't want website people to control hardware of the people.

ActiveX is mostly used for websites, so you cannot.
We'll wait that this option becomes the default.

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 27 Feb 2013 11:14
by balasubramanya
Is the GPU accleration for activex is enabled in VLC v2.0.0+ builds?

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 27 Feb 2013 23:36
by Jean-Baptiste Kempf
No

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 28 Feb 2013 05:46
by balasubramanya
Thanks JB. I am currently using vlc 2.0.2 for a web based application and I have the control over the application which uses vlc web plugin. I would like to enable the GPU acceleration for my application. Since I am compiling vlc on my own, is it possible for me to enable the gpu decoding feature for the web plugin during vlc compilation? If yes please provide me pointer to do so. I also would like to know about the 2.0.2 vlc web plugin that is it designed to use the multi-core cpu architecture in efficient way during web playback or do I need to modify/enable some feature during compilation?

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 28 Feb 2013 07:25
by Jean-Baptiste Kempf
You just need to recompile the axvlc.dll part and you can add this, of course (--avcodec-hw)

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 01 Mar 2013 08:27
by balasubramanya
Thanks JB. Could you please provide or point me specific steps to do these changes?

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 04 Mar 2013 06:59
by balasubramanya
Do I need to add

Code: Select all

ppsz_argv[ppsz_argc++] = "--ffmpeg-hw";
in VLCPlugin::initVLC() in activex/plugin.cpp to enable GPU decoding in web plugin?
I tried this option but it didn't worked for me. I am using vlc 2.0.2 version.
Please clarify if this was the place where I need to add the code to enable GPU decoding in web plugin.

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 10 Mar 2013 00:58
by Jean-Baptiste Kempf
avcodec-hw, but yes.

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 11 Mar 2013 11:15
by balasubramanya
I got the gpu decoding working in IE-8. But firefox and chrome the playback was not using gpu. If I set the value to "ffmpeg-hw" to 1 by default in avcodec.c the gpu decoding is working for chrome and firefox.

Re: GPU acceleration for ActiveX in .NET Desktop App

Posted: 11 Mar 2013 14:11
by Jean-Baptiste Kempf
Cool.