我想在 Google+ 环聊中使用循环视频剪辑作为我的网络摄像头源。我安装了 v4l2loopback 并创建了一个视频环回设备。但我还没有弄清楚如何将视频帧写入设备。给定的例子是:
gst-launch videotestsrc ! v4l2sink device=/dev/video1
Run Code Online (Sandbox Code Playgroud)
因此,在阅读了 gst-launch 的手册页并试图了解发生了什么之后,我做出了无力的尝试:
sudo gst-launch-0.10 filesrc location=/home/briankb/Videos/darthvaderdancing.mp4 ! v4l2sink device=/dev/video0
Run Code Online (Sandbox Code Playgroud)
这导致:
Setting pipeline to PAUSED ...
libv4l2: error getting pixformat: Invalid argument
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
(gst-launch-0.10:12622): GStreamer-CRITICAL **: gst_caps_get_structure: assertion `GST_IS_CAPS (caps)' failed
New clock: GstSystemClock
(gst-launch-0.10:12622): GStreamer-CRITICAL **: gst_structure_get_name: assertion `structure != NULL' failed
Caught SIGSEGV accessing address (nil)
#0 0x00007fc1890f0b03 in poll () from …Run Code Online (Sandbox Code Playgroud) 我一直在尝试使用以下命令将我的 DSLR 设置为网络摄像头:gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -threads 0 -f v4l2 /dev/video0但这会导致以下错误:
hutber@hutber:~/v4l2loopback-master$ gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -threads 0 -f v4l2 /dev/video4
ffmpeg version N-49161-g50e194e6e1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora …Run Code Online (Sandbox Code Playgroud) 最近安装系统更新后,droidcam 将不再打开并失败并显示消息:找不到设备 (/dev/video[0-9])。你安装了吗?
Ubuntu 18.04.4 LTS
我发现一些指南说这曾经很复杂,但现在很简单
sudo apt install obs-studio && sudo apt install v4l2loopback-dkms
Run Code Online (Sandbox Code Playgroud)
这确实在 OBS Studio 上给了我一个“启动虚拟摄像机”按钮。当我单击它时,系统会提示我输入密码。就是这样。没有其他事情发生。该按钮仍然显示“启动虚拟相机”(它应该更改为“停止虚拟相机”)。Firefox、Zoom 或 Cheese 不会检测到任何虚拟摄像头。
难道我做错了什么?
video ×3
webcam ×3
ffmpeg ×2
12.04 ×1
command-line ×1
droidcam ×1
obs-studio ×1
skype ×1
sound ×1