libVLC : most efficient way to access audio/video data

This forum is about all development around libVLC.
MikOfClassX
Blank Cone
Blank Cone
Posts: 48
Joined: 29 Dec 2018 10:23

libVLC : most efficient way to access audio/video data

Postby MikOfClassX » 02 Jan 2019 09:30

Hello all,

I'm new to libVLC and my aim is to use it as general media-handling layer for my applications.

After reading tons docs and looking some test code, it seems that libVLC has the features I'm looking for.

In order do integrate libVLC, I would need to access to video/audio data at a very low-level, i.e. get (already converted) ARGB frames and PCM audio samples.

Now it seems there are 2 different ways to achieve this result: through callbacks (libvlc_video_set_callbacks(), libvlc_audio_set_callbacks()) or through SMEM.
The question is easy: which is the best/fastest/suggested/most efficient way ?

Thanks,

Mik

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libVLC : most efficient way to access audio/video data

Postby Rémi Denis-Courmont » 02 Jan 2019 09:50

Use the LibVLC API if it works for you. But getting ARGB is not efficient to begin with. If that's what you want to do, it's going to be slower than VLC, whether you use unsupported smem manually or use the LibVLC API.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

MikOfClassX
Blank Cone
Blank Cone
Posts: 48
Joined: 29 Dec 2018 10:23

Re: libVLC : most efficient way to access audio/video data

Postby MikOfClassX » 02 Jan 2019 10:03

Thanks for the hint. So libvlc_xxxx_set_callbacks() is the way.

Yep, ARGB is not that comfortable for hw accel, but I need it. And libVLC will have to do some yuv->ARGB conversions for me, probably.

So, SMEM is unsupported, right ? I didn't get it from the docs.

MikOfClassX
Blank Cone
Blank Cone
Posts: 48
Joined: 29 Dec 2018 10:23

Re: libVLC : most efficient way to access audio/video data

Postby MikOfClassX » 03 Jan 2019 08:52

BTW my first implementation runs like hell with ARGB and callbacks (both audio and video). Too cool you decode into user-supplied buffers. This will open doors to a zero-copy implementation.
Now I'll have to check seeking capabilities and stability when using multiple libVLC instances from the same process.

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libVLC : most efficient way to access audio/video data

Postby Rémi Denis-Courmont » 03 Jan 2019 18:33

You cannot do zero copy with callbacks. It requires VLC to copy internally.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

MikOfClassX
Blank Cone
Blank Cone
Posts: 48
Joined: 29 Dec 2018 10:23

Re: libVLC : most efficient way to access audio/video data

Postby MikOfClassX » 04 Jan 2019 09:21

Yep, "almost" zero copy. I checked the VLC code. There's the color-space conversion copy, isn't it ?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 34 guests