sout option in nVLC

心已入冬 提交于 2019-12-11 09:17:37

问题


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:


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.



来源:https://stackoverflow.com/questions/30931517/sout-option-in-nvlc

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