This article talks about an example setup for using Television Simulator with one or more live-streaming video sources. You’ll use a virtual machine with Docker to make this work, either on your LAN or over the web and setup subdomains using HTTPS to make everything maximally compatible. Videos that you want to play 24/7 will be stored on the server and played, one at a time, per channel, on a loop.
<aside> 🐢
A single CPU virtual machine will not work as it’s just not sufficient to run. I’ve tried.
</aside>
stateDiagram-v2
state "nginx proxy manager\\n{your IP}:443" as npm
state "docker-static-website\\n{your IP}:8101\\nServes /var/channels/ch1/www" as sw
state "Television Simulator\\n{your IP}:8087" as tvs
state "ffplayout for channel 1\\nPublishes to /var/channels/ch1/www" as ffp
[*] --> npm: Web request
npm --> tvs: tvs.example.com
npm --> sw: ch1.example.com
sw --> ffp
I find it easiest to use Portainer CE. It’s a free program and provides a GUI, monitoring, and the ability to work with Docker via the web.
Install Portainer CE with Docker on Linux | Portainer Documentation
I deployed each Docker Compose file as its own Stack in portainer, which allows you to restart and manage the static web server as well as ffplayout simultaneously.
Follow the tutorial here to set up Nginx Proxy Manager
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '443:443'
- '81:81'
volumes:
- /var/npm/data:/data
- /var/npm/letsencrypt:/etc/letsencrypt
ffplayout
<aside> 🛠
You’ll need to build the Docker image for ffplayout
yourself since it isn’t available on Docker Hub. Visit this repository and download the Dockerfile
and ffplayout_{version}.deb
and run docker build -t ffplayout .
in the directory you downloaded it at. This will make an image tagged as ffplayout
you can use in your channels.
</aside>
services:
ffplayout:
container_name: ffplayout-ch1
image: 'ffplayout:latest'
volumes:
- "/var/channels/ch1/ffplayout.yml:/etc/ffplayout/ffplayout.yml"
- "/var/channels/ch1/logs:/logs"
- "/var/channels/ch1/video:/video"
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
- "/var/channels/ch1/www:/live"
restart: unless-stopped
webserver:
image: lipanski/docker-static-website:latest
depends_on:
- ffplayout
restart: always
networks:
- channel-network
ports:
- "8101:3000"
volumes:
- "/var/channels/ch1/www:/home/static"
- "/var/channels/ch1/httpd.conf:/home/static/httpd.conf:ro"
networks:
channel-network:
name: ch1-network
driver: bridge
television-simulator