README.md

IPFS Live Streaming

This project is started by @ASoTNetworks and
@darkdrgn2k to stream videos over IPFS, which
overlapped with the need to live stream the Our Networks 2018
conference in Toronto. We will document here the components and processes necessary
to run live streams throughout the conference and archive the video assets on the
IPFS network, that is suitable for a small conference with an audience size of less
than 100 people.

The laptop is the control centre. It has two USB capture cards, connected to separate USB
buses (e.g. if it has a USB2 and USB3 interface) if possible to avoid bandwidth issues. These
will be the video and audio inputs. The capture cards are of two different brands because
cards like the Elgato have problems when running two in parallel. At least one card should
take a 3.5 mm audio input so we can mix the audio into the stream via the audio mixer.

For Yggdrasil, you should compile at tag v0.3.2, and when streaming, run it with the
configurations that will be downloaded from the streaming server at a later step.

OBS Studio is used throughout the conference to toggle between the two video feeds (i.e.
the slides and the presenter video). Using the Start Streaming function in OBS Studio,
the stream is published at 720p to a RTMP server we will set up in the next step. Using
the Start Recording function in OBS Studio, the operator will also record each talk as
a separate 1080p mp4 file to the external hard disk to be published after the event.

The on-premise laptop running OBS Studio pushes to the rtmp-server, which through
IP-pinning of the OpenVPN or Yggdrasil-generated IP address will allow only that device to
publish. The ipfs-server pulls that RTMP stream, encodes ts chunks in a live m3u8 file using
ffmpeg, then IPFS adds and pins those files and uses IPNS to publish the m3u8 to its node
ID. The built-in ipfs-http gateway allow those content to be accessed via HTTP, which is
what the embedded player on the website will use. However, viewers running a IPFS client
(with pubsub enabled) can directly view the streams over IPFS. Optionally, we can run
one or more ipfs-mirror servers that pin the live streaming content and run additional
gateways.

All the servers described above are provisioned using Terraform on Digital Ocean. In addition,
the RTMP stream can be consumed by other services to provide a parallel stream that does not
involve IPFS.