Page 1 of 1

how to choose the capture device in libvlc?[SOLVED]

Posted: 19 Mar 2012 02:22
by freesunshine
now i can stream the cam to a file with code below
inst=libvlc_new(0,null);
m=libvlc_media_new_path(inst,"dshow://");
libvlc_media_add_option(m,":sout=#transcode{vcode=h264} :duplicate{dst={access=file,mux=ts,dst=c:\\file.ts}}");
mp=libvlc_media_player_new_from_media(m);
libvlc_media_player_play(mp);

but it always open the first cam.how can i choose the second device?i can do this with ":dshow-vdev="usb camera2"" in commandline but it does not work in libvlc

Re: how to choose the capture device in libvlc?

Posted: 19 Mar 2012 17:51
by freesunshine
Someone please help!

Re: how to choose the capture device in libvlc?

Posted: 19 Mar 2012 18:09
by freesunshine
solved.
libvlc_media_add_option(m,":dshow-vdev=usb camera2");