Skip to content

0ceanSlim/gnostream

Repository files navigation

gnostream

Live streaming server with RTMP support and automatic Nostr broadcasting. Built in Go with configurable recording and real-time metadata updates.

Features

  • RTMP Streaming: Built-in RTMP server for live streaming
  • HLS Conversion: Automatic conversion to HLS format for web playback
  • Nostr Broadcasting: Automatic event publishing to Nostr relays
  • Real-time Updates: Edit stream info while live streaming
  • Recording Control: Toggle recording on/off per stream
  • Archive System: Automatic archival of recorded streams
  • Web Interface: Simple web viewer for your streams

Requirements

  • FFmpeg (required for RTMP processing and HLS conversion)

Installing FFmpeg

Linux (Ubuntu/Debian):

sudo apt update
sudo apt install ffmpeg

macOS:

brew install ffmpeg

Windows:

  • Download from ffmpeg.org
  • Add to PATH environment variable

Quick Start

Option 1: Download Release Binary (Recommended)

  1. Download the latest release

    • Go to Releases
    • Download the appropriate file for your platform:
      • Linux: gnostream-linux-amd64.tar.gz
      • macOS (Intel): gnostream-darwin-amd64.tar.gz
      • macOS (M1/M2): gnostream-darwin-arm64.tar.gz
      • Windows: gnostream-windows-amd64.zip
  2. Extract and setup

    # Linux/macOS
    tar -xzf gnostream-*.tar.gz
    cd gnostream-*/
    
    # Windows: Extract the ZIP file and open the folder
  3. Configure

    # Copy and edit the example configs
    cp config.example.yml config.yml
    cp stream-info.example.yml stream-info.yml
    
    # Edit config.yml with your Nostr private key and server settings
    # Edit stream-info.yml with your stream details
  4. Run

    # Linux/macOS
    ./gnostream
    
    # Windows
    gnostream.exe
  5. Start streaming

    • RTMP URL: rtmp://your-server-ip:1935/live
    • Web viewer: http://your-server-ip:8181

Option 2: Build from Source

  1. Prerequisites: Go 1.21+

  2. Clone and build

    git clone https://github.com/yourusername/gnostream.git
    cd gnostream
    go mod tidy
    go build -o gnostream
  3. Follow steps 3-5 from Option 1 above

Configuration

config.yml

server:
  port: 8181
  host: "0.0.0.0"
  external_url: "https://live.yourdomain.com"

rtmp:
  port: 1935
  host: "0.0.0.0"

nostr:
  private_key: "nsec1abc..."  # Your Nostr private key
  delete_non_recorded: false  # Auto-delete events for streams without recordings
  relays:
    - "wss://relay.damus.io"
    - "wss://wheat.happytavern.co"
    - "wss://relay.nostr.band"

stream_info_path: "stream-info.yml"

stream-info.yml

title: "My Live Stream"
summary: "Stream description here"
image: "https://example.com/thumbnail.jpg"
tags: ["live", "gaming", "chill"]

# Recording (true = save for later, false = live only)
record: false

# HLS Settings
hls:
  segment_time: 10    # Seconds per segment
  playlist_size: 10   # Segments to keep in playlist

Usage

  • Live streaming: Connect to RTMP - stream starts automatically
  • Live updates: Edit stream-info.yml while streaming to update title, description, and tags
  • Recording control: Set record: true/false to save streams or stream live-only
  • Nostr events: Automatic start/update/end events broadcast to configured relays
  • Event cleanup: Enable delete_non_recorded to automatically remove Nostr events for streams that weren't recorded

About

nostr stream events

Resources

Stars

Watchers

Forks

Packages

No packages published