Page 1 of 1

Render LibVLC to SharpDX texture

Posted: 30 May 2020 07:52
by mystery123sk
Hi,

is there a way to render video using LibVLC directly to Texture2D, which could be used in my own scene in SharpDX? I know there is a way using vmem, but that's CPU involved leading into lower performance.

I'm not a professional, but I suppose there is a different directx device context in LibVLC and SharpDX, so some kind of copy might be inevitable.

Michal

Re: Render LibVLC to SharpDX texture

Posted: 30 May 2020 18:38
by mfkl
Hi,

Yes, it is possible: https://code.videolan.org/mfkl/LibVLCSharp/-/blob/d3d-texture/Samples/LibVLCSharp.D3DCallbacks/Program.cs

Note that the code above isn't up to date to latest libvlc 4 (which you need, libvlc 3 doesnt have this API). So you'll need to adjust the interop code in libvlcsharp/master. PR welcome.

Re: Render LibVLC to SharpDX texture

Posted: 30 May 2020 19:41
by mystery123sk
Sounds great, will test it, thanks. Do you think it’s already ok to use version 4?

Re: Render LibVLC to SharpDX texture

Posted: 31 May 2020 12:39
by mfkl
Do you think it’s already ok to use version 4?
libvlc 4 is a development build, not a stable build.

Re: Render LibVLC to SharpDX texture

Posted: 13 Oct 2020 18:37
by mightypanda
Hello!
Have you succeeded in the effort, and do you have some code to share?
Thank you!
SB