VlcControl无法正常流式传输

时间:2013-10-08 07:41:16

标签: c# .net streaming vlc

我正在使用VlcDotNet来播放视频,最近我遇到了一个奇怪的问题。当我使用VLC播放器从我的webcamera流式传输视频时,我可以完美地观看它。但是当我尝试使用VlcControl对其进行流式处理时,我得到一个错误,即VLC无法连接到源。我在VLC和VlcControl中使用相同的选项:

  

:SOUT =#转码{了vcodec = H264,VB = 0,标度= 0,acodec = MPGA,AB = 128,信道= 2,采样率= 44100}:HTTP {MUX = FFMPEG {MUX = FLV},DST =:10177 /}:sout-keep

也许我错过了什么,请查看我的代码:

if (Environment.Is64BitOperatingSystem)
{
    VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
    VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;
}
else
{
    VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_X86;
    VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_X86;
}

//Set the startup options
VlcContext.StartupOptions.IgnoreConfig = true;
VlcContext.StartupOptions.LogOptions.LogInFile = true;
VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = false;
VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.None;

VlcContext.CloseAll();
VlcContext.Initialize();

VlcControl player = new VlcControl();
var media = new LocationMedia("dshow://");

media.AddOption(":sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mpga,ab=128,channels=2,samplerate=44100}:http{mux=ffmpeg{mux=flv},dst=:10177/} :sout-keep");
player.Media = media;
player.Play();

Console.WriteLine("Translation started...");
Console.ReadLine();

1 个答案:

答案 0 :(得分:0)

我认为 Vlc 无法连接到您的网络摄像头,因为您没有将其传递给相机的名称 我试过了,我得到了

 :dshow-vdev=USB2.0 Camera :dshow-adev=  :live-caching=300

尝试另一种方法,但请务必更改相机名称 PS。当您打开打开捕获设备 - >时,您可以找到此选项勾选显示更多选项
我认为这将解决您的问题:)