sout option in nVLC

1.3k views Asked by At

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.

1

There are 1 answers

1
BufferUnderRun On BEST ANSWER

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.