A lightweight, single-file video streaming service written in Go that supports hardware-accelerated transcoding and multiple streaming formats. Upload videos and get instant HLS and DASH streaming URLs.
- HLS (HTTP Live Streaming)
- DASH (Dynamic Adaptive Streaming over HTTP)
- AVC (H.264) - Best compatibility
- HEVC (H.265) - Better compression
- AV1 - Next-gen codec with superior compression
- macOS: VideoToolbox
- NVIDIA: NVENC
- AMD: AMF
- Intel: QuickSync
- Go 1.19 or later
- FFmpeg with hardware acceleration support
- 8GB+ RAM recommended
- Storage space for video processing
- Clone the repository:
git clone https://github.com/yourusername/agomi-video-go.git
cd agomi-video-go- Install FFmpeg:
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt update
sudo apt install ffmpeg
# Windows (using Chocolatey)
choco install ffmpeg- Create a
.envfile:
PORT=3000
STORAGE_PATH=./videos
HW_ACCEL=macos # Options: macos, nvidia, amd, intel
- Run the server:
go run main.go- Open
index.htmlin your browser or serve it using a static file server.
POST /api/videos?codec=avc- Supported codec query parameters:
avc,hevc,av1 - Returns HLS and DASH URLs
- HLS:
http://localhost:3000/hls/{videoId}/playlist.m3u8 - DASH:
http://localhost:3000/dash/{videoId}/manifest.mpd
- No additional setup required
- Set
HW_ACCEL=macosin.env
- Install NVIDIA drivers
- Install CUDA toolkit
- Set
HW_ACCEL=nvidiain.env
- Install AMD drivers
- Set
HW_ACCEL=amdin.env
- Enable Intel QuickSync
- Set
HW_ACCEL=intelin.env
- Hardware acceleration significantly improves transcoding speed
- AV1 encoding is currently software-only and slower
- HEVC offers better compression than AVC at the cost of compatibility
- Default settings prioritize speed over quality
MIT License
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.