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