Page 1 of 1
libvlc_new instance creation problem
Posted: 27 Oct 2010 21:32
by qt123
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.
Re: libvlc_new instance creation problem
Posted: 28 Oct 2010 08:43
by Sébastien Escudier
you should look at the logs when you run your program.
Maybe vlc can't find any modules.
Re: libvlc_new instance creation problem
Posted: 28 Oct 2010 14:46
by qt123
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.
Re: libvlc_new instance creation problem
Posted: 28 Oct 2010 15:22
by Sébastien Escudier
I don't know about windows. Maybe you can run your program from a console ?
Re: libvlc_new instance creation problem
Posted: 28 Oct 2010 15:40
by qt123
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.
Re: libvlc_new instance creation problem
Posted: 28 Oct 2010 16:11
by Sébastien Escudier
libvlc_instance_t *pVLCInstance = libvlc_new (0, NULL);
should work.
If it's not the case, you'll need to look at the logs.
Re: libvlc_new instance creation problem
Posted: 28 Oct 2010 17:51
by qt123
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?
Re: libvlc_new instance creation problem
Posted: 28 Oct 2010 17:55
by Sébastien Escudier
In your console.
If not I can't help you because I don't know windows.
Re: libvlc_new instance creation problem
Posted: 29 Oct 2010 16:56
by qt123
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?
Re: libvlc_new instance creation problem
Posted: 08 Nov 2010 17:16
by hussam_2000
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.
Re: libvlc_new instance creation problem
Posted: 19 Sep 2011 17:44
by Tamaya
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 !
Re: libvlc_new instance creation problem
Posted: 19 Sep 2011 20:04
by mangokm40
Have you looked at the log? Any error messages?
Re: libvlc_new instance creation problem
Posted: 07 Dec 2012 13:09
by nefster
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