Reputation: 538
I am trying to record a stream using nVLC in my C# application. nVLC is essentially a C# wrapper around libvlc.
Is the sout option supported in libvlc? Below is my C# code but it does not save the file.
Here's my code:
`m_media = m_factory.CreateMedia<IMedia>("rtsp://<url>");
List<string> mediaOptions = new List<string>();
mediaOptions.Add(@"sout=""#std{access=file,mux=ts,dst=C:\Users\hp\CCTV\Videos\\video.mpg}""");
m_media.AddOptions(mediaOptions);
m_player.Open(m_media);
m_media.Parse(true);`
m_player.Play(); `
Many thanks.
Upvotes: 1
Views: 1339
Reputation: 161
The sout option is supported by nVLC (it works for me).
I think the sout format you provide is incorrect, try :
m_media = m_factory.CreateMedia<IMedia>("rtsp://<url>");
var filename = @"c:\Users\hp\CCTV\Videos\video.mpg";
m_media.AddOptions(
new List<string>() {
"sout=#std{access=file,dst="+filename+"}"
});
m_player.Open(m_media);
m_media.Parse(true);`
m_player.Play();
With this example, the rstp stream is only saved in a file. If you want to view the video on the panel at the same time, you have to use the duplicate
option.
Upvotes: 1