winlin

Update srs.conf

@@ -21,194 +21,6 @@ vhost __defaultVhost__ { @@ -21,194 +21,6 @@ vhost __defaultVhost__ {
21 enabled on; 21 enabled on;
22 gop_cache on; 22 gop_cache on;
23 } 23 }
24 -# vhost list, the __defaultVhost__ is the default vhost  
25 -# for example, user use ip to access the stream: rtmp://192.168.1.2/live/livestream.  
26 -# for which cannot identify the required vhost.  
27 -# for default demo.  
28 -vhost demo.srs.com {  
29 - chunk_size 60000;  
30 - enabled on;  
31 - gop_cache on;  
32 - queue_length 30;  
33 - forward 127.0.0.1:19350;  
34 - bandcheck {  
35 - enabled off;  
36 - }  
37 - hls {  
38 - enabled on;  
39 - hls_path ./objs/nginx/html;  
40 - hls_fragment 5;  
41 - hls_window 30;  
42 - }  
43 - http_hooks {  
44 - enabled on;  
45 - on_connect http://127.0.0.1:8085/api/v1/clients;  
46 - on_close http://127.0.0.1:8085/api/v1/clients;  
47 - on_publish http://127.0.0.1:8085/api/v1/streams;  
48 - on_unpublish http://127.0.0.1:8085/api/v1/streams;  
49 - on_play http://127.0.0.1:8085/api/v1/sessions;  
50 - on_stop http://127.0.0.1:8085/api/v1/sessions;  
51 - }  
52 - transcode {  
53 - enabled on;  
54 - ffmpeg ./objs/ffmpeg/bin/ffmpeg;  
55 - engine ld {  
56 - enabled on;  
57 - vfilter {  
58 - vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontsize=30:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf';  
59 - }  
60 - vcodec libx264;  
61 - vbitrate 300;  
62 - vfps 20;  
63 - vwidth 768;  
64 - vheight 320;  
65 - vthreads 1;  
66 - vprofile baseline;  
67 - vpreset superfast;  
68 - vparams {  
69 - }  
70 - acodec libaacplus;  
71 - abitrate 45;  
72 - asample_rate 44100;  
73 - achannels 2;  
74 - aparams {  
75 - }  
76 - output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];  
77 - }  
78 - engine sd {  
79 - enabled on;  
80 - vfilter {  
81 - vf 'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2';  
82 - }  
83 - vcodec libx264;  
84 - vbitrate 500;  
85 - vfps 20;  
86 - vwidth 768;  
87 - vheight 320;  
88 - vthreads 1;  
89 - vprofile main;  
90 - vpreset fast;  
91 - vparams {  
92 - }  
93 - acodec libaacplus;  
94 - abitrate 40;  
95 - asample_rate 44100;  
96 - achannels 2;  
97 - aparams {  
98 - }  
99 - output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];  
100 - }  
101 - }  
102 -}  
103 -# for the players site, to play or publish.  
104 -# the flash player publisher need to transcode to support hls,  
105 -# we add players_hls vhost to support it.  
106 -vhost players {  
107 - enabled on;  
108 - gop_cache on;  
109 - transcode {  
110 - enabled on;  
111 - ffmpeg ./objs/ffmpeg/bin/ffmpeg;  
112 - engine hls {  
113 - enabled on;  
114 - vfilter {  
115 - vf 'drawtext=text=SRS(SimpleRtmpServer):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf';  
116 - }  
117 - vcodec libx264;  
118 - vbitrate 300;  
119 - vfps 20;  
120 - vwidth 768;  
121 - vheight 320;  
122 - vthreads 1;  
123 - vprofile baseline;  
124 - vpreset superfast;  
125 - vparams {  
126 - }  
127 - acodec libaacplus;  
128 - abitrate 30;  
129 - asample_rate 44100;  
130 - achannels 2;  
131 - aparams {  
132 - }  
133 - output rtmp://127.0.0.1:[port]/[app]?vhost=players_pub/[stream];  
134 - }  
135 - }  
136 -}  
137 -vhost players_pub {  
138 - hls {  
139 - enabled on;  
140 - hls_path ./objs/nginx/html;  
141 - hls_fragment 5;  
142 - hls_window 30;  
143 - }  
144 -}  
145 -# rtmp only, no hls, for chat(low latecy)  
146 -vhost players_pub_rtmp {  
147 - gop_cache off;  
148 - hls {  
149 - enabled off;  
150 - }  
151 -}  
152 -  
153 -# for development  
154 -vhost dev {  
155 - enabled on;  
156 - gop_cache on;  
157 - queue_length 10;  
158 - #forward 127.0.0.1:19350;  
159 - hls {  
160 - enabled off;  
161 - hls_path ./objs/nginx/html;  
162 - hls_fragment 5;  
163 - hls_window 30;  
164 - }  
165 - http_hooks {  
166 - enabled off;  
167 - on_connect http://127.0.0.1:8085/api/v1/clients;  
168 - on_close http://127.0.0.1:8085/api/v1/clients;  
169 - on_publish http://127.0.0.1:8085/api/v1/streams;  
170 - on_unpublish http://127.0.0.1:8085/api/v1/streams;  
171 - on_play http://127.0.0.1:8085/api/v1/sessions;  
172 - on_stop http://127.0.0.1:8085/api/v1/sessions;  
173 - }  
174 - transcode {  
175 - enabled off;  
176 - ffmpeg ./objs/ffmpeg/bin/ffmpeg;  
177 - engine dev {  
178 - enabled on;  
179 - vfilter {  
180 - }  
181 - vcodec libx264;  
182 - vbitrate 300;  
183 - vfps 20;  
184 - vwidth 768;  
185 - vheight 320;  
186 - vthreads 1;  
187 - vprofile baseline;  
188 - vpreset superfast;  
189 - vparams {  
190 - }  
191 - acodec libaacplus;  
192 - abitrate 45;  
193 - asample_rate 44100;  
194 - achannels 2;  
195 - aparams {  
196 - }  
197 - output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];  
198 - }  
199 - engine dev_acodec {  
200 - enabled on;  
201 - vcodec copy;  
202 - acodec libaacplus;  
203 - abitrate 45;  
204 - asample_rate 44100;  
205 - achannels 2;  
206 - aparams {  
207 - }  
208 - output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];  
209 - }  
210 - }  
211 -}  
212 24
213 # vhost for bandwidth check 25 # vhost for bandwidth check
214 # generally, the bandcheck vhost must be: bandcheck.srs.com, 26 # generally, the bandcheck vhost must be: bandcheck.srs.com,
@@ -834,5 +646,193 @@ pithy_print { @@ -834,5 +646,193 @@ pithy_print {
834 # if not specified, set to 2000. 646 # if not specified, set to 2000.
835 hls 3000; 647 hls 3000;
836 } 648 }
  649 +# vhost list, the __defaultVhost__ is the default vhost
  650 +# for example, user use ip to access the stream: rtmp://192.168.1.2/live/livestream.
  651 +# for which cannot identify the required vhost.
  652 +# for default demo.
  653 +vhost demo.srs.com {
  654 + chunk_size 60000;
  655 + enabled on;
  656 + gop_cache on;
  657 + queue_length 30;
  658 + forward 127.0.0.1:19350;
  659 + bandcheck {
  660 + enabled off;
  661 + }
  662 + hls {
  663 + enabled on;
  664 + hls_path ./objs/nginx/html;
  665 + hls_fragment 5;
  666 + hls_window 30;
  667 + }
  668 + http_hooks {
  669 + enabled on;
  670 + on_connect http://127.0.0.1:8085/api/v1/clients;
  671 + on_close http://127.0.0.1:8085/api/v1/clients;
  672 + on_publish http://127.0.0.1:8085/api/v1/streams;
  673 + on_unpublish http://127.0.0.1:8085/api/v1/streams;
  674 + on_play http://127.0.0.1:8085/api/v1/sessions;
  675 + on_stop http://127.0.0.1:8085/api/v1/sessions;
  676 + }
  677 + transcode {
  678 + enabled on;
  679 + ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  680 + engine ld {
  681 + enabled on;
  682 + vfilter {
  683 + vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontsize=30:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf';
  684 + }
  685 + vcodec libx264;
  686 + vbitrate 300;
  687 + vfps 20;
  688 + vwidth 768;
  689 + vheight 320;
  690 + vthreads 1;
  691 + vprofile baseline;
  692 + vpreset superfast;
  693 + vparams {
  694 + }
  695 + acodec libaacplus;
  696 + abitrate 45;
  697 + asample_rate 44100;
  698 + achannels 2;
  699 + aparams {
  700 + }
  701 + output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
  702 + }
  703 + engine sd {
  704 + enabled on;
  705 + vfilter {
  706 + vf 'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2';
  707 + }
  708 + vcodec libx264;
  709 + vbitrate 500;
  710 + vfps 20;
  711 + vwidth 768;
  712 + vheight 320;
  713 + vthreads 1;
  714 + vprofile main;
  715 + vpreset fast;
  716 + vparams {
  717 + }
  718 + acodec libaacplus;
  719 + abitrate 40;
  720 + asample_rate 44100;
  721 + achannels 2;
  722 + aparams {
  723 + }
  724 + output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
  725 + }
  726 + }
  727 +}
  728 +# for the players site, to play or publish.
  729 +# the flash player publisher need to transcode to support hls,
  730 +# we add players_hls vhost to support it.
  731 +vhost players {
  732 + enabled on;
  733 + gop_cache on;
  734 + transcode {
  735 + enabled on;
  736 + ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  737 + engine hls {
  738 + enabled on;
  739 + vfilter {
  740 + vf 'drawtext=text=SRS(SimpleRtmpServer):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf';
  741 + }
  742 + vcodec libx264;
  743 + vbitrate 300;
  744 + vfps 20;
  745 + vwidth 768;
  746 + vheight 320;
  747 + vthreads 1;
  748 + vprofile baseline;
  749 + vpreset superfast;
  750 + vparams {
  751 + }
  752 + acodec libaacplus;
  753 + abitrate 30;
  754 + asample_rate 44100;
  755 + achannels 2;
  756 + aparams {
  757 + }
  758 + output rtmp://127.0.0.1:[port]/[app]?vhost=players_pub/[stream];
  759 + }
  760 + }
  761 +}
  762 +vhost players_pub {
  763 + hls {
  764 + enabled on;
  765 + hls_path ./objs/nginx/html;
  766 + hls_fragment 5;
  767 + hls_window 30;
  768 + }
  769 +}
  770 +# rtmp only, no hls, for chat(low latecy)
  771 +vhost players_pub_rtmp {
  772 + gop_cache off;
  773 + hls {
  774 + enabled off;
  775 + }
  776 +}
  777 +
  778 +# for development
  779 +vhost dev {
  780 + enabled on;
  781 + gop_cache on;
  782 + queue_length 10;
  783 + #forward 127.0.0.1:19350;
  784 + hls {
  785 + enabled off;
  786 + hls_path ./objs/nginx/html;
  787 + hls_fragment 5;
  788 + hls_window 30;
  789 + }
  790 + http_hooks {
  791 + enabled off;
  792 + on_connect http://127.0.0.1:8085/api/v1/clients;
  793 + on_close http://127.0.0.1:8085/api/v1/clients;
  794 + on_publish http://127.0.0.1:8085/api/v1/streams;
  795 + on_unpublish http://127.0.0.1:8085/api/v1/streams;
  796 + on_play http://127.0.0.1:8085/api/v1/sessions;
  797 + on_stop http://127.0.0.1:8085/api/v1/sessions;
  798 + }
  799 + transcode {
  800 + enabled off;
  801 + ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  802 + engine dev {
  803 + enabled on;
  804 + vfilter {
  805 + }
  806 + vcodec libx264;
  807 + vbitrate 300;
  808 + vfps 20;
  809 + vwidth 768;
  810 + vheight 320;
  811 + vthreads 1;
  812 + vprofile baseline;
  813 + vpreset superfast;
  814 + vparams {
  815 + }
  816 + acodec libaacplus;
  817 + abitrate 45;
  818 + asample_rate 44100;
  819 + achannels 2;
  820 + aparams {
  821 + }
  822 + output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
  823 + }
  824 + engine dev_acodec {
  825 + enabled on;
  826 + vcodec copy;
  827 + acodec libaacplus;
  828 + abitrate 45;
  829 + asample_rate 44100;
  830 + achannels 2;
  831 + aparams {
  832 + }
  833 + output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
  834 + }
  835 + }
  836 +}
837 837
838 838