demo.conf 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. # the config for srs demo
  2. # @see https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleDemo
  3. # @see full.conf for detail config.
  4. listen 1935;
  5. max_connections 1000;
  6. daemon on;
  7. srs_log_tank file;
  8. srs_log_file ./objs/srs.demo.log;
  9. pid ./objs/srs.demo.pid;
  10. chunk_size 60000;
  11. max_connections 2000;
  12. http_api {
  13. enabled on;
  14. listen 1985;
  15. }
  16. http_stream {
  17. enabled on;
  18. listen 8080;
  19. dir ./objs/nginx/html;
  20. }
  21. vhost __defaultVhost__ {
  22. enabled on;
  23. gop_cache on;
  24. }
  25. vhost bandcheck.srs.com {
  26. enabled on;
  27. chunk_size 65000;
  28. bandcheck {
  29. enabled on;
  30. key "35c9b402c12a7246868752e2878f7e0e";
  31. interval 30;
  32. limit_kbps 4000;
  33. }
  34. }
  35. vhost demo.srs.com {
  36. chunk_size 60000;
  37. enabled on;
  38. gop_cache on;
  39. queue_length 30;
  40. forward 127.0.0.1:19350;
  41. bandcheck {
  42. enabled off;
  43. }
  44. hls {
  45. enabled on;
  46. hls_path ./objs/nginx/html;
  47. hls_fragment 5;
  48. hls_window 30;
  49. }
  50. http_hooks {
  51. enabled on;
  52. on_connect http://127.0.0.1:8085/api/v1/clients;
  53. on_close http://127.0.0.1:8085/api/v1/clients;
  54. on_publish http://127.0.0.1:8085/api/v1/streams;
  55. on_unpublish http://127.0.0.1:8085/api/v1/streams;
  56. on_play http://127.0.0.1:8085/api/v1/sessions;
  57. on_stop http://127.0.0.1:8085/api/v1/sessions;
  58. }
  59. transcode {
  60. enabled on;
  61. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  62. engine ld {
  63. enabled on;
  64. vfilter {
  65. i ./doc/srs-logo.png;
  66. filter_complex 'overlay=10:10';
  67. }
  68. vcodec libx264;
  69. vbitrate 300;
  70. vfps 20;
  71. vwidth 768;
  72. vheight 320;
  73. vthreads 1;
  74. vprofile baseline;
  75. vpreset superfast;
  76. vparams {
  77. }
  78. acodec libaacplus;
  79. abitrate 45;
  80. asample_rate 44100;
  81. achannels 2;
  82. aparams {
  83. }
  84. output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
  85. }
  86. engine sd {
  87. enabled on;
  88. vfilter {
  89. vf 'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2';
  90. }
  91. vcodec libx264;
  92. vbitrate 500;
  93. vfps 20;
  94. vwidth 768;
  95. vheight 320;
  96. vthreads 1;
  97. vprofile main;
  98. vpreset fast;
  99. vparams {
  100. }
  101. acodec libaacplus;
  102. abitrate 40;
  103. asample_rate 44100;
  104. achannels 2;
  105. aparams {
  106. }
  107. output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
  108. }
  109. }
  110. ingest {
  111. enabled on;
  112. input {
  113. type file;
  114. url ./doc/source.200kbps.768x320.flv;
  115. }
  116. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  117. engine {
  118. enabled off;
  119. output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
  120. }
  121. }
  122. }
  123. vhost players {
  124. enabled on;
  125. gop_cache on;
  126. transcode {
  127. enabled on;
  128. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  129. engine hls {
  130. enabled on;
  131. vfilter {
  132. i ./doc/srs-logo.png;
  133. filter_complex 'overlay=10:10';
  134. }
  135. vcodec libx264;
  136. vbitrate 300;
  137. vfps 20;
  138. vwidth 768;
  139. vheight 320;
  140. vthreads 1;
  141. vprofile baseline;
  142. vpreset superfast;
  143. vparams {
  144. g 100;
  145. }
  146. acodec libaacplus;
  147. abitrate 30;
  148. asample_rate 44100;
  149. achannels 2;
  150. aparams {
  151. }
  152. output rtmp://127.0.0.1:[port]/[app]?vhost=players_pub/[stream];
  153. }
  154. }
  155. ingest {
  156. enabled on;
  157. input {
  158. type file;
  159. url ./doc/source.200kbps.768x320.flv;
  160. }
  161. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  162. engine {
  163. enabled off;
  164. output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/demo;
  165. }
  166. }
  167. }
  168. vhost players_pub {
  169. hls {
  170. enabled on;
  171. hls_path ./objs/nginx/html;
  172. hls_fragment 5;
  173. hls_window 30;
  174. }
  175. }
  176. vhost players_chat {
  177. gop_cache off;
  178. hls {
  179. enabled off;
  180. }
  181. transcode {
  182. enabled on;
  183. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  184. engine chat_hls {
  185. enabled on;
  186. vfilter {
  187. }
  188. vcodec libx264;
  189. vbitrate 150;
  190. vfps 15;
  191. vwidth 576;
  192. vheight 240;
  193. vthreads 1;
  194. vprofile baseline;
  195. vpreset ultrafast;
  196. vparams {
  197. g 30;
  198. }
  199. acodec an;
  200. output rtmp://127.0.0.1:[port]/[app]?vhost=chat_hls/[stream];
  201. }
  202. }
  203. }
  204. vhost chat_hls {
  205. hls {
  206. enabled on;
  207. hls_path ./objs/nginx/html;
  208. hls_fragment 2;
  209. hls_window 10;
  210. }
  211. }