Skip to content

Instantly share code, notes, and snippets.

@shmup
Created January 7, 2024 23:36
Show Gist options
  • Save shmup/fee18c3dcfcb205fd498746049728b6a to your computer and use it in GitHub Desktop.
Save shmup/fee18c3dcfcb205fd498746049728b6a to your computer and use it in GitHub Desktop.
streaming with srs and ffmpeg
:8888 {
root * /crypt
file_server browse
@tsFiles {
path *.ts
}
header @tsFiles Content-Type video/MP2T
log {
output stdout
}
}
.PHONY: ffmpeg
# Ran on host
all: ffmpeg
ffmpeg:
ffmpeg -re -i \
"http://localhost:8888/dinner.m3u8" -c copy -f flv \
rtmp://localhost/live/livestream
version: '3'
services:
srs:
image: ossrs/srs:5
ports:
- "1935:1935" # RTMP live streaming server
- "1985:1985" # HTTP API server
- "8093:8080" # livestream.m3u8 is served here
- "8000:8000/udp" # WebRTC over UDP
- "10080:10080/udp" # SRT protocol
http_server:
image: caddy:2
volumes:
- ./crypt:/crypt
- ./Caddyfile:/etc/caddy/Caddyfile
ports:
- "8888:8888" # frontend, m3u8s, ts chunks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment