demo.conf 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. # the config for srs demo
  2. # @see https://github.com/ossrs/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_server {
  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 {
  41. enabled on;
  42. destination 127.0.0.1:19350;
  43. }
  44. bandcheck {
  45. enabled off;
  46. }
  47. hls {
  48. enabled on;
  49. hls_path ./objs/nginx/html;
  50. hls_fragment 5;
  51. hls_window 30;
  52. }
  53. http_hooks {
  54. enabled on;
  55. on_connect http://127.0.0.1:8085/api/v1/clients;
  56. on_close http://127.0.0.1:8085/api/v1/clients;
  57. on_publish http://127.0.0.1:8085/api/v1/streams;
  58. on_unpublish http://127.0.0.1:8085/api/v1/streams;
  59. on_play http://127.0.0.1:8085/api/v1/sessions;
  60. on_stop http://127.0.0.1:8085/api/v1/sessions;
  61. }
  62. transcode {
  63. enabled on;
  64. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  65. engine ld {
  66. enabled on;
  67. vfilter {
  68. i ./doc/srs-logo.png;
  69. filter_complex 'overlay=10:10';
  70. }
  71. vcodec libx264;
  72. vbitrate 300;
  73. vfps 20;
  74. vwidth 768;
  75. vheight 320;
  76. vthreads 1;
  77. vprofile baseline;
  78. vpreset superfast;
  79. vparams {
  80. }
  81. acodec libfdk_aac;
  82. abitrate 45;
  83. asample_rate 44100;
  84. achannels 2;
  85. aparams {
  86. }
  87. output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
  88. }
  89. engine sd {
  90. enabled on;
  91. vfilter {
  92. vf 'split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2';
  93. }
  94. vcodec libx264;
  95. vbitrate 500;
  96. vfps 20;
  97. vwidth 768;
  98. vheight 320;
  99. vthreads 1;
  100. vprofile main;
  101. vpreset fast;
  102. vparams {
  103. }
  104. acodec libfdk_aac;
  105. abitrate 40;
  106. asample_rate 44100;
  107. achannels 2;
  108. aparams {
  109. }
  110. output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
  111. }
  112. }
  113. ingest {
  114. enabled on;
  115. input {
  116. type file;
  117. url ./doc/source.200kbps.768x320.flv;
  118. }
  119. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  120. engine {
  121. enabled off;
  122. output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
  123. }
  124. }
  125. }
  126. vhost players {
  127. enabled on;
  128. gop_cache on;
  129. transcode {
  130. enabled on;
  131. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  132. engine hls {
  133. enabled on;
  134. vfilter {
  135. i ./doc/srs-logo.png;
  136. filter_complex 'overlay=10:10';
  137. }
  138. vcodec libx264;
  139. vbitrate 300;
  140. vfps 20;
  141. vwidth 768;
  142. vheight 320;
  143. vthreads 1;
  144. vprofile baseline;
  145. vpreset superfast;
  146. vparams {
  147. g 100;
  148. }
  149. acodec libfdk_aac;
  150. abitrate 30;
  151. asample_rate 44100;
  152. achannels 2;
  153. aparams {
  154. }
  155. output rtmp://127.0.0.1:[port]/[app]?vhost=players_pub/[stream];
  156. }
  157. }
  158. ingest {
  159. enabled on;
  160. input {
  161. type file;
  162. url ./doc/source.200kbps.768x320.flv;
  163. }
  164. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  165. engine {
  166. enabled off;
  167. output rtmp://127.0.0.1:[port]/live?vhost=[vhost]/demo;
  168. }
  169. }
  170. }
  171. vhost players_pub {
  172. hls {
  173. enabled on;
  174. hls_path ./objs/nginx/html;
  175. hls_fragment 5;
  176. hls_window 30;
  177. }
  178. }
  179. vhost players_chat {
  180. gop_cache off;
  181. hls {
  182. enabled off;
  183. }
  184. transcode {
  185. enabled on;
  186. ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  187. engine chat_hls {
  188. enabled on;
  189. vfilter {
  190. }
  191. vcodec libx264;
  192. vbitrate 150;
  193. vfps 15;
  194. vwidth 576;
  195. vheight 240;
  196. vthreads 1;
  197. vprofile baseline;
  198. vpreset ultrafast;
  199. vparams {
  200. g 30;
  201. }
  202. acodec an;
  203. output rtmp://127.0.0.1:[port]/[app]?vhost=chat_hls/[stream];
  204. }
  205. }
  206. }
  207. vhost chat_hls {
  208. hls {
  209. enabled on;
  210. hls_path ./objs/nginx/html;
  211. hls_fragment 2;
  212. hls_window 10;
  213. }
  214. }