Skip to content
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

Missing MediaTrack Settings #208

Open
Joe-Palmer opened this issue May 16, 2019 · 4 comments
Open

Missing MediaTrack Settings #208

Joe-Palmer opened this issue May 16, 2019 · 4 comments

Comments

@Joe-Palmer
Copy link

I'd like to understand which MediaTrack Settings are missing due to hardware limitations and which simply haven't been implemented yet.

I am particularly interested in brightness which I see is only available on Linux/ChromeOS. Will this ever be available on Android or Windows/Mac?

Also, none of the other settings are available on Mac. I assumed this may be a hardware restriction but this app claims to be able to control these settings at the hardware level:

https://itunes.apple.com/us/app/webcam-settings/id533696630?mt=12

Is it possible for any of these settings to be controlled on a Mac?

Thanks

@riju
Copy link
Collaborator

riju commented May 16, 2019

I'd like to understand which MediaTrack Settings are missing due to hardware limitations and which simply haven't been implemented yet.

We can implement the settings which are available on the platform if web developers find them useful.
Usually we expose properties which are supported by most major platforms, but there can be some exceptions like Pan/Tilt (not on Android, but present on Linux/CrOS/Win)
Let us know if there's something on native platforms which you want (use-cases) and we can definitely evaluate if it makes sense for the Web.

I am particularly interested in brightness which I see is only available on Linux/ChromeOS. Will this ever be available on Android or Windows/Mac?

I can look into Android and Windows implementation.
Will exposure time help for the time being ?
If yes, Chrome 72+ has it, and Windows patch is in flight, so soon-ish

Also, none of the other settings are available on Mac. I assumed this may be a hardware restriction but this app claims to be able to control these settings at the hardware level:

https://itunes.apple.com/us/app/webcam-settings/id533696630?mt=12

Is it possible for any of these settings to be controlled on a Mac?

Somebody has to implement them to find out :)

Thanks

@Joe-Palmer
Copy link
Author

Thanks very much for your reply :)

What I am trying to do is build a light meter which can measure the ambient brightness (in lux) of what the camera is pointing at. I know that there is an API in Chrome to access to the ambient light sensor but this is only available behind a flag, measure the environment in general and not all devices have the sensor, so I would like to do it with the camera.

It is possible to calculate the ambient brightness by using the information from the camera as there are several app in the App Store and Google Play that do this. The theory is that when the camera produces a well exposed image, it is possible to calculate the ambient lux of what is in the field of view from the camera settings as this is effectively what the camera has done to produce a good exposure. So ideally I would let the camera auto expose and then read the values to calculate the ambient brightness. But from my experiments, it appears that I can only set the values, not read them. Is that correct? It would be very nice if we could read them while the camera was automatically exposing.

If I can only set the values, then it is still possible. I would need to build a system to analysis the image and adjust the values until the image was correctly exposed. I would then know the values to be able to calculate the lux.

So, on to the lux calculation. Here is some useful background on what I am trying to do:

https://www.conservationphysics.org/lightmtr/luxmtr1.html

Ideally I would like to get the following settings from the camera to help with my calculations:

  • F number
  • Aperture value
  • Focal length
  • ISO
  • Exposure time
  • Brightness

I may be able to get something working with less than all of these but it looks like the F number is critical to any calculation. This is usually in the EXIF of a photo. Is there any way to get this Media Stream Image Capture API? Maybe by reading the EXIF after calling takePhoto()?

Thanks for any help you can give :)

@Joe-Palmer
Copy link
Author

I have been doing some more work on this. The key value I need is the F number which doesn't seem to be accessible anywhere. I was hoping that there would be EXIF data in the image produced when calling takePhoto but there is none. Here is what I get when I take a photo using the built-in camera app:

image

But the EXIF data is completely missing when I takePhoto using the Image​ Capture​ API. Would it be possible to add this information to the EXIF data? Or is there any other way I can get it?

The key issue for me is that I want to read settings from the camera rather then set them. Do you think this would ever be possible using the MediaCapture APIs?

Thanks in advance

@LviJohannes
Copy link

I'm very interested in seeing brightness exposed on other platforms. Has any work been done investigating this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants