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
2013-11-26 16:45:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
57ea56970d86879e7354e9668748e1b3f26b1d19
57ea5697
1 parent
5841cfaf
add nginx and used as http server
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
39 行增加
和
6 行删除
README.md
trunk/3rdparty/nginx-1.5.0.zip
trunk/conf/srs.conf
trunk/configure
trunk/src/core/srs_core.hpp
trunk/src/core/srs_core_config.hpp
README.md
查看文件 @
57ea569
...
...
@@ -21,7 +21,7 @@ step 2: start srs <br/>
</pre>
step 3(optional): start nginx for HLS
<br/>
<pre>
sudo ./objs/nginx/
_release/
sbin/nginx
sudo ./objs/nginx/sbin/nginx
</pre>
step 4: publish live stream
<br/>
<pre>
...
...
trunk/3rdparty/nginx-1.5.0.zip
0 → 100644
查看文件 @
57ea569
不能预览此文件类型
trunk/conf/srs.conf
查看文件 @
57ea569
...
...
@@ -12,7 +12,7 @@ vhost __defaultVhost__ {
enabled
on
;
gop_cache
on
;
hls
on
;
hls_path
./
hls
;
hls_path
./
objs
/
nginx
/
html
;
}
# the vhost disabled.
vhost
removed
.
vhost
.
com
{
...
...
@@ -28,8 +28,17 @@ vhost no-hls.vhost.com {
# default: on
hls
on
;
# the hls output path.
# default: ./hls
hls_path
/
data
/
nginx
/
html
/
hls
;
# the app dir is auto created under the hls_path.
# for example, for rtmp stream:
# rtmp://127.0.0.1/live/livestream
# http://127.0.0.1/live/livestream.m3u8
# where hls_path is /hls, srs will create the following files:
# /hls/live the app dir for all streams.
# /hls/live/livestream.m3u8 the HLS m3u8 file.
# /hls/live/livestream-1.ts the HLS media/ts file.
# in a word, the hls_path is for vhost.
# default: ./objs/nginx/html
hls_path
/
data
/
nginx
/
html
;
}
# the vhost with hls disabled.
vhost
no
-
hls
.
vhost
.
com
{
...
...
trunk/configure
查看文件 @
57ea569
...
...
@@ -46,6 +46,28 @@ ret=$?; if [[ $ret -ne 0 ]]; then echo "build http-parser-2.1 failed, ret=$ret";
if
[[
! -f
${
GLOBAL_DIR_OBJS
}
/http-parser-2.1/http_parser.h
]]
;
then
echo
"build http-parser-2.1 failed"
;
exit
-1;
fi
if
[[
! -f
${
GLOBAL_DIR_OBJS
}
/http-parser-2.1/libhttp_parser.a
]]
;
then
echo
"build http-parser-2.1 failed"
;
exit
-1;
fi
# nginx for HLS, nginx-1.5.0
if
[[
-f
${
GLOBAL_DIR_OBJS
}
/nginx-1.5.0/_release/sbin/nginx
]]
;
then
echo
"nginx-1.5.0 is ok."
;
else
echo
"build nginx-1.5.0"
;
(
rm -rf
${
GLOBAL_DIR_OBJS
}
/nginx-1.5.0
&&
cd
${
GLOBAL_DIR_OBJS
}
&&
unzip -q ../3rdparty/nginx-1.5.0.zip
&&
cd
nginx-1.5.0
&&
./configure --prefix
=
`
pwd
`
/_release
&&
make
&&
make install
&&
ln -sf
`
pwd
`
/_release ../nginx
)
fi
# check status
ret
=
$?
;
if
[[
$ret
-ne 0
]]
;
then
echo
"build nginx-1.5.0 failed, ret=
$ret
"
;
exit
$ret
;
fi
if
[
! -f
${
GLOBAL_DIR_OBJS
}
/nginx-1.5.0/_release/sbin/nginx
]
;
then
echo
"build nginx-1.5.0 failed."
;
exit
-1;
fi
# use current user to config nginx,
# srs will write ts/m3u8 file use current user,
# nginx default use nobody, so cannot read the ts/m3u8 created by srs.
cp
${
GLOBAL_DIR_OBJS
}
/nginx/conf/nginx.conf
${
GLOBAL_DIR_OBJS
}
/nginx/conf/nginx.conf.bk
sed -i
"s/^.user nobody;/user
`
whoami
`
;/g"
${
GLOBAL_DIR_OBJS
}
/nginx/conf/nginx.conf
#####################################################################################
# generate Makefile.
#####################################################################################
...
...
@@ -141,3 +163,5 @@ echo 'configure ok! '
echo
"you can:"
echo
"
\"
make
\"
to build the srs(simple rtmp server)."
echo
"
\"
make help
\"
to get the usage of make"
echo
"
\"
sudo ./objs/nginx/sbin/nginx
\"
to start the nginx http server for hls"
echo
"
\"
./objs/simple_rtmp_server -c conf/srs.conf
\"
to start the srs live server"
...
...
trunk/src/core/srs_core.hpp
查看文件 @
57ea569
...
...
@@ -63,7 +63,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
(void)0
// current release version
#define RTMP_SIG_SRS_VERSION "0.
4
.0"
#define RTMP_SIG_SRS_VERSION "0.
5
.0"
// server info.
#define RTMP_SIG_SRS_KEY "srs"
#define RTMP_SIG_SRS_ROLE "origin server"
...
...
trunk/src/core/srs_core_config.hpp
查看文件 @
57ea569
...
...
@@ -37,7 +37,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// default vhost for rtmp
#define RTMP_VHOST_DEFAULT "__defaultVhost__"
#define SRS_CONF_DEFAULT_HLS_PATH "./
hls
"
#define SRS_CONF_DEFAULT_HLS_PATH "./
objs/nginx/html
"
class
SrsFileBuffer
{
...
...
请
注册
或
登录
后发表评论