I created an environment where you can do the following so that you can have a fun Zoom meeting with home telework.
--Building a Zoom meeting environment on Linux (Ubuntu) --Process the scene with OBS Studio --Sound effects are popped out during the meeting
All you need is a virtual camera for Zoom, OBS Studio, OBS Studio, and a web app for sound effect popping. No additional hardware such as a mixer is required other than the webcam.
[Supplement] In my environment, I stopped creating virtual microphones in the second half. This is because the echo could not be completely erased at the destination.
Go to https://zoom.us/download.
When the download is complete, the message "Click to install Zoom" will appear, so click it.
The installer will start, so click "Install".
You can install it with the apt command by pulling the repository. Since my environment is 18.04, skip the installation of FFmpeg and execute the following command. For other versions and for more information, see the references below.
sudo add-apt-repository ppa:obsproject/obs-studio
sudo apt update
sudo apt install obs-studio
Reference: OBS Project Install instruction
I referred to the article on the following site here, and with some exceptions, I was able to successfully introduce it if I did it this way. It is explained in detail with a screen snap, so it is better to see here. Original article: [Day of Speed] stream the video synthesized by OBS Studio on Linux to Skype or Zoom using obs-v4l2sink The following are the commands when installed in my environment.
sudo apt install v4l2loopback-dkms v4l2loopback-utils
sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1
https://github.com/CatxFish/obs-v4l2sink/releases
sudo apt install ./obs-v4l2sink.deb
cd /usr/lib/x86_64-linux-gnu/obs-plugins
sudo ln -s /usr/lib/obs-plugins/v4l2sink.so
It is necessary to click "Settings" in "Control" at the bottom right of the screen of OBS Studio, select "Video" from the left of the dialog that appears, and match the basic resolution and camera resolution. Please refer to the original article for a detailed explanation with a screen snapshot.
Enables the virtual camera, that is, allows you to select the virtual camera as the camera from Zoom. If the above commands and settings are successful, * v4l2sink * should appear in the "Tools" menu of OBS Studio, so click it.
The following dialog will appear.
Press "Start" to activate the virtual camera. If you check "Auto Start", the virtual camera will be automatically enabled when OBS Studio starts, even if you do not set it each time.
This time, select the virtual camera as the camera on the Zoom side. When the Zoom meeting starts, click the up arrow next to * Start Video * at the bottom left of the meeting screen and you should see * OBS Cam * in your camera choices. Select it. The name of the virtual camera will be the one specified by the option * card_label = "OBS Cam" * given when loading v4l2loopback above.
The virtual camera can be used in the above, but the module is not automatically loaded when the OS is restarted, so you need to enter a command each time. Therefore, make the module load persistent. I used /etc/modules-load.d, but if you are familiar with Linux itself, there may be a better way to do it.
If you create a conf file in modules-load.d, the specified kernel module will be loaded at startup. In my case, I created a new file called obs.conf and put it in /etc/modules-load.d as follows.
/etc/modules-load.d/obs.conf
v4l2loopback
Create it as a super user by sudo.
In order to pass the options that were attached when loading the kernel module with * modprobe * from the command line at the time of loading at startup, describe the options in /etc/modprobe.d. In my case, I created a new file called obs_opt.conf and put it in /etc/modprobe.d as follows.
/etc/modprobe.d/obs_opt.conf
options v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1
The order in the line is * options *, which means adding options, followed by the name of the module to which this option is attached, and the option to be added after that.
Create it as a super user by sudo.
Since OBS Studio is equipped with an audio mixer, it is possible to broadcast the audio from the microphone overlaid with the music being played on the PC. However, this is effective when broadcasting from OBS Studio on YouTube etc., but the sound of the mixer does not flow to Zoom even if it is projected on Zoom with a virtual camera. It would be nice to have a virtual broadcast plugin, but unfortunately I couldn't find it.
By the way, if you want to cover the sound on the PC while using Share screen, you can do it without a virtual microphone (described later). This section describes the settings required to cover the audio sent as a meeting participant.
Here, a virtual microphone is created and the playback sound on the PC and the sound from the microphone are mixed and played. Regarding the creation of a virtual microphone, I referred to the following post (or rather, that's it).
Original article: Redirecting Pulseaudio sink to a virtual source The last answer in the article is the creation method itself. The * pactl * command is used in the article, but now it seems to have been replaced by * pacmd *.
This is achieved by creating a virtual microphone using PulseAudio, which is the upper layer of the Linux sound management mechanism, and setting the sound being played from the app and the sound from the microphone to flow into it.
Generate a Sink with the name mix-for-virtual-mic.
pacmd load-module module-null-sink sink_name=mix-for-virtual-mic sink_properties=device.description=Mix-for-Virtual-Microphone
pacmd load-module module-combine-sink sink_name=virtual-microphone-and-speakers slaves=mix-for-virtual-mic,alsa_output.pci-0000_00_1b.0.analog-stereo
pacmd load-module module-loopback source=alsa_input.pci-0000_00_1b.0.analog-stereo sink=mix-for-virtual-mic latency_msec=20
Since the output of the echo canceller is not used, prepare a null sink.
pacmd load-module module-null-sink sink_name=silence sink_properties=device.description=silent-sink-for-echo-cancel
Create a virtual microphone (Virtual-Microphone) using the echo canceller module. Use this from Zoom.
pacmd load-module module-echo-cancel sink_name=virtual-microphone source_name=virtual-microphone source_master=mix-for-virtual-mic.monitor sink_master=silence aec_method=null source_properties=device.description=Virtual-Microphone sink_properties=device.description=Virtual-Microphone
If there is no error in executing each command so far, the setting is successful. Each Sink you create will be visible to Zoom. On the Zoom side, select the microphone and speaker as follows.
Now, for example, if you play music on your PC and speak with a microphone, both the music and your voice will reach the participants in the Zoom meeting.
You can use the virtual microphone above, but as with the virtual camera, it will disappear when you restart the OS, so make it permanent.
All the settings up to this point are executed on PulseAudio, so if you write them in the PulseAudio startup script, Sink will start automatically when the OS starts. The startup script can be one of the following: I made the system settings.
--~ / .pulse / default.pa: Personal settings --/etc/pulse/default.pa: System settings
When you open /etc/pulse/default.pa, various settings are already included, so add the following at the very end
/etc/pulse/default.Addition to pa
load-module module-null-sink sink_name=mix-for-virtual-mic sink_properties=device.description=Mix-for-Virtual-Microphone
load-module module-combine-sink sink_name=virtual-microphone-and-speakers slaves=mix-for-virtual-mic,alsa_output.pci-0000_00_1b.0.analog-stereo
load-module module-loopback source=alsa_input.pci-0000_00_1b.0.analog-stereo sink=mix-for-virtual-mic latency_msec=20
load-module module-null-sink sink_name=silence sink_properties=device.description=silent-sink-for-echo-cancel
load-module module-echo-cancel sink_name=virtual-microphone source_name=virtual-microphone source_master=mix-for-virtual-mic.monitor sink_master=silence aec_method=null source_properties=device.description=Virtual-Microphone sink_properties=device.description=Virtual-Microphone
You can download a suitable free sound effect and play it on the player, but I have a useful web application, so I am using it. If you have all this, you won't be in trouble. I am very grateful to use it.
Sound Effect Lab Pon App https://soundeffect-lab.info/pon/app.html
There may be other ways, but the distribution of OBS Studio scenes with a virtual camera does not appear in screen sharing as it is, so I tried the following method.
Select the scene you want to share from the OBS Studio scenes, right-click and select the window projector.
The combined result of the scene will then open as a window.
If you select Share Screen, a dialog will appear, so share the window projector you just opened.
At this time, if you check Share computer sound at the bottom left of the dialog, you can play sound effects, music, etc. on Zoom (although it was a function only for Windows version until the previous version of Zoom). , Now it's also available for Linux).
Recommended Posts