libvlc: get the pointer on the data

*nix specific usage questions
KidCoding
New Cone
New Cone
Posts: 4
Joined: 14 Feb 2012 10:45

libvlc: get the pointer on the data

Postby KidCoding » 14 Feb 2012 11:04

Hello!

How to get the data pointer on the decoded image (unsigned char* or char* or whatever)?
Is there any callback where I can get the pointer on the data each time a new image is decoded?

Thanks,
KiD

N.B.: I'm on Ubuntu 11.4. I have installed libvlc-dev 1.1.9 from synaptic (ubuntu ppa)

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

Re: libvlc: get the pointer on the data

Postby Rémi Denis-Courmont » 14 Feb 2012 12:15

That is what video filters VLC plugins are for. Well, that and optionally but typically modifying the image.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

KidCoding
New Cone
New Cone
Posts: 4
Joined: 14 Feb 2012 10:45

Re: libvlc: get the pointer on the data

Postby KidCoding » 14 Feb 2012 12:53

Well...
Could you give me a link to some doc? (How to implement a plugin for example? or Some sample code...)

KidCoding
New Cone
New Cone
Posts: 4
Joined: 14 Feb 2012 10:45

Re: libvlc: get the pointer on the data

Postby KidCoding » 14 Feb 2012 14:33

Just to be more specific about my question.
I'm using libvlc to decode videos in a c++ app (based on this code http://wiki.videolan.org/LibVLC_SampleCode_Qt ).
So, libvlc decodes a video and pass the result to a window (Qt here).

I want to do some processing on the image before I display it. This is why I need an access to the data pointer.

Thanks,
KiD

KidCoding
New Cone
New Cone
Posts: 4
Joined: 14 Feb 2012 10:45

Re: libvlc: get the pointer on the data

Postby KidCoding » 16 Mar 2012 12:06

For those who want the answer, it can be found in the SDL example http://wiki.videolan.org/LibVLC_SampleCode_SDL .

To access pixels, the callbacks have to be used. In the callback (unlock) function (defined by vlc see SDL example), a pointer to the pixels date is given.

Cheers,
KiD

User avatar
jiapei100
Blank Cone
Blank Cone
Posts: 33
Joined: 06 Aug 2009 02:17
VLC version: 4.0.0-dev
Operating System: Ubuntu
Location: Surrey, BC, Canada
Contact:

Re: libvlc: get the pointer on the data

Postby jiapei100 » 25 Mar 2012 11:43

Any example including both the video and audio streams?

Cheers
Pei
For those who want the answer, it can be found in the SDL example http://wiki.videolan.org/LibVLC_SampleCode_SDL .

To access pixels, the callbacks have to be used. In the callback (unlock) function (defined by vlc see SDL example), a pointer to the pixels date is given.

Cheers,
KiD
Welcome to Vision Open
http://www.visionopen.com


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 21 guests