Everyone is welcome here --- except those who have borrowed books from me for and have not returned them yet!

How to create a video podcast under Linux

Posted on September 30, 2020 in computer-science

Setup

Installation

Sound

  • 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 audacity sound 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)

Video

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

  1. Make sure the following softwares are installed:

    sudo apt-get install gphoto2 v4l2loopback-utils v4l2loopback-dkms ffmpeg
    
  2. Load the video4linux kernel module:

    sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2
    
  3. Attach the Camera to a USB port, and check that it is recognized:

    gphoto2 --abilities
    

Make sure to unmount the Camera in Nautilus

  1. Check if video recording works:

    gphoto2 --capture-movie  # Press `Ctrl-C` to stop recording 
    mplayer movie.mjpg
    
  2. 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 Cheese or VLC to see the video stream.

OBS

Launch obs and add the following three Sources:

  • 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)

Press Start Recording

That's all folks!