Restreamer

repository·2.x·Indexed 26 days ago

https://github.com/datarhei/restreamer

A self-hosting solution for handling live streams, allowing users to stream to websites and platforms such as YouTube, Twitch, and Vimeo using RTMP, SRT, and HLS protocols. It can be deployed via Docker with specialized images for Raspberry Pi, Nvidia Cuda, and Intel VAAPI.

Tokens
1.1K
Snippets
2
Records
2
Agent score
40%

What's inside Restreamer

  1. Quick setup with Docker

    2.x

    Restreamer can be deployed using Docker. Depending on your hardware (CPU, GPU, or Single Board Computer), choose the appropriate image and command.

    Important Notes:

    • Use --privileged if you need to access local devices like USB cameras.
    • If network sources cannot be reached, try adding --security-opt seccomp=unconfined.
    • For external access (HTTP/S, RTMP/S, SRT), you may need to configure port forwarding on your router to the Restreamer's internal IP.
    ### AMD64/ARMv7/ARM64
    ```sh
    docker run -d --restart=always --name restreamer \
       -v /opt/restreamer/config:/core/config -v /opt/restreamer/data:/core/data \
       -p 8080:8080 -p 8181:8181 \
       -p 1935:1935 -p 1936:1936 \
       -p 6000:6000/udp \
       datarhei/restreamer:latest

    ARMv7/ARM64 Raspberry Pi

    docker run -d --restart=always --name restreamer \
       -v /opt/restreamer/config:/core/config -v /opt/restreamer/data:/core/data \
       --privileged \
       -p 8080:8080 -p 8181:8181 \
       -p 1935:1935 -p 1936:1936 \
       -p 6000:6000/udp \
       datarhei/restreamer:rpi-latest

    AMD64 Nvidia Cuda

    docker run -d --restart=always --name restreamer \
       -v /opt/restreamer/config:/core/config -v /opt/restreamer/data:/core/data \
       --runtime=nvidia --privileged \
       -p 8080:8080 -p 8181:8181 \
       -p 1935:1935 -p 1936:1936 \
       -p 6000:6000/udp \
       datarhei/restreamer:cuda-latest

    AMD64 Intel VAAPI

    docker run -d --restart=always --name restreamer \
       -v /opt/restreamer/config:/core/config -v /opt/restreamer/data:/core/data \
       -v /dev/dri:/dev/dri --privileged \
       -p 8080:8080 -p 8181:8181 \
       -p 1935:1935 -p 1936:1936 \
       -p 6000:6000/udp \
       datarhei/restreamer:vaapi-latest
  2. Build a custom Restreamer bundle

    2.x

    If you need to customize the components of Restreamer, you can build a custom bundle image. This involves building the FFmpeg component, the Golang backend (core), and the React interface (UI) separately, then combining them using build arguments in the main Restreamer repository.

    # 1. Build Restreamer FFmpeg
    $ git clone github.com/datarhei/ffmpeg
    $ cd ffmpeg
    $ docker build -f Dockerfile.alpine -t myffmpeg .
    
    # 2. Build Restreamer backend (Golang)
    $ git clone github.com/datarhei/core
    $ cd core
    $ docker build -t mycore .
    
    # 3. Build Restreamer interface (React)
    $ git clone github.com/datarhei/restreamer-ui
    $ cd restreamer-ui
    $ docker build -t myrsui .
    
    # 4. Build Restreamer bundle
    $ git clone github.com/datarhei/restreamer
    $ cd restreamer
    $ docker build --build-arg FFMPEG_IMAGE=myffmpeg --build-arg CORE_IMAGE=mycore --build-arg RESTREAMER_UI_IMAGE=myrsui -t myrestreamer .
    $ docker run -it --rm -p 8080:8080 myrestreamer