demo.conf 5.4 KB

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