我能够通过C# Winform应用程序在Windows7 64位计算机上流式传输rtsp。这是我使用的库- VLCDotNet,以下是播放RTSP流的代码示例:
LocationMedia media = new LocationMedia(@"rtsp://192.168.137.73:554/live.sdp");
vlcControl1.Media = media;
vlcControl1.Play();我想存储流到一个文件在我的电脑上的一个按钮点击和停止与另一个按钮相同。我该如何实现这一点?
发布于 2012-10-26 02:50:28
代码如下:
Vlc.DotNet.Core.Medias.MediaBase media1
= new Vlc.DotNet.Core.Medias.PathMedia("rtsp://192.168.137.73:554/live.sdp");
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}");
VlcControl control = new VlcControl();
control.Media = media;
control.Play();发布于 2015-01-08 03:02:16
VlcContext.StartupOptions.IgnoreConfig = true;
VlcContext.StartupOptions.LogOptions.LogInFile = true;
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = true;
VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.Debug;
// Disable showing the movie file name as an overlay
// VlcContext.StartupOptions.AddOption("--no-video-title-show");
// VlcContext.StartupOptions.AddOption("--no-audio");
VlcContext.StartupOptions.AddOption("--rtsp-tcp"); //this line was important to make this work发布于 2015-12-24 22:11:27
从Vlc.DotNet.Core 2.1.62开始,这样做的方法是在vlc控件上使用.Play的额外opts参数。
var opts = new string[] { @":sout=file/ogg:C:\video.ogg" };
vlc.MediaPlayer.Play(new Uri(videoURI), opts);`
https://stackoverflow.com/questions/13071652
复制相似问题