![我无法使用 Kinect 2 进行 Skype 和 Zoom 通话,但是它可以与 ffmpeg 配合使用](https://linux22.com/image/944217/%E6%88%91%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%20Kinect%202%20%E8%BF%9B%E8%A1%8C%20Skype%20%E5%92%8C%20Zoom%20%E9%80%9A%E8%AF%9D%EF%BC%8C%E4%BD%86%E6%98%AF%E5%AE%83%E5%8F%AF%E4%BB%A5%E4%B8%8E%20ffmpeg%20%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8.png)
嗨,Ubuntu 爱好者们,
我已经编译并加载了下面 github 上的内核驱动程序模块“gspca-kinect2”,因为我希望我的 kinect 2 被检测为 skype 的网络摄像头,但它没有工作。我发出的命令解释如下:
https://github.com/tduck973564/gspca-kinect2
回顾一下:
wget -q -O - https://raw.githubusercontent.com/tduck973564/gspca-kinect2/master/install-webcam.sh | sudo sh
$ make -C /lib/modules/`uname -r`/build M=`pwd` SRCROOT=`pwd` clean modules
$ sudo /sbin/rmmod gspca_main
$ sudo /sbin/modprobe videodev
$ sudo /sbin/insmod ./gspca_main.ko
$ sudo /sbin/insmod ./gspca_kinect2.ko
$ ffmpeg -framerate 30 -video_size 640x480 -i /dev/video1 test.avi
$ mplayer test.avi
并且它成功了(这意味着它能够捕捉到我房间里的东西,并将其保存在可以重现的 avi 文件中:
# ffmpeg -framerate 30 -video_size 640x480 -i /dev/video1 test.avi
ffmpeg version 4.4-6ubuntu5 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.2.0-7ubuntu1)
configuration: --prefix=/usr --extra-version=6ubuntu5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[video4linux2,v4l2 @ 0x55dd58ce0400] The V4L2 driver changed the video from 640x480 to 1920x1080
[video4linux2,v4l2 @ 0x55dd58ce0400] The driver does not permit changing the time per frame
[video4linux2,v4l2 @ 0x55dd58ce0400] Time per frame unknown
Input #0, video4linux2,v4l2, from '/dev/video1':
Duration: N/A, start: 4818.621738, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 15 tbr, 1000k tbn, 1000k tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[swscaler @ 0x55dd58e25fc0] deprecated pixel format used, make sure you did set range correctly
Output #0, avi, to 'test.avi':
Metadata:
ISFT : Lavf58.76.100
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p(tv, bt470bg/unknown/unknown, progressive), 1920x1080, q=2-31, 200 kb/s, 15 fps, 15 tbn
Metadata:
encoder : Lavc58.134.100 mpeg4
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame= 74 fps= 16 q=31.0 Lsize= 866kB time=00:00:05.93 bitrate=1196.1kbits/s speed=1.28x
video:859kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.894046%
Exiting normally, received signal 2.
当我尝试将设备 /dev/video1 用于 skype 和 zoom 时,出现了问题。事实上,由于某些未知原因,他们无法正确检测 kinect 2,我只看到黑屏,而看不到我的脸。下面您可以看到他们检测到的设备是什么(它们 = skype for web + chrome 浏览器和 zoom;相反,ubuntu 上的 skype 客户端只检测到位于 0000:0000 的虚拟设备):
我的 ubuntu 21.10 上的 kinect 2 位于以下地址:
总线 004 设备 002:ID 045e:02c4 Microsoft Corp. Xbox NUI 传感器。