Created
January 7, 2024 23:36
-
-
Save shmup/fee18c3dcfcb205fd498746049728b6a to your computer and use it in GitHub Desktop.
streaming with srs and ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:8888 { | |
root * /crypt | |
file_server browse | |
@tsFiles { | |
path *.ts | |
} | |
header @tsFiles Content-Type video/MP2T | |
log { | |
output stdout | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: ffmpeg | |
# Ran on host | |
all: ffmpeg | |
ffmpeg: | |
ffmpeg -re -i \ | |
"http://localhost:8888/dinner.m3u8" -c copy -f flv \ | |
rtmp://localhost/live/livestream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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