1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #319, support query the vhost info.

This commit is contained in:
winlin 2015-08-29 16:12:30 +08:00
parent bdfd0ae09e
commit a79e19599c
3 changed files with 716 additions and 151 deletions

View file

@ -49,6 +49,11 @@ daemon on;
# if on, use gmtime() instead, which use UTC time.
# default: off
utc_time off;
# config for the pithy print,
# which always print constant message specified by interval,
# whatever the clients in concurrency.
# default: 10000
pithy_print_ms 10000;
#############################################################################################
# heartbeat/stats sections
@ -998,6 +1003,92 @@ vhost exec.srs.com {
}
}
# vhost for bandwidth check
# generally, the bandcheck vhost must be: bandcheck.srs.com,
# or need to modify the vhost of client.
vhost bandcheck.srs.com {
enabled on;
chunk_size 65000;
# bandwidth check config.
bandcheck {
# whether support bandwidth check,
# default: off.
enabled on;
# the key for server to valid,
# if invalid key, server disconnect and abort the bandwidth check.
key "35c9b402c12a7246868752e2878f7e0e";
# the interval in seconds for bandwidth check,
# server donot allow new test request.
# default: 30
interval 30;
# the max available check bandwidth in kbps.
# to avoid attack of bandwidth check.
# default: 1000
limit_kbps 4000;
}
}
# set the chunk size of vhost.
vhost chunksize.srs.com {
# the default chunk size is 128, max is 65536,
# some client does not support chunk size change,
# vhost chunk size will override the global value.
# default: global chunk size.
chunk_size 128;
}
# vhost for time jitter
vhost jitter.srs.com {
# about the stream monotonically increasing:
# 1. video timestamp is monotonically increasing,
# 2. audio timestamp is monotonically increasing,
# 3. video and audio timestamp is interleaved/mixed monotonically increasing.
# it's specified by RTMP specification, @see 3. Byte Order, Alignment, and Time Format
# however, some encoder cannot provides this feature, please set this to off to ignore time jitter.
# the time jitter algorithm:
# 1. full, to ensure stream start at zero, and ensure stream monotonically increasing.
# 2. zero, only ensure sttream start at zero, ignore timestamp jitter.
# 3. off, disable the time jitter algorithm, like atc.
# default: full
time_jitter full;
# whether use the interleaved/mixed algorithm to correct the timestamp.
# if on, always ensure the timestamp of audio+video is interleaved/mixed monotonically increase.
# if off, use time_jitter to correct the timestamp if required.
# default: off
mix_correct off;
}
# vhost for atc.
vhost atc.srs.com {
# vhost for atc for hls/hds/rtmp backup.
# generally, atc default to off, server delivery rtmp stream to client(flash) timestamp from 0.
# when atc is on, server delivery rtmp stream by absolute time.
# atc is used, for instance, encoder will copy stream to master and slave server,
# server use atc to delivery stream to edge/client, where stream time from master/slave server
# is always the same, client/tools can slice RTMP stream to HLS according to the same time,
# if the time not the same, the HLS stream cannot slice to support system backup.
#
# @see http://www.adobe.com/cn/devnet/adobe-media-server/articles/varnish-sample-for-failover.html
# @see http://www.baidu.com/#wd=hds%20hls%20atc
#
# default: off
atc on;
# whether enable the auto atc,
# if enabled, detect the bravo_atc="true" in onMetaData packet,
# set atc to on if matched.
# always ignore the onMetaData if atc_auto is off.
# default: on
atc_auto on;
}
# the vhost disabled.
vhost removed.srs.com {
# whether the vhost is enabled.
# if off, all request access denied.
# default: on
enabled off;
}
# the main comments for transcode
vhost example.transcode.srs.com {
# the streaming transcode configs.
@ -1441,95 +1532,3 @@ vhost stream.transcode.srs.com {
}
}
}
# vhost for bandwidth check
# generally, the bandcheck vhost must be: bandcheck.srs.com,
# or need to modify the vhost of client.
vhost bandcheck.srs.com {
enabled on;
chunk_size 65000;
# bandwidth check config.
bandcheck {
# whether support bandwidth check,
# default: off.
enabled on;
# the key for server to valid,
# if invalid key, server disconnect and abort the bandwidth check.
key "35c9b402c12a7246868752e2878f7e0e";
# the interval in seconds for bandwidth check,
# server donot allow new test request.
# default: 30
interval 30;
# the max available check bandwidth in kbps.
# to avoid attack of bandwidth check.
# default: 1000
limit_kbps 4000;
}
}
# set the chunk size of vhost.
vhost chunksize.srs.com {
# the default chunk size is 128, max is 65536,
# some client does not support chunk size change,
# vhost chunk size will override the global value.
# default: global chunk size.
chunk_size 128;
}
# vhost for time jitter
vhost jitter.srs.com {
# about the stream monotonically increasing:
# 1. video timestamp is monotonically increasing,
# 2. audio timestamp is monotonically increasing,
# 3. video and audio timestamp is interleaved/mixed monotonically increasing.
# it's specified by RTMP specification, @see 3. Byte Order, Alignment, and Time Format
# however, some encoder cannot provides this feature, please set this to off to ignore time jitter.
# the time jitter algorithm:
# 1. full, to ensure stream start at zero, and ensure stream monotonically increasing.
# 2. zero, only ensure sttream start at zero, ignore timestamp jitter.
# 3. off, disable the time jitter algorithm, like atc.
# default: full
time_jitter full;
# whether use the interleaved/mixed algorithm to correct the timestamp.
# if on, always ensure the timestamp of audio+video is interleaved/mixed monotonically increase.
# if off, use time_jitter to correct the timestamp if required.
# default: off
mix_correct off;
}
# vhost for atc.
vhost atc.srs.com {
# vhost for atc for hls/hds/rtmp backup.
# generally, atc default to off, server delivery rtmp stream to client(flash) timestamp from 0.
# when atc is on, server delivery rtmp stream by absolute time.
# atc is used, for instance, encoder will copy stream to master and slave server,
# server use atc to delivery stream to edge/client, where stream time from master/slave server
# is always the same, client/tools can slice RTMP stream to HLS according to the same time,
# if the time not the same, the HLS stream cannot slice to support system backup.
#
# @see http://www.adobe.com/cn/devnet/adobe-media-server/articles/varnish-sample-for-failover.html
# @see http://www.baidu.com/#wd=hds%20hls%20atc
#
# default: off
atc on;
# whether enable the auto atc,
# if enabled, detect the bravo_atc="true" in onMetaData packet,
# set atc to on if matched.
# always ignore the onMetaData if atc_auto is off.
# default: on
atc_auto on;
}
# the vhost disabled.
vhost removed.srs.com {
# whether the vhost is enabled.
# if off, all request access denied.
# default: on
enabled off;
}
# config for the pithy print,
# which always print constant message specified by interval,
# whatever the clients in concurrency.
# default: 10000
pithy_print_ms 10000;

View file

@ -0,0 +1,320 @@
listen 1935;
pid ./objs/srs.pid;
chunk_size 60000;
ff_log_dir ./objs;
srs_log_tank console;
srs_log_level trace;
srs_log_file ./objs/srs.log;
max_connections 1000;
daemon off;
utc_time off;
pithy_print_ms 10000;
heartbeat {
enabled off;
interval 9.3;
url http://127.0.0.1:8085/api/v1/servers;
device_id my-srs-device;
summaries off;
}
stats {
network 0;
disk sda sdb xvda xvdb;
}
http_api {
enabled on;
listen 1985;
crossdomain on;
raw_api {
enabled on;
allow_reload on;
allow_query on;
}
}
http_server {
enabled off;
listen 8080;
dir ./objs/nginx/html;
}
stream_caster {
enabled off;
caster mpegts_over_udp;
output rtmp://127.0.0.1/live/livestream;
listen 8935;
rtp_port_min 57200;
rtp_port_max 57300;
}
stream_caster {
enabled off;
caster mpegts_over_udp;
output rtmp://127.0.0.1/live/livestream;
listen 8935;
}
stream_caster {
enabled off;
caster rtsp;
output rtmp://127.0.0.1/[app]/[stream];
listen 554;
rtp_port_min 57200;
rtp_port_max 57300;
}
stream_caster {
enabled off;
caster flv;
output rtmp://127.0.0.1/[app]/[stream];
listen 8936;
}
vhost __defaultVhost__ {
}
vhost vhost.srs.com {
enabled off;
mode remote;
origin 127.0.0.1:1935 localhost:1935;
token_traverse off;
vhost same.edge.srs.com;
forward 127.0.0.1:1936 127.0.0.1:1937;
debug_srs_upnode off;
chunk_size 128;
time_jitter full;
mix_correct off;
atc on;
atc_auto on;
min_latency on;
mr {
enabled off;
}
mw_latency 100;
gop_cache off;
queue_length 10;
tcp_nodelay on;
send_min_interval 10.0;
reduce_sequence_header on;
publish_1stpkt_timeout 20000;
publish_normal_timeout 7000;
refer github.com github.io;
refer_publish github.com github.io;
refer_play github.com github.io;
bandcheck {
enabled off;
key 35c9b402c12a7246868752e2878f7e0e;
interval 30;
limit_kbps 4000;
}
security {
enabled off;
allow play all;
allow publish all;
}
http_static {
enabled off;
mount [vhost]/hls;
dir ./objs/nginx/html/hls;
}
http_remux {
enabled off;
fast_cache 30;
mount [vhost]/[app]/[stream].flv;
hstrs on;
}
http_hooks {
enabled off;
on_connect http://127.0.0.1:8085/api/v1/clients http://localhost:8085/api/v1/clients;
on_close http://127.0.0.1:8085/api/v1/clients http://localhost:8085/api/v1/clients;
on_publish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams;
on_unpublish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams;
on_play http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions;
on_stop http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions;
on_dvr http://127.0.0.1:8085/api/v1/dvrs http://localhost:8085/api/v1/dvrs;
on_hls http://127.0.0.1:8085/api/v1/hls http://localhost:8085/api/v1/hls;
on_hls_notify http://127.0.0.1:8085/api/v1/hls/[app]/[stream][ts_url];
}
hls {
enabled off;
hls_fragment 10;
hls_td_ratio 1.5;
hls_aof_ratio 2.0;
hls_window 60;
hls_on_error ignore;
hls_storage disk;
hls_path ./objs/nginx/html;
hls_m3u8_file [app]/[stream].m3u8;
hls_ts_file [app]/[stream]-[seq].ts;
hls_ts_floor off;
hls_entry_prefix http://your-server;
hls_mount [vhost]/[app]/[stream].m3u8;
hls_acodec aac;
hls_vcodec h264;
hls_cleanup on;
hls_dispose 0;
hls_nb_notify 64;
hls_wait_keyframe on;
}
hds {
enabled off;
hds_fragment 10;
hds_window 60;
hds_path ./objs/nginx/html;
}
exec {
enabled off;
publish ./objs/ffmpeg/bin/ffmpeg -f flv -i [url] -c copy -y ./[stream].flv;
}
dvr {
enabled off;
dvr_plan session;
dvr_path ./objs/nginx/html/[app]/[stream].[timestamp].flv;
dvr_duration 30;
dvr_wait_keyframe on;
time_jitter full;
}
ingest livestream {
enabled off;
input {
type file;
url ./doc/source.200kbps.768x320.flv;
}
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine {
enabled off;
output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
}
}
transcode {
enabled off;
ffmpeg ./objs/ffmpeg/bin/ffmpeg;
engine ffsuper {
enabled off;
iformat flv;
vfilter {
i ./doc/ffmpeg-logo.png;
filter_complex overlay=10:10;
}
vcodec libx264;
vbitrate 1500;
vfps 25;
vwidth 768;
vheight 320;
vthreads 12;
vprofile main;
vpreset medium;
vparams {
t 100;
coder 1;
b_strategy 2;
bf 3;
refs 10;
}
acodec libfdk_aac;
abitrate 70;
asample_rate 44100;
achannels 2;
aparams {
profile:a aac_low;
}
oformat flv;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine ffhd {
enabled off;
vcodec libx264;
vbitrate 1200;
vfps 25;
vwidth 1382;
vheight 576;
vthreads 6;
vprofile main;
vpreset medium;
vparams;
acodec libfdk_aac;
abitrate 70;
asample_rate 44100;
achannels 2;
aparams;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine ffsd {
enabled off;
vcodec libx264;
vbitrate 800;
vfps 25;
vwidth 1152;
vheight 480;
vthreads 4;
vprofile main;
vpreset fast;
vparams;
acodec libfdk_aac;
abitrate 60;
asample_rate 44100;
achannels 2;
aparams;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine fffast {
enabled off;
vcodec libx264;
vbitrate 300;
vfps 20;
vwidth 768;
vheight 320;
vthreads 2;
vprofile baseline;
vpreset superfast;
vparams;
acodec libfdk_aac;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine vcopy {
enabled off;
vcodec copy;
acodec libfdk_aac;
abitrate 45;
asample_rate 44100;
achannels 2;
aparams;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine acopy {
enabled off;
vcodec libx264;
vbitrate 300;
vfps 20;
vwidth 768;
vheight 320;
vthreads 2;
vprofile baseline;
vpreset superfast;
vparams;
acodec copy;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
engine copy {
enabled off;
vcodec copy;
acodec copy;
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
}
}
}