Comments (7)
刚才又看了下 获取的图像大小也与设置的 Characteristic 不一致
设置的是 1 FPS 320x240 的 JPEG Characteristic
实际获取到的是 25 FPS 640x480 的图像
private static async void Start(int selectCameraIndex,int selectCharacteristicsIndex)
{
var devices = new CaptureDevices();
var descriptor0 = devices.EnumerateDescriptors().ElementAt(selectCameraIndex);
bool checkSize = false;
Console.WriteLine($"Selected camera :{descriptor0.Name} Characteristic:{descriptor0.Characteristics[selectCharacteristicsIndex]}");
using var device = await descriptor0.OpenAsync(
descriptor0.Characteristics[selectCharacteristicsIndex],
bufferScope =>
{
if(!checkSize)
{
checkSize = true;
byte[] image = bufferScope.Buffer.ExtractImage();
var ms = new MemoryStream(image);
var bitmap = Bitmap.FromStream(ms);
Console.WriteLine($"Size:{bitmap.Size}");
bitmap.Dispose();
}
Console.WriteLine($"Timestamp:{bufferScope.Buffer.Timestamp} FrameIndex:{bufferScope.Buffer.FrameIndex}");
});
// Start processing:
await device.StartAsync();
Console.ReadKey();
await device.StopAsync();
}
from flashcap.
@yangjieshao I have added a function to the Avalonia sample code to display actual FPS measurements, so please try it out in your environment. It may be possible that the camera device you are using is returning lied information.
The following example is for a device I have. "FPS=nnn/mmm" is the actual value, the first value is able to reach the callback delegate, and the second value is able to reach the FlashCap internals. A smaller difference indicates a smaller of frame drops that can be recognized.
- There is a possibility that there are other frame drops that are not recognized by FlashCap.
- The following tests were done on Windows because Windows was the only environment available for testing right just now. Therefore, it is possible that there may be a problem with V4L2...
Logicool Webcam C930e
The characteristics on this camera seems accurate.
1920x1080 JPEG 30fps
1920x1080 YUYV 5fps
HD Webcam eMeet C970L
The low FPS characteristics are very suspicious.
1920x1080 JPEG 30fps
1920x1080 JPEG 1fps
Cam Link 4K
FHD/60fps.
from flashcap.
In 55bb174, add SKBitmap statistics. Logicool camera is valid.
from flashcap.
eMeet C970L 1fps is returned SKBitmap: 640x480
from flashcap.
thanks
I will buy a new camera for testing
The camera used before is a cheap camera with a price of more than 10 RMB. It may indeed return false information
from flashcap.
Note: I imagine, looking at another existing applications, that sometimes 1fps and/or 5fps are not present in the choices in the selection list, so these may have been excluded from the list as an apparently unusual characteristic by these application.
from flashcap.
@yangjieshao If it was obviously strange, please reopen it 😄
from flashcap.
Related Issues (20)
- Added ShowPropertyPage method to DirectShowDevice class HOT 1
- Need support with Avalonia Sample HOT 9
- Is there any way to set camera parameters like white balance, exposure on linux? HOT 1
- Blue screen error without stopping HOT 1
- Capture Error event handler HOT 1
- SET the power line frequency property HOT 1
- After running StartAsync() on linux, executing StopAsync() and then StartAsync(), pixelBufferArrived will not be executed again. HOT 4
- VideoCharacteristics not detected HOT 17
- Typo in Linux device enumeration HOT 3
- Reversed logic when enumerating Linux device capabilities HOT 3
- 执行OpenAsync时发生异常 HOT 1
- Elgato CamLink 4K DirectShow Pixel Format HOT 4
- Capture works first time on Linux, but not subsequent times HOT 4
- How to do shrink memory when capturing from WebCam to WPF HOT 2
- Avalonia aot 启动失败
- Is there a camera snapshot event handler? HOT 1
- AutoPixelBufferScope set PixelBuffer to null, cause allocate new PixelBuffer for every frame HOT 3
- Possible leaks in AsyncLock HOT 1
- Desktop Screen Capture Support HOT 1
- Support for camera module/ CSIconnector on Pi Zero 2W HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flashcap.