Giter Site home page Giter Site logo

Comments (7)

yangjieshao avatar yangjieshao commented on May 24, 2024

1672222189956
刚才又看了下 获取的图像大小也与设置的 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.

kekyo avatar kekyo commented on May 24, 2024

@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.

#31 f3e4f14

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

image

1920x1080 YUYV 5fps

image

HD Webcam eMeet C970L

The low FPS characteristics are very suspicious.

1920x1080 JPEG 30fps

image

1920x1080 JPEG 1fps

image

Cam Link 4K

FHD/60fps.

image

from flashcap.

kekyo avatar kekyo commented on May 24, 2024

In 55bb174, add SKBitmap statistics. Logicool camera is valid.

image

from flashcap.

kekyo avatar kekyo commented on May 24, 2024

eMeet C970L 1fps is returned SKBitmap: 640x480

image

from flashcap.

yangjieshao avatar yangjieshao commented on May 24, 2024

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.

kekyo avatar kekyo commented on May 24, 2024

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.

kekyo avatar kekyo commented on May 24, 2024

@yangjieshao If it was obviously strange, please reopen it 😄

from flashcap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.