forked from galaxy-s10/billd-live-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
srs.sh
41 lines (32 loc) · 1.06 KB
/
srs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
###
# Author: shuisheng
# Date: 2023-04-29 22:33:50
# Description:
# Email: [email protected]
# FilePath: /billd-live-server/srs.sh
# Github: https://github.com/galaxy-s10
# LastEditors: shuisheng
# LastEditTime: 2023-05-11 10:34:45
###
# 生成头部文件快捷键:ctrl+cmd+i
# For macOS
CANDIDATE=$(ifconfig en0 inet | grep 'inet ' | awk '{print $2}')
JOBNAME=billd-live-server-srs
echo 停掉旧的容器$JOBNAME:
docker stop $JOBNAME
echo 删掉旧的容器$JOBNAME:
docker rm $JOBNAME
echo 启动新的容器$JOBNAME:
# -d, 后台运行
# -p :80:8080, 将容器的8080端口映射到主机的80端口
# RTC to RTMP
docker run -d --name $JOBNAME --rm --env CANDIDATE=$CANDIDATE \
-p 1935:1935 -p 5001:8080 -p 1985:1985 -p 8000:8000/udp \
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:4 \
objs/srs -c conf/rtc2rtmp.conf
# RTC to RTC
# docker run -d --name $JOBNAME --rm --env CANDIDATE=$CANDIDATE \
# -p 1935:1935 -p 5001:8080 -p 1985:1985 -p 8000:8000/udp \
# registry.cn-hangzhou.aliyuncs.com/ossrs/srs:4 \
# objs/srs -c conf/rtc.conf