流媒体服务器
# SRS
# 安装
version: "2"
services:
srs:
restart: "always"
container_name: srs
image: registry.cn-hangzhou.aliyuncs.com/ossrs/srs:5
ports:
- "1935:1935"
- "1985:1985"
- "8080:8080"
- "8000:8000"
environment:
CANDIDATE: 能访问到的地址
# 推流
# RTMP
ffmpeg -re -i zz.mp4 -vcodec libx264 -acodec aac -f flv "rtmp://192.168.1.100/live/livestream"
# 播放地址:
RTMP: rtmp://192.168.1.100/live/livestream
HLS: http://192.168.1.100:8080/live/livestream.m3u8
FLV: http://localhost:8080/live/livestream.flv
# ZLM
# 安装
version: "2"
services:
ZLMediaKit:
restart: "always"
container_name: ZLMediaKit
image: zlmediakit/zlmediakit:master
ports:
- "554:554"
- "554:554/udp"
- "1935:1935"
- "1935:1935/udp"
- "15060:15060"
- "15060:15060/udp"
- "443:443"
- "80:80"
- "10000:10000/tcp"
- "10000:10000/udp"
- "35000-35200:35000-35200/tcp"
- "35000-35200:35000-35200/udp"
volumes:
- ./conf:/opt/media/conf
# 推流
# 使用rtsp方式推流
# h264推流
ffmpeg -re -i "/path/to/test.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test
# h265推流
ffmpeg -re -i "/path/to/test.mp4" -vcodec h265 -acodec aac -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test
# 使用rtmp方式推流
# rtmp推流
ffmpeg -re -i "/path/to/test.mp4" -vcodec h264 -acodec aac -f flv rtmp://127.0.0.1/live/test
# 使用rtp方式推流
# h264推流
ffmpeg -re -i "/path/to/test.mp4" -vcodec h264 -acodec aac -f rtp_mpegts rtp://127.0.0.1:10000
# h265推流
ffmpeg -re -i "/path/to/test.mp4" -vcodec h265 -acodec aac -f rtp_mpegts rtp://127.0.0.1:10000
上次更新: 2024/03/05, 13:24:49