Linux Ubuntu 20.04 (running pulseaudio server)
a Canon EOS M50 camera mounted on a tripod. This achieves better video quality than a webcam.
Plug your microphone and make sure it is selected as the input device in System's
Settings/Sound. Alternatively, you can use the Pulse Audio Volume Control (command:
pavucontrol) which provides more control.
Test the volume and recording quality, either with the
audacitysound editor, or with the commands:
parec --file-format=wav test.wav # Press Ctrl-C to stop the recording paplay test.wav
Note: It is possible to improve the audio quality by installing a noise and echo cancellation kernel module for pulseaudio (check out this post. An alternative would be to replace pulseaudio with JACK audio Connection Kit which permits to add realtime sound filters)
Here, rather than using a webcam, we will use a real Camera to record the video.
The instructions below are just a summary of the article How to use your DSLR Camera as a Webcam In Linux
Make sure the following softwares are installed:
sudo apt-get install gphoto2 v4l2loopback-utils v4l2loopback-dkms ffmpeg
Load the video4linux kernel module:
sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2
Attach the Camera to a USB port, and check that it is recognized:
Make sure to unmount the Camera in Nautilus
Check if video recording works:
gphoto2 --capture-movie # Press `Ctrl-C` to stop recording mplayer movie.mjpg
You are now ready to capture the video stream
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video1
Remark: you may need to use another video device. Do
ls /dev/video* to check the available video devices.
You can open the video device in
VLC to see the video stream.
obs and add the following three
- Screen Capture (XSHM)
- Video Capture Device (V4L2)
- Audio Input Capture (PulseAudio)
You may have to click on each source to set up some parameters such as resolution, select the right microphone input, etc.
Place the Screen and Video Capture on the canvas (see https://obsproject.com/wiki/OBS-Studio-Overview#scenes-and-sources)
That's all folks!