Storing RTSP to a file location

百般思念 提交于 2019-11-30 20:56:40

Here is the code:

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

As of Vlc.DotNet.Core 2.1.62, The way to do this is use the extra opts param of the .Play on the vlc control.

var opts = new string[] { @":sout=file/ogg:C:\video.ogg" };
vlc.MediaPlayer.Play(new Uri(videoURI), opts);

`

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!