winlin

change server name to demo, dev used for development vhost

@@ -42,33 +42,33 @@ For example, use ffmpeg to publish: @@ -42,33 +42,33 @@ For example, use ffmpeg to publish:
42 sleep 1; \ 42 sleep 1; \
43 done 43 done
44 </pre> 44 </pre>
45 -step 6: add server ip to hosts as dev. <br/> 45 +step 6: add server ip to hosts as demo. <br/>
46 <pre> 46 <pre>
47 # edit the folowing file: 47 # edit the folowing file:
48 # linux: /etc/hosts 48 # linux: /etc/hosts
49 # windows: C:\Windows\System32\drivers\etc\hosts 49 # windows: C:\Windows\System32\drivers\etc\hosts
50 -192.168.2.111 dev 50 +192.168.2.111 demo
51 </pre> 51 </pre>
52 step 7: play live stream. <br/> 52 step 7: play live stream. <br/>
53 <pre> 53 <pre>
54 -rtmp url: rtmp://dev:1935/live/livestream  
55 -m3u8 url: http://dev:80/live/livestream.m3u8 54 +rtmp url: rtmp://demo:1935/live/livestream
  55 +m3u8 url: http://demo:80/live/livestream.m3u8
56 </pre> 56 </pre>
57 step 8: play live stream auto transcoded<br/> 57 step 8: play live stream auto transcoded<br/>
58 <pre> 58 <pre>
59 -rtmp url: rtmp://dev:1935/live/livestream_ld  
60 -m3u8 url: http://dev:80/live/livestream_ld.m3u8  
61 -rtmp url: rtmp://dev:1935/live/livestream_sd  
62 -m3u8 url: http://dev:80/live/livestream_sd.m3u8 59 +rtmp url: rtmp://demo:1935/live/livestream_ld
  60 +m3u8 url: http://demo:80/live/livestream_ld.m3u8
  61 +rtmp url: rtmp://demo:1935/live/livestream_sd
  62 +m3u8 url: http://demo:80/live/livestream_sd.m3u8
63 </pre> 63 </pre>
64 step 9: play live stream auto forwarded, the hls dir change to /forward<br/> 64 step 9: play live stream auto forwarded, the hls dir change to /forward<br/>
65 <pre> 65 <pre>
66 -rtmp url: rtmp://dev:19350/live/livestream  
67 -m3u8 url: http://dev:80/forward/live/livestream.m3u8  
68 -rtmp url: rtmp://dev:19350/live/livestream_ld  
69 -m3u8 url: http://dev:80/forward/live/livestream_ld.m3u8  
70 -rtmp url: rtmp://dev:19350/live/livestream_sd  
71 -m3u8 url: http://dev:80/forward/live/livestream_sd.m3u8 66 +rtmp url: rtmp://demo:19350/live/livestream
  67 +m3u8 url: http://demo:80/forward/live/livestream.m3u8
  68 +rtmp url: rtmp://demo:19350/live/livestream_ld
  69 +m3u8 url: http://demo:80/forward/live/livestream_ld.m3u8
  70 +rtmp url: rtmp://demo:19350/live/livestream_sd
  71 +m3u8 url: http://demo:80/forward/live/livestream_sd.m3u8
72 </pre> 72 </pre>
73 73
74 ### System Requirements 74 ### System Requirements
@@ -8,6 +8,7 @@ listen 1935; @@ -8,6 +8,7 @@ listen 1935;
8 chunk_size 65000; 8 chunk_size 65000;
9 # vhost list, the __defaultVhost__ is the default vhost 9 # vhost list, the __defaultVhost__ is the default vhost
10 # for which cannot identify the required vhost. 10 # for which cannot identify the required vhost.
  11 +# for default demo.
11 vhost __defaultVhost__ { 12 vhost __defaultVhost__ {
12 enabled on; 13 enabled on;
13 gop_cache on; 14 gop_cache on;
@@ -15,7 +16,7 @@ vhost __defaultVhost__ { @@ -15,7 +16,7 @@ vhost __defaultVhost__ {
15 hls_path ./objs/nginx/html; 16 hls_path ./objs/nginx/html;
16 hls_fragment 5; 17 hls_fragment 5;
17 hls_window 30; 18 hls_window 30;
18 - #forward 127.0.0.1:19350; 19 + forward 127.0.0.1:19350;
19 transcode { 20 transcode {
20 enabled on; 21 enabled on;
21 ffmpeg ./objs/ffmpeg/bin/ffmpeg; 22 ffmpeg ./objs/ffmpeg/bin/ffmpeg;
@@ -68,6 +69,42 @@ vhost __defaultVhost__ { @@ -68,6 +69,42 @@ vhost __defaultVhost__ {
68 } 69 }
69 } 70 }
70 } 71 }
  72 +# for development
  73 +vhost dev {
  74 + enabled on;
  75 + gop_cache on;
  76 + hls on;
  77 + hls_path ./objs/nginx/html;
  78 + hls_fragment 5;
  79 + hls_window 30;
  80 + forward dev:19350;
  81 + transcode {
  82 + enabled on;
  83 + ffmpeg ./objs/ffmpeg/bin/ffmpeg;
  84 + engine dev{
  85 + enabled on;
  86 + vfilter {
  87 + }
  88 + vcodec libx264;
  89 + vbitrate 300;
  90 + vfps 20;
  91 + vwidth 768;
  92 + vheight 320;
  93 + vthreads 1;
  94 + vprofile baseline;
  95 + vpreset superfast;
  96 + vparams {
  97 + }
  98 + acodec libaacplus;
  99 + abitrate 30;
  100 + asample_rate 44100;
  101 + achannels 2;
  102 + aparams {
  103 + }
  104 + output rtmp://[vhost]:[port]/[app]/[stream]_dev;
  105 + }
  106 + }
  107 +}
71 # the mirror filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#Filtering-Introduction 108 # the mirror filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#Filtering-Introduction
72 vhost mirror.transcode.vhost.com { 109 vhost mirror.transcode.vhost.com {
73 transcode { 110 transcode {