diff --git a/README.md b/README.md index 866ea3061..9204d415c 100755 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ For example, use ffmpeg to publish: for((;;)); do \ ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \ -vcodec copy -acodec copy \ - -f flv -y rtmp://127.0.0.1/live/livestream; \ + -f flv -y rtmp://127.0.0.1/live?vhost=demo.srs.com/livestream; \ sleep 1; \ done diff --git a/trunk/conf/srs.19350.conf b/trunk/conf/srs.19350.conf index d40676478..13d32fbba 100755 --- a/trunk/conf/srs.19350.conf +++ b/trunk/conf/srs.19350.conf @@ -3,9 +3,11 @@ chunk_size 65000; vhost __defaultVhost__ { enabled on; gop_cache on; - hls on; - hls_path ./objs/nginx/html/forward; - hls_fragment 5; - hls_window 30; + hls { + enabled on; + hls_path ./objs/nginx/html/forward; + hls_fragment 5; + hls_window 30; + } } diff --git a/trunk/conf/srs.conf b/trunk/conf/srs.conf index 25ac12e61..eb0d225d6 100755 --- a/trunk/conf/srs.conf +++ b/trunk/conf/srs.conf @@ -17,10 +17,17 @@ max_connections 2000; # vhost list, the __defaultVhost__ is the default vhost # for example, user use ip to access the stream: rtmp://192.168.1.2/live/livestream. # for which cannot identify the required vhost. -# for default demo. vhost __defaultVhost__ { enabled on; gop_cache on; +} +# vhost list, the __defaultVhost__ is the default vhost +# for example, user use ip to access the stream: rtmp://192.168.1.2/live/livestream. +# for which cannot identify the required vhost. +# for default demo. +vhost demo.srs.com { + enabled on; + gop_cache on; queue_length 30; forward 127.0.0.1:19350; hls { @@ -44,7 +51,7 @@ vhost __defaultVhost__ { engine ld { enabled on; vfilter { - vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; + vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontsize=30:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; } vcodec libx264; vbitrate 300; @@ -89,6 +96,48 @@ vhost __defaultVhost__ { } } } +# for the players site, to play or publish. +# the flash player publisher need to transcode to support hls, +# we add players_hls vhost to support it. +vhost players { + enabled on; + gop_cache on; + transcode { + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; + engine hls { + enabled on; + vfilter { + vf 'drawtext=text=SRS(SimpleRtmpServer):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; + } + vcodec libx264; + vbitrate 300; + vfps 20; + vwidth 768; + vheight 320; + vthreads 1; + vprofile baseline; + vpreset superfast; + vparams { + } + acodec libaacplus; + abitrate 30; + asample_rate 44100; + achannels 2; + aparams { + } + output rtmp://127.0.0.1:[port]/[app]?vhost=players_pub/[stream]; + } + } +} +vhost players_pub { + hls { + enabled on; + hls_path ./objs/nginx/html; + hls_fragment 5; + hls_window 30; + } +} # for development vhost dev { enabled on; diff --git a/trunk/research/players/index.html b/trunk/research/players/index.html index 916050076..97148ee90 100755 --- a/trunk/research/players/index.html +++ b/trunk/research/players/index.html @@ -17,7 +17,8 @@ $(function(){ update_nav(); - window.location.href = "srs_player.html"; + // direct to the default vhost for players. + window.location.href = "srs_player.html?vhost=" + srs_get_player_vhost(); }); @@ -25,7 +26,7 @@