libvlc_new instance creation problem

This forum is about all development around libVLC.
qt123
New Cone
New Cone
Posts: 5
Joined: 27 Oct 2010 21:25

libvlc_new instance creation problem

Postby qt123 » 27 Oct 2010 21:32

I am using QT 4.7 and VLC 1.1.4
When I was trying to create an instance of the libvlc, I got a NULL pointer, why?

Here is the example of the creation:
libvlc_instance_t *pVLCInstance = libvlc_new (0, NULL);

I also tried the following, still not luck:
const char * const vlc_args[] = {
"--no-media-library",
"--reset-plugins-cache",
"--no-stats",
"--no-osd",
"--no-video-title-show"};

libvlc_instance_t *pVLCInstance = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);

Any clue for me? What are the default arguments that I can use without any conflict? Thanks.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: libvlc_new instance creation problem

Postby Sébastien Escudier » 28 Oct 2010 08:43

you should look at the logs when you run your program.
Maybe vlc can't find any modules.

qt123
New Cone
New Cone
Posts: 5
Joined: 27 Oct 2010 21:25

Re: libvlc_new instance creation problem

Postby qt123 » 28 Oct 2010 14:46

Could you tell me where the log is? I went the debug from QT as well as from VS2008. Will it still produce the log? Thanks.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: libvlc_new instance creation problem

Postby Sébastien Escudier » 28 Oct 2010 15:22

I don't know about windows. Maybe you can run your program from a console ?

qt123
New Cone
New Cone
Posts: 5
Joined: 27 Oct 2010 21:25

Re: libvlc_new instance creation problem

Postby qt123 » 28 Oct 2010 15:40

I can run vlc from the command console from Windows fine.
I can try to build vlc on linux side, since I am more of a Windows person, the steps for building the vlc on linux seems rather confusing to me.

I want to build an application using QT. I thought the first step is to create a new instance of VLC. But it failed as soon as I called "libvlc_new". Can you provide me with any example using vlc 1.1.4? Thanks.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: libvlc_new instance creation problem

Postby Sébastien Escudier » 28 Oct 2010 16:11

libvlc_instance_t *pVLCInstance = libvlc_new (0, NULL);
should work.
If it's not the case, you'll need to look at the logs.

qt123
New Cone
New Cone
Posts: 5
Joined: 27 Oct 2010 21:25

Re: libvlc_new instance creation problem

Postby qt123 » 28 Oct 2010 17:51

libvlc_instance_t *pVLCInstance = libvlc_new (0, NULL);
should work.
If it's not the case, you'll need to look at the logs.
Again, where is the log? How do I set the log up?

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: libvlc_new instance creation problem

Postby Sébastien Escudier » 28 Oct 2010 17:55

In your console.
If not I can't help you because I don't know windows.

qt123
New Cone
New Cone
Posts: 5
Joined: 27 Oct 2010 21:25

Re: libvlc_new instance creation problem

Postby qt123 » 29 Oct 2010 16:56

Is there another way to check error status from the libvlc API without the log, something similar to errorno, or exception used to older version of libvlc?

libvlc_instance_t *vlcInstance = libvlc_new( 0, NULL );
should be the first line of libvlc codes before anything else, right?

hussam_2000
Blank Cone
Blank Cone
Posts: 65
Joined: 03 Aug 2010 21:03

Re: libvlc_new instance creation problem

Postby hussam_2000 » 08 Nov 2010 17:16

yes it should be the first line of code. i had the same problem as you but i got it fixed by putting the libvlc.lib , libvlc.dll,libvlccore.dll in by Debug folder and then point to the path of the libvlc.lib in my project properties . Also make sure you are pointing to all the other folders that VLC needs in order for it to launch.

Folders:
vlc-1.1.4\ ( main folder that contains everthing )
sdk\include\vlc\
sdk\include\vlc\plugins
sdk\lib
sdk\lib\pkgconfig

I had it working with VS2008 MFC C++ to decode an H.264 stream via UDP.

Tamaya
New Cone
New Cone
Posts: 1
Joined: 19 Sep 2011 17:28

Re: libvlc_new instance creation problem

Postby Tamaya » 19 Sep 2011 17:44

Hi all,

Sorry for digging out this topic, but I have exactly the same problem : the libvlc_new returns me a NULL pointer...
I tried to copy the libvlc.lib libvlc.dll and libvlccore.ddl on my Debug folder, but nothing changed : NULL pointer...

I was wondering if it's possible that the problem come from using the VLC lib on an x64 architecture ? I'm using Windows 7 Pro and VLC sdk 1.1.11

An other question that could help me to find a way to solve this problem: what does that change to put the lib/dll in the Debug folder (I mean instead of putting the containing folder in the bin path ?)

Thanks in advance for potential help !

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

Re: libvlc_new instance creation problem

Postby mangokm40 » 19 Sep 2011 20:04

Have you looked at the log? Any error messages?

nefster
New Cone
New Cone
Posts: 1
Joined: 07 Dec 2012 12:22

Re: libvlc_new instance creation problem

Postby nefster » 07 Dec 2012 13:09

HI I also have the similar, i am working mac using xcode trying to run sample vlc program for vlc 2.0.1. But when i am trying to create libvlc instance by
minst=libvlc_new(0,NULL);
its returning NULL. in the logs error message says [ main libvlc error : No Plugins found ] since from 2.0 --plugin-path option is also removed what should i do???
I tried to put plugins folder under current project directory but still the same error without any change. Anybody has any idea how to solve that.

regards,
nefster


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 13 guests