Open Bug 1647676 Opened 6 years ago Updated 6 years ago

WebRTC unable to use webcam on Linux at 60fps

Categories

(Core :: WebRTC, defect, P5)

79 Branch
defect

Tracking

()

People

(Reporter: t.moll, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

Test machine running Debian unstable with Logitech Streamcam attached.

  1. Navigate to: https://webrtc.github.io/samples/src/content/peerconnection/constraints/

  2. Set constraints of horizontal resolution to 1920 and vertical to 1080

  3. Set FPS constraints between 31-60 inclusive.

  4. Click Get media

Actual results:

An error dialogue box appeared with the message:

getUserMedia error: OverconstrainedError
PermissionDeniedError may mean invalid constraints

Expected results:

The webcam should have been used with the set framerate as the webcam supports 1080p at 60 fps.

Using the same constraints in chromium works correctly. FPS verified using v4l2-ctl to access camera data.

With FPS set to 30 or below firefox is able to access the camera correctly.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → WebRTC
Product: Firefox → Core

Thanks for the bug report. Yes, the maxFPS is hard-coded here: https://searchfox.org/mozilla-central/rev/46e3b1ce2cc120a188f6940b5c6eab6b24530e4f/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc#244. The same code still exists in upstream libwebrtc.

Chromium doesn't use the video capture code in libwebrtc, so is not affected. Here is the Chromium code: https://source.chromium.org/chromium/chromium/src/+/master:media/capture/video/linux/video_capture_device_factory_linux.cc;l=290

We can probably do something similar and then upstream the changes to libwebrtc.

Assignee: nobody → dminor
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P1
Summary: WebRTC unable to use webcam at 60fps → WebRTC unable to use webcam on Linux at 60fps

After spending some time looking at this this morning, I think for this constraint to be really useful, we'd want to change the API to return a vector of supported frame rates instead of just the maximum frame rate. Something like that would have to land upstream first and then be backported to Firefox.

Assignee: dminor → nobody
Priority: P1 → P5
You need to log in before you can comment on or make changes to this bug.