-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VideoCharacteristics not detected #125
Comments
Thanks for reached out! If FlashCap is the latest, |
I tried code below on my second computer: using FlashCap;
using SkiaSharp;
var devices = new CaptureDevices();
var descriptor0 = devices.EnumerateDescriptors().ElementAt(0);
byte[] imageData = await descriptor0.TakeOneShotAsync(descriptor0.Characteristics.FirstOrDefault());
using (var ms = new MemoryStream(imageData))
{
SKBitmap bitmap = SKBitmap.Decode(ms);
SKFileWStream fs = new("photo.png");
bitmap.Encode(fs, SKEncodedImageFormat.Png, quality: 100);
} Other cam: OS: Detected and works perfectly, but in my laptop same situation |
I dont have other cameras on this device, because it's laptop. |
Oh, sorry if it doesn't make sense, I made a mistake in the translation program 😵💫 |
Hello @kekyo. I am building |
here is my decriptors info |
@SignalMQ Sorry later, I am interested in what characteristics are enumerated in your camera. The following sections: return (CaptureDeviceDescriptor)new V4L2DeviceDescriptor(
devicePath, ToString(caps.card), $"{ToString(caps.bus_info)}: {ToString(caps.driver)}",
EnumerateFormatDesc(fd).
SelectMany(fmtdesc =>
EnumerateFrameSize(fd, fmtdesc.pixelformat).
SelectMany(frmsize =>
EnumerateFramesPerSecond(fd, fmtdesc.pixelformat, frmsize.Width, frmsize.Height).
Collect(framesPerSecond =>
NativeMethods_V4L2.CreateVideoCharacteristics(
fmtdesc.pixelformat, frmsize.Width, frmsize.Height,
framesPerSecond.Value, ToString(fmtdesc.description),
frmsize.IsDiscrete && framesPerSecond.IsDiscrete)))).
Distinct().
OrderByDescending(vc => vc).
ToArray()); Here, if a series of This line is written on a single line, so it may be difficult to verify. For example: var a = EnumerateFormatDesc(fd).ToArray();
var b = a.SelectMany(fmtdesc =>
{
var c = EnumerateFrameSize(fd, fmtdesc.pixelformat).ToArray();
var d = c.SelectMany(frmsize =>
{
// ...
});
// ...
}); to change the enumeration so that you can check the enumeration and be sure of it on the debugger. |
@kekyo I'm tried to detect my device with Here it seemed strange to me that the devices are listed in reverse order ([/dev/video1, /dev/video0]), or I’m wrong. |
I was surprised too! I'm not sure why there are multiple FlashCap/FlashCap.Core/Devices/V4L2Devices.cs Line 171 in 854186a
If you select |
|
According to the screenshot, Are you saying that you used the value of |
|
I see. As a coping remedy, it seems that we need to ignore devices with zero characteristics. We could ignore devices with zero characteristics when internal FlashCap enumerates them, but I imagine that would probably make it difficult to identify the problem. if (devices.EnumerateDescriptors().
FirstOrDefault(d => d.Characteristics.Any(c => c.PixelFormat != PixelFormats.Unknown)) is { } device)
{
// `device` is valid.
} |
My problem solved, I use my second device. |
@SignalMQ The next version will support NV12 format. Perhaps devices that were not enumerated (or were Unknown) will become available, so if you are interested, please give it a try. |
Hello everyone!👋👋👋
I used an example from the project description. I haven't decided on the characteristics for the video.
My software and hardware information
Aditional Context
The text was updated successfully, but these errors were encountered: