无法在C#中使用VLC播放器播放RTSP流视频 [英] not able to play RTSP stream video using VLC player in C#
问题描述
我正在尝试使用C#中的VLC播放视频。
代码如下,>
private void ButtonPlayVideo(对象发送者,RoutedEventArgs e)
{
Vlc.DotNet.Core.Medias.MediaBase media
= new Vlc.DotNet.Core.Medias.LocationMedia(rtsp:// IP地址:8554 / live.ts);
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:\\Videos \\Demo.mp4});
myVlcControl .Media = media;
myVlcControl.Play();
}
当我使用相同的地址播放此视频时,直接来自VLC(使用选项Open Network Stream),它成功运行。但是当我尝试使用c#代码时,它没有运行。另外,我的VLC日志显示所有缓冲都已完成。
什么时候出错。请帮忙吗?
提前致谢。
Hi,
I am trying to play a video using VLC in C#.
The code is as below,
private void ButtonPlayVideo(object sender, RoutedEventArgs e)
{
Vlc.DotNet.Core.Medias.MediaBase media
= new Vlc.DotNet.Core.Medias.LocationMedia("rtsp://IP address:8554/live.ts");
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:\\Videos\\Demo.mp4}");
myVlcControl.Media = media;
myVlcControl.Play();
}
When I play this video with the same address , directly from VLC (using option Open Network Stream) it runs successfully. But when I try to play from c# code , its not running. Also ,my VLC log is showing all buffering is complete.
Whats going wrong.Please help?
Thanks in advance.
推荐答案
添加如下身份验证:
Add authentication like this:
rtsp://richard:myPassword@[camera-address]
这篇关于无法在C#中使用VLC播放器播放RTSP流视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!