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-30 16:23:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a086e2bbfa28b28443b818045da0d6884442c02d
a086e2bb
1 parent
57064237
add transcoding params to config
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
132 行增加
和
2 行删除
trunk/conf/srs.conf
trunk/src/core/srs_core_config.cpp
trunk/src/core/srs_core_error.hpp
trunk/conf/srs.conf
查看文件 @
a086e2b
...
...
@@ -15,7 +15,129 @@ vhost __defaultVhost__ {
hls_path
./
objs
/
nginx
/
html
;
hls_fragment
5
;
hls_window
30
;
forward
127
.
0
.
0
.
1
:
1936
;
#forward 127.0.0.1:1936;
transcode
{
ffmpeg
./
objs
/
ffmpeg
/
bin
/
ffmpeg
;
engine
fd
{
vcodec
libx264
;
vbitrate
300
;
vfps
20
;
vwidth
480
;
vheight
320
;
vthreads
2
;
vprofile
baseline
;
vpreset
superfast
;
vparams
{}
acodec
libaacplus
;
abitrate
30
;
asample_rate
22050
;
achannels
2
;
aparams
{}
output
rtmp
://[
vhost
]:[
port
]/[
app
]/[
stream
]
_
fast
;
}
}
}
# transcode all app and stream of vhost
vhost
all
.
transcode
.
vhost
.
com
{
transcode
{
# the ffmpeg
ffmpeg
./
objs
/
ffmpeg
/
bin
/
ffmpeg
;
# all matched stream will transcoded to the following stream.
# the transcode set name(ie. hd) is optional and not used.
engine
super
{
# video encoder name
vcodec
libx264
;
# video bitrate, in kbps
vbitrate
1500
;
# video framerate.
vfps
25
;
# video width, must be even numbers.
vwidth
1280
;
# video height, must be even numbers.
vheight
720
;
# the max threads for ffmpeg to used.
vthreads
12
;
# x264 profile, @see x264 -help, can be:
# high,main,baseline
vprofile
main
;
# x264 preset, @see x264 -help, can be:
# ultrafast,superfast,veryfast,faster,fast
# medium,slow,slower,veryslow,placebo
vpreset
medium
;
# other x264 or ffmpeg video params
vparams
{
}
# audio encoder name
acodec
libaacplus
;
# audio bitrate, in kbps. [16, 72] for libaacplus.
abitrate
70
;
# audio sample rate. for flv/rtmp, it must be:
# 44100,22050,11025,5512
asample_rate
44100
;
# audio channel, 1 for mono, 2 for stereo.
achannels
2
;
# other ffmpeg audio params
aparams
{
}
# output stream. variables:
# [vhost] the input stream vhost.
# [port] the intput stream port.
# [app] the input stream app.
# [stream] the input stream name.
output
rtmp
://[
vhost
]:[
port
]/[
app
]/[
stream
]
_
super
;
}
engine
hd
{
vcodec
libx264
;
vbitrate
1200
;
vfps
25
;
vwidth
1024
;
vheight
576
;
vthreads
6
;
vprofile
main
;
vpreset
medium
;
vparams
{}
acodec
libaacplus
;
abitrate
70
;
asample_rate
44100
;
achannels
2
;
aparams
{}
output
rtmp
://[
vhost
]:[
port
]/[
app
]/[
stream
]
_
hd
;
}
engine
sd
{
vcodec
libx264
;
vbitrate
800
;
vfps
25
;
vwidth
720
;
vheight
480
;
vthreads
4
;
vprofile
main
;
vpreset
fast
;
vparams
{}
acodec
libaacplus
;
abitrate
60
;
asample_rate
44100
;
achannels
2
;
aparams
{}
output
rtmp
://[
vhost
]:[
port
]/[
app
]/[
stream
]
_
sd
;
}
engine
fast
{
vcodec
libx264
;
vbitrate
300
;
vfps
20
;
vwidth
480
;
vheight
320
;
vthreads
2
;
vprofile
baseline
;
vpreset
superfast
;
vparams
{}
acodec
libaacplus
;
abitrate
30
;
asample_rate
22050
;
achannels
2
;
aparams
{}
output
rtmp
://[
vhost
]:[
port
]/[
app
]/[
stream
]
_
fast
;
}
}
}
# the vhost which forward publish streams.
vhost
forward
.
vhost
.
com
{
...
...
@@ -109,3 +231,4 @@ pithy_print {
forwarder
3000
;
}
...
...
trunk/src/core/srs_core_config.cpp
查看文件 @
a086e2b
...
...
@@ -58,7 +58,7 @@ bool is_common_space(char ch)
return
(
ch
==
' '
||
ch
==
'\t'
||
ch
==
CR
||
ch
==
LF
);
}
#define CONF_BUFFER_SIZE
4096
#define CONF_BUFFER_SIZE
1024 * 1024
SrsFileBuffer
::
SrsFileBuffer
()
{
...
...
@@ -369,6 +369,12 @@ int SrsConfDirective::refill_buffer(SrsFileBuffer* buffer, bool d_quoted, bool s
}
int
size
=
FILE_SIZE
(
buffer
->
fd
)
-
FILE_OFFSET
(
buffer
->
fd
);
if
(
size
>
CONF_BUFFER_SIZE
)
{
ret
=
ERROR_SYSTEM_CONFIG_TOO_LARGE
;
srs_error
(
"config file too large, max=%d, actual=%d, ret=%d"
,
CONF_BUFFER_SIZE
,
size
,
ret
);
return
ret
;
}
if
(
size
<=
0
)
{
return
ERROR_SYSTEM_CONFIG_EOF
;
...
...
trunk/src/core/srs_core_error.hpp
查看文件 @
a086e2b
...
...
@@ -84,6 +84,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define ERROR_SYSTEM_CONFIG_EOF 409
#define ERROR_SYSTEM_STREAM_BUSY 410
#define ERROR_SYSTEM_IP_INVALID 411
#define ERROR_SYSTEM_CONFIG_TOO_LARGE 412
// see librtmp.
// failed when open ssl create the dh
...
...
请
注册
或
登录
后发表评论