goTube

No description available.

goTube

goTube is a simple, self-contained live video streaming server written in Go. It allows you to broadcast from OBS Studio (or any RTMP-capable encoder) and play the livestream directly in your browser via HLS. No external RTMP or HLS server setup required — everything is handled by goTube!

Features

  • Accepts RTMP streams (e.g. from OBS)
  • Converts RTMP to HLS using ffmpeg (automatically run by goTube)
  • Serves a modern web player (Video.js) at http://localhost:8585/
  • Completely self-hosted and easy to use

Requirements

  • Go 1.18 or higher
  • ffmpeg installed and available in your PATH
  • OBS Studio or another RTMP source

Installation

  1. Clone the repo:

    git clone https://github.com/SarahRoseLives/goTube.git
    cd goTube
  2. Build the server:

    go build -o goTube main.go
  3. Make sure the directories exist:

    mkdir -p hls static

    (If you use the provided main.go and static/index.html, these directories should be present.)


Usage

  1. Start the goTube server:

    ./goTube

    You should see output like:

    Serving web player on http://localhost:8585/
    Waiting for RTMP stream at rtmp://localhost:1935/live/stream...
    
  2. Configure OBS Studio:

    • Go to SettingsStream
    • Service: Custom...
    • Server: rtmp://localhost:1935/live/stream
    • Stream Key: (can be anything, e.g. stream)
    • OBS Stream Settings Example
  3. Start streaming from OBS.

  4. Open your browser and go to:

    http://localhost:8585/
    

    You should see the player. After a few seconds (once segments are generated), your live video will appear.


How It Works

  • goTube starts a web server on port 8585 and runs ffmpeg in the background.
  • ffmpeg listens for RTMP on port 1935, and when OBS connects, it converts the RTMP stream to HLS segments in the hls/ directory.
  • The web server serves the web player and the HLS segments, allowing you to watch your stream in real time.

Troubleshooting

  • 404 or player not loading:
    Ensure static/index.html exists and you are running goTube from the correct directory.
  • No video appears:
    Make sure OBS is streaming, and wait a few seconds for the first HLS segments to be generated.
  • ffmpeg: command not found:
    Install ffmpeg and ensure it is available on your system's PATH.

Customization

  • You can modify static/index.html to change the player UI or add features.
  • If you want to stream from another computer, change localhost in the OBS server URL to your server’s IP address, and make sure ports 8585 and 1935 are open.