Electron是否支持4K USB视频分辨率?
我们正在使用Electron框架开发一个windows应用程序。此应用程序旨在显示来自USB摄像头的视频流。我们正在使用“navigator.mediaDevices”API访问USB视频流。问题是电子应用程序无法使用4K USB视频分辨率,并抛出错误 我们可以看到视频流进入电子应用程序,但它只适用于较低的分辨率,例如480p,因此质量不达标。USB摄像头可支持4K分辨率。然而,当我们提供更高的分辨率时,它工作到720p,但超过720p时,它会产生“过度约束错误”。(下面是参考文献的代码片段) 我的问题是:Electron是否支持4K USB视频分辨率?,electron,usb,video-streaming,resolution,Electron,Usb,Video Streaming,Resolution,我们正在使用Electron框架开发一个windows应用程序。此应用程序旨在显示来自USB摄像头的视频流。我们正在使用“navigator.mediaDevices”API访问USB视频流。问题是电子应用程序无法使用4K USB视频分辨率,并抛出错误 我们可以看到视频流进入电子应用程序,但它只适用于较低的分辨率,例如480p,因此质量不达标。USB摄像头可支持4K分辨率。然而,当我们提供更高的分辨率时,它工作到720p,但超过720p时,它会产生“过度约束错误”。(下面是参考文献的代码片段)
ffmpeg version N-94112-gbb11584924 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190621
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 29.100 / 56. 29.100
libavcodec 58. 53.100 / 58. 53.100
libavformat 58. 28.100 / 58. 28.100
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 55.100 / 7. 55.100
libswscale 5. 4.101 / 5. 4.101
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
[dshow @ 0000016c508c8dc0] DirectShow video device options (from video devices)
[dshow @ 0000016c508c8dc0] Pin "Capture" (alternative pin name "0")
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1920x1080 fps=30 max s=1920x1080 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1920x1080 fps=30 max s=1920x1080 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x720 fps=30 max s=1280x720 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x720 fps=30 max s=1280x720 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=640x360 fps=30 max s=640x360 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=640x360 fps=30 max s=640x360 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x960 fps=30 max s=1280x960 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x960 fps=30 max s=1280x960 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1024x768 fps=30 max s=1024x768 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1024x768 fps=30 max s=1024x768 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=640x480 fps=30 max s=640x480 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=640x480 fps=30 max s=640x480 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x1024 fps=30 max s=1280x1024 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x1024 fps=30 max s=1280x1024 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x800 fps=30 max s=1280x800 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x800 fps=30 max s=1280x800 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1920x1080 fps=15 max s=1920x1080 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1920x1080 fps=15 max s=1920x1080 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x720 fps=15 max s=1280x720 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x720 fps=15 max s=1280x720 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=640x360 fps=15 max s=640x360 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=640x360 fps=15 max s=640x360 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x960 fps=15 max s=1280x960 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x960 fps=15 max s=1280x960 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1024x768 fps=15 max s=1024x768 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1024x768 fps=15 max s=1024x768 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=640x480 fps=15 max s=640x480 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=640x480 fps=15 max s=640x480 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x1024 fps=15 max s=1280x1024 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x1024 fps=15 max s=1280x1024 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x800 fps=15 max s=1280x800 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x800 fps=15 max s=1280x800 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=640x480 fps=15 max s=640x480 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=640x480 fps=15 max s=640x480 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=640x360 fps=15 max s=640x360 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=640x360 fps=15 max s=640x360 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=320x240 fps=15 max s=320x240 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=320x240 fps=15 max s=320x240 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=320x180 fps=15 max s=320x180 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=320x180 fps=15 max s=320x180 fps=30
我敢打赌,您的相机实际上不支持4k和底层浏览器引擎可以使用的编解码器。什么相机?FFmpeg告诉了你什么?@Brad上面提到的一个是我们对FFmpeg的回应。你的相机不能支持4k。我敢打赌,你的相机实际上不支持4k和底层浏览器引擎可以使用的编解码器。什么相机?FFmpeg告诉了你什么?@Brad上面提到的一个是我们对FFmpeg的回应。你的相机不支持4k。
ffmpeg version N-94112-gbb11584924 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190621
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 29.100 / 56. 29.100
libavcodec 58. 53.100 / 58. 53.100
libavformat 58. 28.100 / 58. 28.100
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 55.100 / 7. 55.100
libswscale 5. 4.101 / 5. 4.101
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
[dshow @ 0000016c508c8dc0] DirectShow video device options (from video devices)
[dshow @ 0000016c508c8dc0] Pin "Capture" (alternative pin name "0")
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1920x1080 fps=30 max s=1920x1080 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1920x1080 fps=30 max s=1920x1080 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x720 fps=30 max s=1280x720 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x720 fps=30 max s=1280x720 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=640x360 fps=30 max s=640x360 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=640x360 fps=30 max s=640x360 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x960 fps=30 max s=1280x960 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x960 fps=30 max s=1280x960 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1024x768 fps=30 max s=1024x768 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1024x768 fps=30 max s=1024x768 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=640x480 fps=30 max s=640x480 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=640x480 fps=30 max s=640x480 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x1024 fps=30 max s=1280x1024 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x1024 fps=30 max s=1280x1024 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x800 fps=30 max s=1280x800 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=h264 min s=1280x800 fps=30 max s=1280x800 fps=60.0002
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1920x1080 fps=15 max s=1920x1080 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1920x1080 fps=15 max s=1920x1080 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x720 fps=15 max s=1280x720 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x720 fps=15 max s=1280x720 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=640x360 fps=15 max s=640x360 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=640x360 fps=15 max s=640x360 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x960 fps=15 max s=1280x960 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x960 fps=15 max s=1280x960 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1024x768 fps=15 max s=1024x768 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1024x768 fps=15 max s=1024x768 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=640x480 fps=15 max s=640x480 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=640x480 fps=15 max s=640x480 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x1024 fps=15 max s=1280x1024 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x1024 fps=15 max s=1280x1024 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x800 fps=15 max s=1280x800 fps=30
[dshow @ 0000016c508c8dc0] vcodec=mjpeg min s=1280x800 fps=15 max s=1280x800 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=640x480 fps=15 max s=640x480 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=640x480 fps=15 max s=640x480 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=640x360 fps=15 max s=640x360 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=640x360 fps=15 max s=640x360 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=320x240 fps=15 max s=320x240 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=320x240 fps=15 max s=320x240 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=320x180 fps=15 max s=320x180 fps=30
[dshow @ 0000016c508c8dc0] pixel_format=yuyv422 min s=320x180 fps=15 max s=320x180 fps=30