From 15f651bccd47c386f3ceb902a4a5b665d9ba883b Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 11 Apr 2014 14:13:14 +0800 Subject: [PATCH] update demo, support acodec --- trunk/conf/demo.conf | 25 +++++++++++- trunk/research/players/js/srs.page.js | 38 +++++++++++++----- .../players/srs_bwt/release/srs_bwt.swf | Bin 4674 -> 4676 bytes trunk/research/players/srs_chat.html | 17 +++++++- .../players/srs_player/release/srs_player.swf | Bin 5360 -> 5360 bytes trunk/research/players/srs_publisher.html | 17 +++++++- .../srs_publisher/release/srs_publisher.swf | Bin 5205 -> 5306 bytes .../srs_publisher/src/srs_publisher.as | 12 +++++- trunk/src/app/srs_app_codec.cpp | 4 +- trunk/src/app/srs_app_rtmp_conn.cpp | 2 +- trunk/src/app/srs_app_source.cpp | 2 +- 11 files changed, 97 insertions(+), 20 deletions(-) diff --git a/trunk/conf/demo.conf b/trunk/conf/demo.conf index 0ef397807..3383140b0 100644 --- a/trunk/conf/demo.conf +++ b/trunk/conf/demo.conf @@ -180,9 +180,32 @@ vhost players_pub { } } -vhost players_pub_rtmp { +vhost players_chat { gop_cache off; hls { enabled off; } + transcode { + enabled on; + ffmpeg ./objs/ffmpeg/bin/ffmpeg; + engine chat_hls { + enabled on; + vcodec copy; + acodec libaacplus; + abitrate 30; + asample_rate 44100; + achannels 2; + aparams { + } + output rtmp://127.0.0.1:[port]/[app]?vhost=players_pub/[stream]; + } + } +} +vhost chat_hls { + hls { + enabled on; + hls_path ./objs/nginx/html; + hls_fragment 2; + hls_window 8; + } } diff --git a/trunk/research/players/js/srs.page.js b/trunk/research/players/js/srs.page.js index 2a7a58f31..042b6a119 100755 --- a/trunk/research/players/js/srs.page.js +++ b/trunk/research/players/js/srs.page.js @@ -2,6 +2,9 @@ ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// +// to query the swf anti cache. +function srs_get_version_code() { return "1.20"; } + /** * player specified size. */ @@ -9,8 +12,6 @@ function srs_get_player_modal() { return 740; } function srs_get_player_width() { return srs_get_player_modal() - 30; } function srs_get_player_height() { return srs_get_player_width() * 9 / 19; } -// to query the swf anti cache. -function srs_get_version_code() { return "1.19"; } // get the default vhost for players. function srs_get_player_vhost() { return "players"; } // the api server port, for chat room. @@ -23,7 +24,7 @@ function srs_get_srs_http_server_port() { return 8080; } // if not equals to the player vhost, return the orignal vhost. function srs_get_player_publish_vhost(src_vhost) { return (src_vhost != srs_get_player_vhost())? src_vhost:(src_vhost + "_pub"); } // for chat, use rtmp only vhost, low latecy, without gop cache. -function srs_get_player_chat_vhost(src_vhost) { return (src_vhost != srs_get_player_vhost())? src_vhost:(src_vhost + "_pub_rtmp"); } +function srs_get_player_chat_vhost(src_vhost) { return (src_vhost != srs_get_player_vhost())? src_vhost:(src_vhost + "_chat"); } ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// @@ -181,7 +182,8 @@ function srs_can_republish() { // without default values set. function srs_initialize_codec_page( cameras, microphones, - sl_cameras, sl_microphones, sl_vcodec, sl_profile, sl_level, sl_gop, sl_size, sl_fps, sl_bitrate + sl_cameras, sl_microphones, sl_vcodec, sl_profile, sl_level, sl_gop, sl_size, sl_fps, sl_bitrate, + sl_acodec ) { $(sl_cameras).empty(); for (var i = 0; i < cameras.length; i++) { @@ -292,17 +294,25 @@ function srs_initialize_codec_page( for (i = 0; i < bitrates.length; i++) { $(sl_bitrate).append("