Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-04-06 19:13:29 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d546f815dfe4bdf5930e695d4d7b29a6b3657ab1
d546f815
1 parent
c4524484
update build/run/stop script
隐藏空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
32 行增加
和
19 行删除
trunk/auto/depends.sh
trunk/conf/demo.conf
trunk/scripts/_step.build.sh
trunk/scripts/_step.start.srs.19350.sh
trunk/scripts/_step.start.srs.sh
trunk/scripts/run.sh
trunk/scripts/stop.sh
trunk/auto/depends.sh
查看文件 @
d546f81
...
...
@@ -320,7 +320,7 @@ function write_nginx_html5()
END
}
# create the nginx dir, for http-server if not build nginx
mkdir -p
${
SRS_OBJS
}
/nginx
rm -rf
${
SRS_OBJS
}
/nginx
&&
mkdir -p
${
SRS_OBJS
}
/nginx
# make nginx
__SRS_BUILD_NGINX
=
NO;
if
[
$SRS_ARM_UBUNTU12
=
NO
]
;
then if
[
$SRS_NGINX
=
YES
]
;
then
__SRS_BUILD_NGINX
=
YES;
fi fi
if
[
$__SRS_BUILD_NGINX
=
YES
]
;
then
...
...
trunk/conf/demo.conf
查看文件 @
d546f81
...
...
@@ -11,6 +11,17 @@ pid ./objs/srs.demo.pid;
chunk_size
60000
;
max_connections
2000
;
http_api
{
enabled
on
;
listen
1985
;
}
http_stream
{
enabled
on
;
listen
8080
;
dir
./
objs
/
nginx
/
html
;
}
vhost
__
defaultVhost__
{
enabled
on
;
gop_cache
on
;
...
...
trunk/scripts/_step.build.sh
查看文件 @
d546f81
...
...
@@ -3,7 +3,7 @@ src_dir='src'
if
[[
! -d
$src_dir
]]
;
then
echo
"错误:必须在src同目录执行脚本"
;
exit
1;
fi
echo
"编译SRS"
./configure --with-ssl --with-hls --with-
nginx
--with-ffmpeg --with-http-callback
&&
make
./configure --with-ssl --with-hls --with-
http-server
--with-ffmpeg --with-http-callback
&&
make
ret
=
$?
;
if
[[
0 -ne
$ret
]]
;
then
echo
"错误:编译SRS失败"
;
exit
$ret
;
fi
echo
"编译SRS成功"
...
...
trunk/scripts/_step.start.srs.19350.sh
查看文件 @
d546f81
...
...
@@ -4,7 +4,7 @@ if [[ ! -d $src_dir ]]; then echo "错误:必须在src同目录执行脚本";
cmd
=
"./objs/srs -c conf/demo.19350.conf"
echo
"启动SRS转发服务器:
$cmd
"
pids
=
`
ps aux|grep srs|grep
"./objs"
|grep
"demo.19350.conf"
|awk
'{print $2}'
`
;
for
pid
in
$pids
;
do
echo
"结束现有进程:
$pid
"
;
kill
-s SIGKILL
$pid
;
done
pids
=
`
cat ./objs/srs.demo.19350.pid
`
;
for
pid
in
$pids
;
do
echo
"结束现有进程:
$pid
"
;
kill
-s SIGKILL
$pid
;
done
./objs/srs -c conf/demo.19350.conf
ret
=
$?
;
if
[[
0 -ne
$ret
]]
;
then
echo
"错误:启动SRS转发服务器失败"
;
exit
$ret
;
fi
...
...
trunk/scripts/_step.start.srs.sh
查看文件 @
d546f81
...
...
@@ -4,7 +4,7 @@ if [[ ! -d $src_dir ]]; then echo "错误:必须在src同目录执行脚本";
cmd
=
"./objs/srs -c conf/demo.conf"
echo
"启动SRS服务器:
$cmd
"
pids
=
`
ps aux|grep srs|grep
"./objs"
|grep
"demo.conf"
|awk
'{print $2}'
`
;
for
pid
in
$pids
;
do
echo
"结束现有进程:
$pid
"
;
kill
-s SIGKILL
$pid
;
done
pids
=
`
cat ./objs/srs.demo.pid
`
;
for
pid
in
$pids
;
do
echo
"结束现有进程:
$pid
"
;
kill
-s SIGKILL
$pid
;
done
./objs/srs -c conf/demo.conf
ret
=
$?
;
if
[[
0 -ne
$ret
]]
;
then
echo
"错误:启动SRS失败"
;
exit
$ret
;
fi
...
...
trunk/scripts/run.sh
查看文件 @
d546f81
...
...
@@ -17,8 +17,9 @@ bash scripts/_step.start.srs.sh; ret=$?; if [[ 0 -ne $ret ]]; then exit $ret; fi
# step 3(optinal): start srs listen at 19350 to forward to
bash scripts/_step.start.srs.19350.sh;
ret
=
$?
;
if
[[
0 -ne
$ret
]]
;
then
exit
$ret
;
fi
# REMOVED: for we use srs-http-server instead.
# step 4(optinal): start nginx for HLS
bash scripts/_step.start.nginx.sh;
ret
=
$?
;
if
[[
0 -ne
$ret
]]
;
then
exit
$ret
;
fi
#
bash scripts/_step.start.nginx.sh; ret=$?; if [[ 0 -ne $ret ]]; then exit $ret; fi
# step 5(optinal): start http hooks for srs callback
bash scripts/_step.start.api.server.sh;
ret
=
$?
;
if
[[
0 -ne
$ret
]]
;
then
exit
$ret
;
fi
...
...
@@ -31,18 +32,18 @@ bash scripts/_step.start.ffmpeg.players.sh; ret=$?; if [[ 0 -ne $ret ]]; then ex
# step 8: add server ip to client hosts as demo.
ip
=
`
ifconfig|grep
"inet"
|grep
"addr"
|grep
"Mask"
|grep -v
"127.0.0.1"
|awk
'NR==1 {print $2}'
|awk -F
':'
'{print $2}'
`
port
=
8085
cat
<<END
默认的12路流演示:
http://$ip/players
http://$ip
:$port
/players
默认的播放器流演示:
http://$ip/players/srs_player.html?vhost=players
http://$ip
:$port
/players/srs_player.html?vhost=players
推流(主播)应用演示:
http://$ip/players/srs_publisher.html?vhost=players
http://$ip
:$port
/players/srs_publisher.html?vhost=players
视频会议(聊天室)应用演示:
http://$ip/players/srs_chat.html?vhost=players
http://$ip
:$port
/players/srs_chat.html?vhost=players
默认的测速应用演示:
http://$ip
/players/srs_bwt.html?key=35c9b402c12a7246868752e2878f7e0e&vhost=bandcheck.srs.com
http://$ip:$port
/players/srs_bwt.html?key=35c9b402c12a7246868752e2878f7e0e&vhost=bandcheck.srs.com
END
echo
-e
"
${
GREEN
}
演示地址:
${
BLACK
}
"
echo
-e
"
${
RED
}
http://
$ip
${
BLACK
}
"
echo
-e
"
${
RED
}
http://
$ip
:8085
${
BLACK
}
"
echo
-e
"
${
RED
}
http://
$ip
:
$port
${
BLACK
}
"
...
...
trunk/scripts/stop.sh
查看文件 @
d546f81
...
...
@@ -2,18 +2,19 @@
echo
"停止SRS服务器"
ps aux|grep srs|grep
"./objs"
|grep
"demo.conf"
pids
=
`
ps aux|grep srs|grep
"./objs"
|grep
"demo.conf"
|awk
'{print $2}'
`
;
for
pid
in
$pids
;
do
echo
"结束现有进程:
$pid
"
;
kill
-s SIGKILL
$pid
;
done
pids
=
`
cat ./objs/srs.demo.pid
`
;
for
pid
in
$pids
;
do
echo
"结束现有进程:
$pid
"
;
kill
-s SIGKILL
$pid
;
done
echo
"停止SRS转发服务器"
ps aux|grep srs|grep
"./objs"
|grep
"demo.19350.conf"
pids
=
`
ps aux|grep srs|grep
"./objs"
|grep
"demo.19350.conf"
|awk
'{print $2}'
`
;
for
pid
in
$pids
;
do
echo
"结束现有进程:
$pid
"
;
kill
-s SIGKILL
$pid
;
done
pids
=
`
cat ./objs/srs.demo.19350.pid
`
;
for
pid
in
$pids
;
do
echo
"结束现有进程:
$pid
"
;
kill
-s SIGKILL
$pid
;
done
# REMOVED: for we use srs-http-server instead.
# step 4(optinal): start nginx for HLS
echo
"停止NGINX(HLS服务)"
ps aux|grep nginx|grep process
if
[[
-f ./objs/nginx/logs/nginx.pid
]]
;
then
pids
=
`
cat ./objs/nginx/logs/nginx.pid
`
;
for
pid
in
$pids
;
do
echo
"结束现有进程:
$pid
"
; sudo
kill
-s SIGTERM
$pid
;
done
fi
#echo "停止NGINX(HLS服务)"
#ps aux|grep nginx|grep process
#if [[ -f ./objs/nginx/logs/nginx.pid ]]; then
# pids=`cat ./objs/nginx/logs/nginx.pid`; for pid in $pids; do echo "结束现有进程:$pid"; sudo kill -s SIGTERM $pid; done
#fi
# step 5(optinal): start http hooks for srs callback
echo
"停止API服务器"
...
...
请
注册
或
登录
后发表评论