getUserMedia constraints for width/height not respected for Logitech, Inc. Webcam C270
Reported by
mgerdz...@gmail.com,
Sep 25 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Steps to reproduce the problem: using the demo https://webrtc.github.io/samples/src/content/peerconnection/constraints/ 1. Specifying constraints of min width: 600px 2. Or pick any constraints that should pick a resolution of 640x480 What is the expected behavior? Should get resolution of 640x480 What went wrong? Getting this: Video dimensions: 176x144px Looks like chrome thinks that 640x480 should be a valid resolution (which it is), but then picks the closest one to that resolution in the Raw yuyv422 space of the camera, not the Compressed mjpeg resolution where this is supported. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 61.0.3163.100 Channel: stable OS Version: Ubuntu 16.04 Flash Version: Shockwave Flash 27.0 r0 This used to work in the past, but not sure when it broke. FFMPEG reports the following for the camera: ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg version N-80283-g84efdab Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3) configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab libavutil 55. 24.100 / 55. 24.100 libavcodec 57. 46.100 / 57. 46.100 libavformat 57. 37.101 / 57. 37.101 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 46.101 / 6. 46.101 libavresample 3. 0. 0 / 3. 0. 0 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 [video4linux2,v4l2 @ 0x2c76d60] Raw : yuyv422 : YUYV 4:2:2 : 160x120 176x144 [video4linux2,v4l2 @ 0x2c76d60] Compressed: mjpeg : Motion-JPEG : 640x480 160x120 176x144 320x176 320x240 352x288 432x240 544x288 640x360 752x416 800x448 800x600 Chrome://media-internals reports this: [ { "captureApi": "V4L2 SPLANE", "formats": [ { "resolution": "160x120", "fps": "30.00", "storage": "CPU" }, { "resolution": "176x144", "fps": "30.00", "storage": "CPU" }, { "resolution": "320x176", "fps": "30.00", "storage": "CPU" }, { "resolution": "320x240", "fps": "30.00", "storage": "CPU" }, { "resolution": "352x288", "fps": "30.00", "storage": "CPU" }, { "resolution": "432x240", "fps": "30.00", "storage": "CPU" }, { "resolution": "544x288", "fps": "30.00", "storage": "CPU" }, { "resolution": "640x360", "fps": "30.00", "storage": "CPU" }, { "resolution": "640x480", "fps": "30.00", "storage": "CPU" }, { "resolution": "752x416", "fps": "15.00", "storage": "CPU" }, { "resolution": "800x448", "fps": "15.00", "storage": "CPU" }, { "resolution": "800x600", "fps": "15.00", "storage": "CPU" } ], "id": "/dev/video0", "name": "UVC Camera (046d:0825) (046d:0825)" } ] If selecting a minimum width of anything > 640 picks the next resolution from the supported ones, but anything less than 640 always picks 176x144 The camera works fine in other applications.
,
Sep 26 2017
chfremer@: Can you take a look at this? Maybe it's an issue similar to bug 750431, where Chrome requests the right settings and gets something else from the camera.
,
Sep 26 2017
,
Sep 29 2017
I just tried but failed to repro on my linux workstation, which runs Ubuntu 14.04, and a C270 I borrowed. On this configuration I get different output from ffmpeg and chrome://media-internals:
ffmpeg -f v4l2 -list_formats all -i /dev/video0
ffmpeg version N-87616-g792b1629a8 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration:
libavutil 55. 77.101 / 55. 77.101
libavcodec 57.106.104 / 57.106.104
libavformat 57. 82.102 / 57. 82.102
libavdevice 57. 9.101 / 57. 9.101
libavfilter 6.106.100 / 6.106.100
libswscale 4. 7.103 / 4. 7.103
libswresample 2. 8.100 / 2. 8.100
[video4linux2,v4l2 @ 0x1fc0380] Raw : yuyv422 : YUYV 4:2:2 : 640x480 160x120 176x144 320x176 320x240 352x288 432x240 544x288 640x360 752x416 800x448 800x600 864x480 960x544 960x720 1024x576 1184x656 1280x720 1280x960
[video4linux2,v4l2 @ 0x1fc0380] Compressed: mjpeg : Motion-JPEG : 640x480 160x120 176x144 320x176 320x240 352x288 432x240 544x288 640x360 752x416 800x448 800x600 864x480 960x544 960x720 1024x576 1184x656 1280x720 1280x960
[
{
"captureApi": "V4L2 SPLANE",
"formats": [
{
"resolution": "160x120",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "176x144",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "320x176",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "320x240",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "352x288",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "432x240",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "544x288",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "640x360",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "640x480",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "752x416",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "800x448",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "864x480",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "800x600",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "960x544",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "1024x576",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "960x720",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "1184x656",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "1280x720",
"fps": "30.00",
"storage": "CPU"
},
{
"resolution": "1280x960",
"fps": "30.00",
"storage": "CPU"
}
],
"id": "/dev/video0",
"name": "UVC Camera (046d:0825) (046d:0825)"
}
]
Not sure why I get different values. Could it be because of Ubuntu 14.04 vs 16.04?
guidou@: Do we already have any integration test that I could use to quickly try to reproduce this using a customly configured fake device? (If not, I am inclined to create one).
,
Sep 29 2017
WebRtcGetUserMediaBrowserTest should help. https://cs.chromium.org/chromium/src/content/browser/webrtc/webrtc_getusermedia_browsertest.cc https://cs.chromium.org/chromium/src/content/test/data/media/getusermedia.html |
|||
►
Sign in to add a comment |
|||
Comment 1 by manoranj...@chromium.org
, Sep 25 2017