1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +00:00
srs/trunk/conf/srs.conf

279 lines
9.2 KiB
Text
Raw Normal View History

2013-11-09 12:56:35 +00:00
# the listen ports, split by space.
2013-11-28 11:25:56 +00:00
listen 1935;
2013-11-09 12:56:35 +00:00
# the default chunk size is 128, max is 65536,
# some client does not support chunk size change,
# however, most clients supports it and it can improve
# performance about 10%.
# if not specified, set to 4096.
chunk_size 65000;
2013-11-09 12:56:35 +00:00
# vhost list, the __defaultVhost__ is the default vhost
# for which cannot identify the required vhost.
2013-11-02 09:55:59 +00:00
vhost __defaultVhost__ {
2013-11-23 11:15:11 +00:00
enabled on;
2013-11-28 11:25:56 +00:00
gop_cache on;
2013-11-23 11:15:11 +00:00
hls on;
2013-11-26 08:45:50 +00:00
hls_path ./objs/nginx/html;
hls_fragment 5;
hls_window 30;
2013-11-30 08:23:01 +00:00
#forward 127.0.0.1:1936;
transcode {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
2013-11-30 08:23:01 +00:00
engine fd{
2013-11-30 10:31:07 +00:00
enabled on;
2013-11-30 08:23:01 +00:00
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;
2013-11-30 08:23:01 +00:00
}
}
}
# transcode all app and stream of vhost
vhost all.transcode.vhost.com {
# the streaming transcode configs.
2013-11-30 08:23:01 +00:00
transcode {
# whether the transcode enabled.
# if off, donot transcode.
2013-11-30 13:02:21 +00:00
# default: off.
enabled on;
2013-11-30 08:23:01 +00:00
# the ffmpeg
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
2013-11-30 10:31:07 +00:00
# the transcode engine for matched stream.
2013-11-30 08:23:01 +00:00
# all matched stream will transcoded to the following stream.
# the transcode set name(ie. hd) is optional and not used.
engine super{
2013-11-30 10:31:07 +00:00
# whether the engine is enabled
2013-11-30 13:02:21 +00:00
# default: off.
2013-11-30 10:31:07 +00:00
enabled on;
2013-11-30 08:23:01 +00:00
# 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;
2013-11-30 08:23:01 +00:00
}
engine hd{
2013-11-30 10:31:07 +00:00
enabled on;
2013-11-30 08:23:01 +00:00
vcodec libx264;
vbitrate 1200;
vfps 25;
vwidth 1024;
vheight 576;
vthreads 6;
vprofile main;
vpreset medium;
vparams {
}
2013-11-30 08:23:01 +00:00
acodec libaacplus;
abitrate 70;
asample_rate 44100;
achannels 2;
aparams {
}
output rtmp://[vhost]:[port]/[app]/[stream]_hd;
2013-11-30 08:23:01 +00:00
}
engine sd{
2013-11-30 10:31:07 +00:00
enabled on;
2013-11-30 08:23:01 +00:00
vcodec libx264;
vbitrate 800;
vfps 25;
vwidth 720;
vheight 480;
vthreads 4;
vprofile main;
vpreset fast;
vparams {
}
2013-11-30 08:23:01 +00:00
acodec libaacplus;
abitrate 60;
asample_rate 44100;
achannels 2;
aparams {
}
output rtmp://[vhost]:[port]/[app]/[stream]_sd;
2013-11-30 08:23:01 +00:00
}
engine fast{
2013-11-30 10:31:07 +00:00
enabled on;
2013-11-30 08:23:01 +00:00
vcodec libx264;
vbitrate 300;
vfps 20;
vwidth 480;
vheight 320;
vthreads 2;
vprofile baseline;
vpreset superfast;
vparams {
}
2013-11-30 08:23:01 +00:00
acodec libaacplus;
abitrate 30;
asample_rate 22050;
achannels 2;
aparams {
}
output rtmp://[vhost]:[port]/[app]/[stream]_fast;
2013-11-30 08:23:01 +00:00
}
}
2013-11-27 15:27:55 +00:00
}
2013-11-30 10:31:07 +00:00
# transcode all app and stream of app
vhost app.transcode.vhost.com {
# the streaming transcode configs.
# if app specified, transcode all streams of app.
transcode live {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine fd{
enabled off;
}
}
}
# transcode specified stream.
vhost stream.transcode.vhost.com {
# the streaming transcode configs.
# if stream specified, transcode the matched stream.
transcode live/livestream {
enabled on;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine fd{
enabled off;
}
}
}
2013-11-27 15:27:55 +00:00
# the vhost which forward publish streams.
vhost forward.vhost.com {
# forward all publish stream to the specified server.
# this used to split/forward the current stream for cluster active-standby,
# active-active for cdn to build high available fault tolerance system.
# format: {ip}:{port} {ip_N}:{port_N}
forward 127.0.0.1:1936 127.0.0.1:1937;
2013-11-02 09:55:59 +00:00
}
2013-11-09 12:56:35 +00:00
# the vhost disabled.
2013-11-04 14:55:19 +00:00
vhost removed.vhost.com {
# whether the vhost is enabled.
# if off, all request access denied.
# default: on
enabled off;
}
2013-11-23 11:15:11 +00:00
# the vhost with hls specified.
vhost no-hls.vhost.com {
# whether the hls is enabled.
# if off, donot write hls(ts and m3u8) when publish.
# default: on
hls on;
# the hls output path.
2013-11-26 08:45:50 +00:00
# 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;
2013-11-26 09:21:49 +00:00
# the hls fragment in seconds, the duration of a piece of ts.
# default: 10
hls_fragment 10;
# the hls window in seconds, the number of ts in m3u8.
# default: 60
hls_window 60;
2013-11-23 11:15:11 +00:00
}
2013-11-23 10:20:02 +00:00
# the vhost with hls disabled.
vhost no-hls.vhost.com {
# whether the hls is enabled.
# if off, donot write hls(ts and m3u8) when publish.
# default: on
hls off;
}
2013-11-09 12:56:35 +00:00
# the vhost for min delay, donot cache any stream.
2013-11-04 14:55:19 +00:00
vhost min.delay.com {
# whether cache the last gop.
# if on, cache the last gop and dispatch to client,
# to enable fast startup for client, client play immediately.
# if off, send the latest media data to client,
# client need to wait for the next Iframe to decode and show the video.
# set to off if requires min delay;
# set to on if requires client fast startup.
# default: on
2013-11-04 14:42:03 +00:00
gop_cache off;
}
2013-11-09 12:56:35 +00:00
# the vhost for antisuck.
2013-11-04 14:55:19 +00:00
vhost refer.anti_suck.com {
# the common refer for play and publish.
# if the page url of client not in the refer, access denied.
# if not specified this field, allow all.
# default: not specified.
refer github.com github.io;
# refer for publish clients specified.
# the common refer is not overrided by this.
# if not specified this field, allow all.
# default: not specified.
refer_publish github.com github.io;
# refer for play clients specified.
# the common refer is not overrided by this.
# if not specified this field, allow all.
# default: not specified.
refer_play github.com github.io;
}
# config for the pithy print,
# which always print constant message specified by interval,
# whatever the clients in concurrency.
pithy_print {
# shared print interval for all publish clients, in milliseconds.
# if not specified, set to 1100.
publish 2000;
# shared print interval for all play clients, in milliseconds.
# if not specified, set to 1300.
2013-11-29 14:20:51 +00:00
play 3000;
# shared print interval for all forwarders, in milliseconds.
# if not specified, set to 2000.
forwarder 3000;
}
2013-11-04 14:42:03 +00:00
2013-11-30 08:23:01 +00:00