0

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 ?

kashiash
  • 21
  • 4

0 Answers0