用vlc.dotnet播放流凸轮

时间:2014-08-01 11:51:08

标签: c# h.264 vlc rtsp

我有VLC 2.1.3并使用Logitech HD Pro网络摄像头C920。

我尝试使用RTSP播放流但无法正常工作。我收到有关"无法打开/读取DVD"的信息。这段代码是对的?这段代码有什么变化?

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();

1 个答案:

答案 0 :(得分:-3)

        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();