Go to file
Yohann D'ANELLO 85febcf757 Add 1 second timeout to reconnect 2020-09-29 14:23:34 +02:00
auth 🌱 Create empty test files to have a realistic coverage 2020-09-28 21:18:49 +02:00
docs 🐳 Mounting folders is better than mounting files 2020-09-28 09:31:59 +02:00
internal/monitoring 🌱 Create empty test files to have a realistic coverage 2020-09-28 21:18:49 +02:00
stream 6 UDP ports are enough (but does not work) 2020-09-29 14:23:20 +02:00
web Add 1 second timeout to reconnect 2020-09-29 14:23:34 +02:00
.gitignore Use pkger to pack templates 2020-09-28 17:36:40 +02:00
.gitlab-ci.yml libsrt got packaged in Alpine Linux 2020-09-29 14:22:56 +02:00
Dockerfile 6 UDP ports are enough (but does not work) 2020-09-29 14:23:20 +02:00
LICENSE License work under MIT 2020-09-25 15:26:33 +02:00
README.md How to stream with OBS 2020-09-29 13:43:49 +02:00
go.mod Use pkger to pack templates 2020-09-28 17:36:40 +02:00
go.sum Use pkger to pack templates 2020-09-28 17:36:40 +02:00
main.go Use pkger to pack templates 2020-09-28 17:36:40 +02:00
main_test.go 🌱 Create empty test files to have a realistic coverage 2020-09-28 21:18:49 +02:00

README.md

Ghostream

License: MIT PkgGoDev Go Report Card pipeline status coverage report

Boooo! A simple streaming server with authentication and open-source technologies.

This project was developped at Cr@ns to stream events.

Features:

  • WebRTC playback with a lightweight web interface.
  • SRT stream input, supported by FFMpeg, OBS and Gstreamer.
  • Low-latency streaming, sub-second with web player.
  • Authentification of incoming stream using LDAP server.

Installation on Debian/Ubuntu

You need at least libsrt 1.4.1. On Ubuntu 20.04 or Debian Buster, you may manually install libsrt1-openssl then libsrt-openssl-dev.

You may clone this repository, then go run main.go for debugging, or go get gitlab.crans.org/nounous/ghostream.

Installation with Docker

An example is given in docs/docker-compose.yml. It uses Traefik reverse proxy.

You can also launch the Docker image using,

docker build . -t ghostream
docker run -it --rm -p 8080:8080 -p 2112:2112 -p 9710:9710 ghostream

Streaming

As stated by OBS wiki, when streaming you should adapt the latency to 2.5 * (the round-trip time with server, in μs).

With OBS

As OBS uses FFMpeg, you need to have FFMpeg compiled with SRT support. To check if SR is available, run ffmpeg -protocols | grep srt. On Windows and MacOS, OBS comes with his own FFMpeg that will work.

In OBS, go to "Settings" -> "Stream" and change "Service" to "Custom..." and "Server" to srt://127.0.0.1:9710.

With GStreamer

To stream X11 screen,

gst-launch-1.0 ximagesrc startx=0 show-pointer=true use-damage=0 \
! videoconvert \
! x264enc bitrate=32000 tune=zerolatency speed-preset=veryfast byte-stream=true threads=1 key-int-max=15 intra-refresh=true ! video/x-h264, profile=baseline, framerate=30/1 \
! mpegtsmux \
! srtserversink uri=srt://127.0.0.1:9710/ latency=1000000

References