Page 1 of 1

problem with libvlc_media_new_path

Posted: 13 Apr 2015 14:04
by bird12358
Hello,

I have trouble with the deploiement of a example on my computer.

I use that code:

Code: Select all

m = libvlc_media_new_path(inst, "v4l2:///dev/video0"); /* Create a media player playing environement */ mp = libvlc_media_player_new_from_media (m); libvlc_media_player_play(mp);
When I launch the program on my first computer the video source works properly. But on my second computer I get that error:

Code: Select all

[0xae002948] filesystem access error: cannot open file /home/xxxxx/xxxx/v4l2:///dev/video0 (No such file or directory) [0xae002948] main access error: File reading failed [0xae002948] main access error: VLC could not open the file "/home/xxxxx/xxxx/v4l2:///dev/video0" (No such file or directory). [0x87d4d20] main input error: open of `file:///home/xxxxx/xxxx/%20%20%20v4l2%3A///dev/video0' failed [0x87d4d20] main input error: Your input can't be opened [0x87d4d20] main input error: VLC is unable to open the MRL 'file:///home//xxxxx/xxxx/%20%20%20v4l2%3A///dev/video0'. Check the log for details.
I don't understand why the program add "/home/xxxxx/xxxx/" before v4l2:///dev/video0 .

Can someone give me a hand?

Best regard.

Re: problem with libvlc_media_new_path

Posted: 13 Apr 2015 14:29
by RĂ©mi Denis-Courmont
Please read the LibVLC Doxygen.

Re: problem with libvlc_media_new_path

Posted: 14 Apr 2015 09:31
by bird12358
Thank you for the answer.

I looked at the documentation but I get:

Code: Select all

LIBVLC_API libvlc_media_t* libvlc_media_new_path ( libvlc_instance_t * p_instance, const char * path ) Create a media for a certain file path. See Also libvlc_media_release Parameters p_instance the instance path local filesystem path Returns the newly created media or NULL on error
path is the local filesystem path but I don't understand why on my firstcomputer where I compile the program the libvlc is well used but in the second computer the compiled program works wong?

Re: problem with libvlc_media_new_path

Posted: 14 Apr 2015 23:48
by Jean-Baptiste Kempf
v4l2:///dev/video0 is not a path, but a MRL.

Re: problem with libvlc_media_new_path

Posted: 16 Apr 2015 09:10
by bird12358
Thank you for the answer but I still dont understand why a path is added before v4l2:///dev/video0 ?

Re: problem with libvlc_media_new_path

Posted: 20 Apr 2015 21:37
by Jean-Baptiste Kempf
Because you called libvlc_media_new_path and not libvlc_media_new_location