diff --git a/README.md b/README.md index c7fde385a..37b8ee490 100755 --- a/README.md +++ b/README.md @@ -176,6 +176,7 @@ The ports used by SRS: ## V4 changes +* v4.0, 2021-05-03, Add RTC stream merging demo by FFmpeg. 4.0.97 * v4.0, 2021-05-02, Add one to one demo. 4.0.96 * v4.0, 2021-04-20, Support RTC2RTMP bridger and shared FastTimer. 4.0.95 * v4.0, 2021-04-20, Refine transcoder to support aac2opus and opus2aac. 4.0.94 diff --git a/trunk/3rdparty/signaling/www/demos/js/srs.sig.js b/trunk/3rdparty/signaling/www/demos/js/srs.sig.js index 230629449..0a9ee3d61 100644 --- a/trunk/3rdparty/signaling/www/demos/js/srs.sig.js +++ b/trunk/3rdparty/signaling/www/demos/js/srs.sig.js @@ -100,7 +100,6 @@ function SrsRtcSignalingParse(location) { let wsPort = location.href.split('wsp=')[1]; wsPort = wsPort? wsPort.split('&')[0] : location.host.split(':')[1]; - wsHost = wsPort? wsHost.split(':')[0] + ':' + wsPort : wsHost; let host = location.href.split('host=')[1]; host = host? host.split('&')[0] : location.hostname; @@ -114,6 +113,29 @@ function SrsRtcSignalingParse(location) { let autostart = location.href.split('autostart=')[1]; autostart = autostart && autostart.split('&')[0] === 'true'; + // Remove data in query. + if (query) { + query = query.replace('wss=' + wsSchema, ''); + query = query.replace('wsh=' + wsHost, ''); + query = query.replace('wsp=' + wsPort, ''); + if (room) { + query = query.replace('room=' + room, ''); + } + query = query.replace('display=' + display, ''); + query = query.replace('autostart=' + autostart, ''); + + while (query.indexOf('&&') >= 0) { + query = query.replace('&&', '&'); + } + query = query.replace('?&', '?'); + if (query.lastIndexOf('?') == query.length - 1) { + query = query.substr(0, query.length - 1); + } + } + + // Regenerate the host of websocket. + wsHost = wsPort? wsHost.split(':')[0] + ':' + wsPort : wsHost; + return { query: query, wsSchema: wsSchema, wsHost: wsHost, host: host, room: room, display: display, autostart: autostart, diff --git a/trunk/3rdparty/signaling/www/demos/one2one.html b/trunk/3rdparty/signaling/www/demos/one2one.html index 13724cb09..e4dddb210 100644 --- a/trunk/3rdparty/signaling/www/demos/one2one.html +++ b/trunk/3rdparty/signaling/www/demos/one2one.html @@ -63,6 +63,25 @@ Alert + +
+
+ +
+
+ ffmpeg -f flv -i rtmp://// -f flv -i rtmp://// \
+      -filter_complex "[1:v]scale=w=96:h=72[ckout];[0:v][ckout]overlay=x=W-w-10:y=H-h-10[out]" -map "[out]" \
+      -c:v libx264 -profile:v high -preset medium \
+      -filter_complex amix -c:a aac \
+      -f flv -y rtmp:////merge +
+
+
+