getUserMedia API in Chrome vs. OS X CoreMedia I/O webcam

173 views
Skip to first unread message

Dmitriy Kravchenko

unread,
Jun 17, 2016, 12:09:50 AM6/17/16
to discuss-webrtc
Hi!

I'm working on a virtual webcam project on Mac OS X, which uses a CoreMedia I/O plugin to emulate webcam. The plugin is based on the Apple-provided sample: http://developer.apple.com/library/mac/samplecode/CoreMediaIO/Introduction/Intro.html
Now the problem is that when using WebRTC in Chrome our webcam is visible in the list of webcams but it doesn't produce any images when used. I tried both our webcam and webcam from Apple sample - behaviour is the same. At the same time it works with WebRTC in Firefox, so I think there maybe some kind of compatibility problem between CoreMedia I/O plugins and Chrome.
I'm trying to debug this issue, but nothing wrong can be seen from inside of our plugin - all frames are passed to the application correctly, it just doesn't display them. I used https://test.webrtc.org/ site to test webcam and the results are rather weird:

Here's an output with Apple Sample webcam in Chrome 52.0.2743.41 beta (64-bit):

Camera
Check resolution 320x240
[ WARN ] Your camera reported itself as muted.
[ INFO ] cameraName: Sample
[ INFO ] actualVideoWidth: 2
[ INFO ] actualVideoHeight: 2
[ INFO ] mandatoryWidth: 320
[ INFO ] mandatoryHeight: 240
[ INFO ] isMuted: true
[ INFO ] testedFrames: 1
[ INFO ] blackFrames: 1
[ INFO ] frozenFrames: 0
[ INFO ] Not available: encodeSetupTimeMs, avgEncodeTimeMs, minEncodeTimeMs, maxEncodeTimeMs, avgInputFps, minInputFps, maxInputFps, avgSentFps, minSentFps, maxSentFps
[ INFO ] Cannot verify sent FPS.
[ FAILED ] Incorrect captured resolution.
[ FAILED ] Camera delivering lots of black frames.
Check resolution 640x480
[ WARN ] Your camera reported itself as muted.
[ INFO ] cameraName: Sample
[ INFO ] actualVideoWidth: 2
[ INFO ] actualVideoHeight: 2
[ INFO ] mandatoryWidth: 640
[ INFO ] mandatoryHeight: 480
[ INFO ] isMuted: true
[ INFO ] testedFrames: 1
[ INFO ] blackFrames: 1
[ INFO ] frozenFrames: 0
[ INFO ] Not available: encodeSetupTimeMs, avgEncodeTimeMs, minEncodeTimeMs, maxEncodeTimeMs, avgInputFps, minInputFps, maxInputFps, avgSentFps, minSentFps, maxSentFps
[ INFO ] Cannot verify sent FPS.
...

Note the bizarre value '2' for actualVideoWidth/actualVideoHeight, true for isMuted and that only 1 test frame was received while many frames were actually passed by plugin.

Output with our webcam is exactly the same, only cameraName line looks as follows:
[ INFO ] cameraName: ManyCam Virtual Webcam

Here's an output of our webcam in Firefox (where it works):

Camera
Check resolution 320x240
[ INFO ] actualVideoWidth: 320
[ INFO ] actualVideoHeight: 240
[ INFO ] mandatoryWidth: 320
[ INFO ] mandatoryHeight: 240
[ INFO ] isMuted: false
[ INFO ] testedFrames: 295
[ INFO ] blackFrames: 0
[ INFO ] frozenFrames: 0
[ INFO ] Not available: cameraName, encodeSetupTimeMs, avgEncodeTimeMs, minEncodeTimeMs, maxEncodeTimeMs, avgInputFps, minInputFps, maxInputFps, avgSentFps, minSentFps, maxSentFps
[ INFO ] Cannot verify sent FPS.
[ OK ] Captured video using expected resolution.
Check resolution 640x480
[ INFO ] actualVideoWidth: 640
[ INFO ] actualVideoHeight: 480
[ INFO ] mandatoryWidth: 640
[ INFO ] mandatoryHeight: 480
[ INFO ] isMuted: false
[ INFO ] testedFrames: 168
[ INFO ] blackFrames: 0
[ INFO ] frozenFrames: 0
[ INFO ] Not available: cameraName, encodeSetupTimeMs, avgEncodeTimeMs, minEncodeTimeMs, maxEncodeTimeMs, avgInputFps, minInputFps, maxInputFps, avgSentFps, minSentFps, maxSentFps
[ INFO ] Cannot verify sent FPS.
[ OK ] Captured video using expected resolution.
...

So I have at least 2 questions:
1) Which OS X API does Chromium use to work with webcams when getUserMedia API is invoked? It would be nice if you could point me to the corresponding place in Chromium/WebRTC sources (I found it very difficult to find on my own).
2) In test.webrtc.org output: from where Chromium takes the values of the following webcam properties: actualVideoWidth, actualVideoHeight and isMuted?

It would help me to debug the problem further.

Thanks in advance for your attention!

Steven Tang

unread,
Jun 8, 2020, 3:02:27 AM6/8/20
to discuss-webrtc
Any solution for this? I have the same problem.

Thanks in advance!
Reply all
Reply to author
Forward
0 new messages