How to retrieve all the available VideoConfig of a device?
Closed this issue · 2 comments
geocine commented
When I am running the default code to connect to my camera I get System.InvalidOperationException: 'Cannot set videoConfig.'
geocine commented
I managed to figure it out using capabilities
// retrieve all supported format from device
var capabilities = device.Capabilities;
// filter valid capabilities and create a list of VideoConfig
var configs = capabilities.Where(cp => cp.MaxCy > 0 && cp.MaxCx > 0).Select(c => new VideoConfig()
{
Name = device.Name,
Path = device.Path,
UseDefaultConfig = false,
Cx = c.MaxCx,
CyAbs = c.MaxCy,
CyFlip = false,
FrameInterval = c.MaxInterval,
}).ToList();
charlescao460 commented
Yes, device.Capabilities
is the way you get a list of all available configs