简体   繁体   English

使用vlc.dotnet播放流cam

[英]play stream cam with vlc.dotnet

I have VLC 2.1.3 and use Logitech HD Pro Webcam C920. 我有VLC 2.1.3,并使用Logitech HD Pro网络摄像头C920。

I tried play stream with RTSP but cannot work. 我尝试使用RTSP播放流,但无法正常工作。 I get information about "failed to open/read to DVD". 我得到有关“无法打开/读取DVD”的信息。 This code is right? 这个代码对吗? What change in this code? 这段代码有什么变化?

Vlc.DotNet.Core.Medias.MediaBase media = new Vlc.DotNet.Core.Medias.PathMedia("dshow:// :dshow-vdev=\"Logitech HD Pro Webcam C920\"");

media.AddOption(":sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:duplicate{dst=rtp{sdp=rtp://:8554/stream}:sout-all :sout-keep");
VlcControl control = new VlcControl();
control.Media = media;
control.Play();
        VlcControl vlc = new VlcControl();
        //LocationMedia media = new LocationMedia(@"C:\Users\pgu001\Downloads\Storage_Shipping_Container_Tilt_Bed_Trailer_Delive.avi");

        //Vlc.DotNet.Core.Medias.MediaBase media1 = new Vlc.DotNet.Core.Medias.PathMedia("rtsp://admin:admin@172.16.22.61:554/live.");
        //media.AddOption(":sout=#transcode{vcodec=theo,vb=800,scale=1,acodec=flac,ab=128,channels=2,samplerate=44100}:std{access=file,mux=ogg,dst=D:\\123.mp4}");
        panel1.Controls.Add(vlc);
        vlc.BackColor = System.Drawing.Color.Black;
        vlc.ImeMode = System.Windows.Forms.ImeMode.NoControl;
        vlc.Location = new System.Drawing.Point(0, 0);
        vlc.Name = "test";
        vlc.Rate = 0.0F;

        vlc.Size = new System.Drawing.Size(panel1.Width, panel1.Height);

        //Vlc.DotNet.Core.Medias.MediaBase media = new Vlc.DotNet.Core.Medias.PathMedia(@"rtsp://172.16.22.61:554/live.sdp");
        LocationMedia media = new LocationMedia(@"rtsp://172.16.22.61:554/live");
        vlc.Media = media;
        vlc.Play();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM