LibVlcSharp select only default webcam
I have to record selected webcam to file but i get video from default webcam (no matter which i describe in media option)
When i use VlcPlayer to record any of existing camera i get proper camera, but when try do the same from my application i get video from default webcam. What i do wrong ?
parameters from VlcPlayer: :dshow-vdev=Logitech StreamCam :dshow-adev= :live-caching=100
my app code:
Core.Initialize();
using var libVLC = new LibVLC(enableDebugLogs: true);
using var media = new Media(libVLC, "dshow://",FromType.FromLocation);
using var mediaPlayer = new MediaPlayer(libVLC);
// :dshow-vdev=Logitech StreamCam :dshow-adev= :live-caching=100 - copied from VlcVideoPlayer
media.AddOption(" :dshow-vdev=Logitech StreamCam :dshow-adev= :live-caching=100");
// i also try this format without success
// media.AddOption(" :dshow-vdev=\"Logitech StreamCam\" :dshow-adev=none :live-caching=100");
// media.AddOption(" :dshow-vdev='Logitech StreamCam' :dshow-adev=none :live-caching=100");
// media.AddOption(" :dshow-vdev=Integrated Camera :dshow-adev=none :live-caching=100");
media.AddOption(":sout=#duplicate{dst=display,dst=transcode{vcodec=mp4v,acodec=mpga,vb=800,ab = 128,deinterlace},dst=std{access=file,mux=asf,dst=xyz.mp4}}");
mediaPlayer.Play(media);
System.Threading.Thread.Sleep(10000);
mediaPlayer.Stop();
The second question - recorded file is very large (2 GB per 10 seconds), how to set transcoding to get it compressed but good quality ?
the question was sent to stack overflow few days ago but I get no reply
What is the current bug behavior?
every time when I start recording webcam. the default webcam is selected even if I set another device
i.e. : :dshow-vdev=Logitech StreamCam
What is the expected correct behavior?
there should be captured vide from Logitech webcam instead default i.e. Integrated Camera
Does it work on other plaforms? Does it work with the official VLC apps?
Working with parameters from VlcPlayer: :dshow-vdev=Logitech StreamCam :dshow-adev= :live-caching=100
Environment
- OS: Windows 11
- Version [e.g. 22]
- Device: pc amd
- LibVLC version and architecture [e.g. 3.7, x64]
- LibVLCSharp version 3.0.18