Back to All Guides
codeAugust 15, 20268 min readRTSPLink Dev Team

High-Throughput Go RTSP Stream Relay with gortsplib

Build a blazing fast RTSP proxy server in Golang capable of handling 500+ concurrent video subscribers.

#Go#Golang#gortsplib#High Concurrency#Proxy
Live Stream Workbench

Need a live RTSP stream link right now to test this setup in VLC or OpenCV?

Test Live Stream

#1Go RTSP Client with gortsplib

Connect to an RTSP source and read RTP packets asynchronously in Go:

Go gortsplib Client
package main

import (
	"log"
	"github.com/bluenviron/gortsplib/v4"
	"github.com/bluenviron/gortsplib/v4/pkg/base"
)

func main() {
	c := gortsplib.Client{}
	u, _ := base.ParseURL("rtsp://rtsplink.com/live/test?token=demo")
	err := c.Start(u.Scheme, u.Host)
	if err != nil {
		log.Fatal(err)
	}
	defer c.Close()
	log.Println("Connected to RTSP stream in Go!")
}

Ready to test your live RTSP video stream?

Generate free authenticated RTSP links with unlimited bandwidth and inspect frame timestamps in seconds.

Generate Free RTSP Link

Related Tutorials & Setup Guides

View all 100+ guides