LibrePlanet: Conference/2019/Streaming

From LibrePlanet
< LibrePlanet:Conference‎ | 2019
Revision as of 11:18, 20 March 2024 by Mmcmahon (talk | contribs) (Add link to 2023)
Jump to: navigation, search

The 2019 speaker videos and streaming of the LibrePlanet conference were created using free software. This year, we used HUBAngl to stream speakers and audio to Icecast.

We've been using this system with minor tweaks since LibrePlanet 2017, when we blogged about it. More information on other years: 2023, 2017, 2016, 2015.

We used a gstreamer script to stream desktop streams:

#!/bin/bash

export DISPLAY=":0"

while true; do

  unset XPARAMETERS

  # native x200 resolution not supported

  # mirrored mode
  if xdpyinfo|grep -i dimensions |grep 1280x720 -q; then
      XPARAMETERS="startx=0 starty=0 endx=1279 endy=719"
  fi
  # dual mode
  if xdpyinfo|grep -i dimensions |grep 2560x720 -q; then
      XPARAMETERS="startx=1280 starty=0 endx=2559 endy=719"
  fi

  sleep 1
  gst-launch-1.0 -e ximagesrc $XPARAMETERS use-damage=false show-pointer=false ! videoconvert !  videorate ! video/x-raw,framerate=$FRAMERATE/1 ! videoscale ! video/x-raw, width=1280, height=720 ! queue ! vp8enc target_bitrate=$BITRATE cpu-used=16 deadline=1 threads=2 keyframe-max-dist=$(expr $FRAMERATE \* 2) ! webmmux streamable=true ! shout2send ip=live-master.fsf.org port=80 mount=$MOUNT password=$PASSWORD sync=false
done

We used desktop shortcuts that ran the following scripts to change video resolution, and to set mirror / dual monitor modes:

#!/bin/bash

export DISPLAY=":0.0"

if (xrandr | grep -q "VGA1 disconnected" ); then
  echo "$0: error: failed to detect 2nd monitor in xrandr output. Doing nothing."
  exit 1
fi

if  ! ( xrandr | grep -q _LP); then
    # See https://wiki.archlinux.org/title/xrandr#Screen_Blinking for ways to adjust this.
    xrandr --newmode "1280x720_60.00_LP"   74.50  1280 1344 1472 1664  720 723 728 748 -hsync +vsync
    xrandr --addmode LVDS1 "1280x720_60.00_LP"
    xrandr --addmode VGA1 "1280x720_60.00_LP"
fi

if ( [ "1${1}1" = "1dual1" ]); then
    xrandr --output LVDS1 --mode 1280x720_60.00_LP --output VGA1 --mode 1280x720_60.00_LP --right-of LVDS1
else
    xrandr --output LVDS1 --mode 1280x720_60.00_LP --output VGA1 --same-as LVDS1
fi

echo Changed the screen settings, now restarting gstreamer
pkill gst-launch-1.0

After the conference, we cut and combined the video from the slides laptop and the webcam pointed at the speaker using commands like these:

ffmpeg -i <input file name> -acodec copy -vcodec copy -ss <start point in seconds> -t <duration in seconds> <output file with same file extension>
ffmpeg -threads 0 -i libreplanet2019-room-123_2019-03-23_09-50-48.webm -i libreplanet2019-slides-123_2019-03-23_09-46-26.webm -filter_complex "[0]scale=iw/3:ih/3,fps=24 [pip];[1]fps=24[base];[base][pip]overlay=main_w- overlay_w-10:main_h-overlay_h-10" -g 192 -vcodec libvpx-vp9 -max_muxing_queue_size 9999 output.webm