Most efficient way to play into textures with libvlc/VLCKit

macOS specific usage questions
lagnat
New Cone
New Cone
Posts: 4
Joined: 20 Nov 2011 02:35

Most efficient way to play into textures with libvlc/VLCKit

Postby lagnat » 20 Nov 2011 04:38

I'm currently using libvlc and have taken the simple way out of requesting video frames in RGBA. From there it's easy work to create textures and I'm off to the races, except for that fact the the VLC engine is sucking down gobs of CPU trying to uncompress video. On the other hand, the VLC application doesn't seem to suffer from the same CPU load when playing the same content which would imply to me that VLC is making better use of the GPU, perhaps using something like GL_YCBCR_422_APPLE? I poked around VLCKit but I didn't see the secret sauce there for getting video into OpenGL. It seems to rely on something in libvlc for doing it..?

Can anyone point me in the right direction on this?

Thanks..

fkuehne
Developer
Developer
Posts: 7253
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: Most efficient way to play into textures with libvlc/VLC

Postby fkuehne » 21 Nov 2011 10:50

VLCKit uses the opengl video output in modules/video_output. The general opengl vout renders converts the video frames to a correct color space and renders the result in a texture. That texture is passed on to the Mac specific opengl vout, which puts the texture in a NSView, which was created by VLCKit in advance.
This way, the frames are never copied within VLC's memory space.

If you switch to the stabilizing code base of VLC 1.2, you will notice dramatic speed improvements to the OpenGL video output when playing a certain set of files, since we are using a shader for the chroma conversation now.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

lagnat
New Cone
New Cone
Posts: 4
Joined: 20 Nov 2011 02:35

Re: Most efficient way to play into textures with libvlc/VLC

Postby lagnat » 21 Nov 2011 13:26

Yes.. that's exactly what I want! Thanks for the reply. I have been using the vlc-git nightly for the libvlc.dylib. Is that the 1.2 code base?

As for the opengl vout, how do I make use of that with libvlc? Right now I'm using libvlc_video_set_callbacks, and libvlc_video_set_format_callbacks which is where I've been specifying RGBA. I got that sequence from the examples and a little bit of googling. I'm assuming there's a different calling sequence to make use of the opengl vout?

Thanks again!

lagnat
New Cone
New Cone
Posts: 4
Joined: 20 Nov 2011 02:35

Re: Most efficient way to play into textures with libvlc/VLC

Postby lagnat » 08 Apr 2012 15:58

Hi again. I spent some time on this, but I haven't gotten very far. I've read through the source code a bit and the best I can determine is that I should copy macos.m and start modifying it to render to a given context. Is there a simpler way? Could you suggest a starting point for me?

Thanks.


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 5 guests