How to capture a remote IRC session live

2020-06-11 - Louis-Philippe Véronneau

DebConf20 will be held online this year and I've started doing some work for the DebConf videoteam to prepare what's to come.

One thing I want us to do is capture a live IRC session and use it as a video input in Voctomix, the live video mixer we use. This way, at the end of a talk we could show both the attendees asking questions on IRC and the presenter replying to them side-by-side.

A mockup of a side-by-side voctogui window with someone on the left and a terminal running weechat on the right

Capturing a live video of an IRC client on a remote headless server is somewhat more complicated than you might think; as far as I know, neither ffmpeg nor gstreamer support recording a live ssh pseudoterminal1.

Worse, neither weechat nor irssi run on X: they use ncurses... Although you can capture an X11 window with ffmpeg -f x11grab, I wasn't able to get them to run with Xvfb.

Capturing the framebuffer

One thing I dislike with this method is the framebuffer isn't always easy to access on remote machines. If you don't have a serial connection, you can try using a VNC server that can.

I did my tests in a VM on an KVM hypervisor and used virt-manager to access the framebuffer.

I had a hard time setting the framebuffer resolution to a 16:9 aspect ratio. The winning combination ended up passing the nomodeset kernel parameter at boot and setting up these parameters in /etc/default/grub2:

GRUB_GFXMODE=1280x720
GRUB_GFXPAYLOAD_LINUX=keep

To make the text more readable, this is the /etc/default/console-setup file that seemed to make the most sense:

# CONFIGURATION FILE FOR SETUPCON

# Consult the console-setup(5) manual page.

ACTIVE_CONSOLES="/dev/tty[1-6]"

CHARMAP="UTF-8"

CODESET="Lat15"
FONTFACE="TerminusBold"
FONTSIZE="12x24"

Once that is done, the only thing left is to run the IRC client and launch ffmpeg. The magic command to record the framebuffer seems to be something like:

ffmpeg -f fbdev -framerate 60 -i /dev/fb0 -c:v libvpx -crf 10 -b:v 1M -auto-alt-ref 0 output.webm

Here is what I ended up with:


  1. We need something similarly flexible and featureful that can output to a TCP socket. 

  2. Don't forget to run update-grub before rebooting! 


videodebian