- получите какой-нибудь путь или mrl и воспроизведите его
- получите поток и воспроизведите его
Получение имени камеры через DirectShowLib и
Код: Выделить всё
DsDevice[] cams = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
string webcam = "";
DsDevice[] cams = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
foreach (DsDevice cam in cams)
{
if (cam.Name.ToLower().Contains("camera"))
webcam = $"dshow:// :dshow-vdev=\"{cam.Name}\"";
Console.WriteLine($"\n{cam.Name}");
}
Console.WriteLine('\n' + webcam + '\n');
Выполнив vlcControl.Log += (sender, args) => Console.WriteLine(args.Message); я получаю несколько журналов
Код: Выделить всё
Creating an input for 'dshow://'
using timeshift granularity of 50 MiB
using timeshift path: C:\Users\user\AppData\Local\Temp
`dshow:// :dshow-vdev="USB2.0 PC CAMERA"' gives access `dshow' demux `any' path ` :dshow-vdev="USB2.0 PC CAMERA"'
creating demux: access='dshow' demux='any' location=' :dshow-vdev="USB2.0 PC CAMERA"' file='(null)'
looking for access_demux module matching "dshow": 11 candidates
creating access: dshow:// :dshow-vdev="USB2.0 PC CAMERA"
looking for access module matching "dshow": 25 candidates
no access_demux modules matched
no access modules matched
VLC is unable to open the MRL 'dshow:// :dshow-vdev="USB2.0 PC CAMERA"'. Check the log for details.
Your input can't be opened
Подробнее здесь: https://stackoverflow.com/questions/793 ... ms-c-sharp
Мобильная версия