电子是否支持4K USB视频分辨率?

问题描述 投票:1回答:1

我们正在使用Electron框架开发Windows应用程序。此应用程序旨在显示来自USB摄像机的视频流。我们正在使用“ navigator.mediaDevices” API来访问USB视频流。问题是电子应用程序无法在4K USB视频分辨率下工作,并引发错误。

我们能够看到视频流进入Electron应用程序,但仅适用于较低的分辨率,例如480p,因此质量达不到标准。 USB相机最多可支持4K分辨率。但是,当我们提供更高的分辨率时,它可以工作到720p,但超出此范围,它会给出“ OverconstrainedError”。 (以下代码段用于refn)

          navigator.mediaDevices.getUserMedia({
                video:
                    {

                            width: {
                                exact: usbWidth // works till 1280
                            },
                            height: {
                                exact: usbHeight // works till 720

                            },
                            deviceId: {
                            exact: deviceid
                        },

                    }
            }).then(function (stream) {
                stream.getTracks().forEach(function(track) {
                    console.log(track.getSettings());
            })

我的问题是:-1.基于Chromium构建的Electron在USB视频分辨率方面是否有任何限制?2. Electron应用程序中是否可以支持4K USB视频分辨率?3.是否存在参考代码,可以向我们指出正确的方向?

electron usb video-streaming resolution
1个回答
0
投票

这是FFMPEG命令的响应:-

ffmpeg版本N-94112-gbb11584924版权所有(c)2000-2019 FFmpeg开发人员使用gcc 9.1.1(GCC)20190621构建]

配置:--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视频设备选项(来自视频设备)

[[dshow @ 0000016c508c8dc0]引脚“捕获”(替代引脚名称“ 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最小s = 640x480 fps = 30最大s = 640x480 fps = 60.0002

[[dshow @ 0000016c508c8dc0] vcodec = h264最小s = 640x480 fps = 30最大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最小s = 1920x1080 fps = 15最大s = 1920x1080 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 1920x1080 fps = 15最大s = 1920x1080 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 1280x720 fps = 15最大s = 1280x720 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 1280x720 fps = 15最大s = 1280x720 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 640x360 fps = 15最大s = 640x360 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 640x360 fps = 15最大s = 640x360 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 1280x960 fps = 15最大s = 1280x960 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 1280x960 fps = 15最大s = 1280x960 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小值s = 1024x768 fps = 15最大值s = 1024x768 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小值s = 1024x768 fps = 15最大值s = 1024x768 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 640x480 fps = 15最大s = 640x480 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 640x480 fps = 15最大s = 640x480 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 1280x1024 fps = 15最大s = 1280x1024 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 1280x1024 fps = 15最大s = 1280x1024 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 1280x800 fps = 15最大s = 1280x800 fps = 30

[[dshow @ 0000016c508c8dc0] vcodec = mjpeg最小s = 1280x800 fps = 15最大s = 1280x800 fps = 30

[[dshow @ 0000016c508c8dc0] pixel_format = yuyv422最小s = 640x480 fps = 15最大s = 640x480 fps = 30

[[dshow @ 0000016c508c8dc0] pixel_format = yuyv422最小s = 640x480 fps = 15最大s = 640x480 fps = 30

[[dshow @ 0000016c508c8dc0] pixel_format = yuyv422最小s = 640x360 fps = 15最大s = 640x360 fps = 30

[[dshow @ 0000016c508c8dc0] pixel_format = yuyv422最小s = 640x360 fps = 15最大s = 640x360 fps = 30

[[dshow @ 0000016c508c8dc0] pixel_format = yuyv422最小s = 320x240 fps = 15最大s = 320x240 fps = 30

[[dshow @ 0000016c508c8dc0] pixel_format = yuyv422最小s = 320x240 fps = 15最大s = 320x240 fps = 30

[[dshow @ 0000016c508c8dc0] pixel_format = yuyv422最小s = 320x180 fps = 15最大s = 320x180 fps = 30

[[dshow @ 0000016c508c8dc0] pixel_format = yuyv422最小s = 320x180 fps = 15最大s = 320x180 fps = 30

© www.soinside.com 2019 - 2024. All rights reserved.