cargomedia / janus-gateway-rtpbroadcast Goto Github PK
View Code? Open in Web Editor NEWUNMAINTAINED. Janus-gateway plugin to broadcast RTP video
UNMAINTAINED. Janus-gateway plugin to broadcast RTP video
Currently we send 0
at least for "remb-avg" on the first info. I assume it's because there's not enough data available? If this is really an invalid reading, could we send null
Instead?
cc @zazabe
Let's track configuration which should be persistent in the config file.
Configs:
@tomaszdurka what should we configure regarding cm-janus
? Probably nothing?
The websocket connection is closed by janus when a list
request is received:
cm-janus log
{"time":"2016-05-26T10:47:54.386Z","level":"info","message":"Added connection","janus":{"connectionId":"31fa2e1e-caeb-4605-a994-c2739afb720d"}}
{"time":"2016-05-26T10:47:54.536Z","level":"info","message":"Added session","janus":{"sessionId":227270996,"connectionId":"31fa2e1e-caeb-4605-a994-c2739afb720d"}}
{"time":"2016-05-26T10:47:54.689Z","level":"info","message":"Added plugin","janus":{"pluginId":703128171,"sessionId":227270996,"connectionId":"31fa2e1e-caeb-4605-a994-c2739afb720d"}}
{"time":"2016-05-26T10:47:54.793Z","level":"error","message":"Unexpected proxy error. Closing proxy connection.","exception":{"janus":"message","body":{"request":"list"},"transaction":"j8DYZWS7GclL","token":"{\"sessionId\":\"79d17eb8833d05028f44f065a4efb4c3\"}","session_id":227270996,"handle_id":703128171}}
{"time":"2016-05-26T10:47:54.794Z","level":"info","message":"Removed plugin","janus":{"pluginId":703128171,"sessionId":227270996,"connectionId":"31fa2e1e-caeb-4605-a994-c2739afb720d"}}
{"time":"2016-05-26T10:47:54.794Z","level":"info","message":"Removed session","janus":{"sessionId":227270996,"connectionId":"31fa2e1e-caeb-4605-a994-c2739afb720d"}}
{"time":"2016-05-26T10:47:54.794Z","level":"info","message":"Removed connection","janus":{"connectionId":"31fa2e1e-caeb-4605-a994-c2739afb720d"}}
janus video log:
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] 20 (LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION)
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] WebSocket connection opened from 127.0.0.1 by localhost
[Thu May 26 10:47:54 2016] Checking if 127.0.0.1 is allowed to contact janus interface
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] WebSocket connection accepted
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] -- Ready to be used!
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] Got 110 bytes:
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] First fragment: 110 bytes, 0 remaining
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] Done, parsing message: 110 bytes
[Thu May 26 10:47:54 2016] Got a Janus API request from janus.transport.websockets (0x2636bd0)
[Thu May 26 10:47:54 2016] Transport task pool, serving request
[Thu May 26 10:47:54 2016] Creating new session: 227270996
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] Allocating 136 bytes (response is 100 bytes)
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] Sending WebSocket message (100 bytes)...
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] -- Sent 100/100 bytes
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] Got 173 bytes:
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] First fragment: 173 bytes, 0 remaining
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] Done, parsing message: 173 bytes
[Thu May 26 10:47:54 2016] Got a Janus API request from janus.transport.websockets (0x2636bd0)
[Thu May 26 10:47:54 2016] Transport task pool, serving request
[Thu May 26 10:47:54 2016] Creating new handle in session 227270996: 703128171
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] Re-allocating to 164 bytes (was 136, response is 128 bytes)
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] Sending WebSocket message (128 bytes)...
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] -- Sent 128/128 bytes
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] WS connection closed
[Thu May 26 10:47:54 2016] A janus.transport.websockets transport instance has gone away (0x2636bd0)
[Thu May 26 10:47:54 2016] -- Marking Session 227270996 as over
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] Destroying WebSocket client
[Thu May 26 10:47:54 2016] [WSS-0x2603c80] -- closed
RTP experiment 1:
RTP experiment 2:
WebRTC experiment 1:
WebRTC experiment 2:
Thoughts:
it seems that rtpbroadcast is a little outdate.
will try to fix this.
How to reproduce it:
&debug
to the url to get the debug panel)bulldog
box, use this command:root@bulldog:/home/vagrant# tc qdisc add dev eth1 root handle 1: netem delay 0ms loss 90%
main.video
unit connectionpacket-loss
constraint:tc qdisc del dev eth1 root
My env (provisioned yesterday):
vagrant@sk:~$ dpkg -l | grep janus
ii janus 0.0.9.git1.088882-wheezy1 amd64 Janus is an open source, general purpose, WebRTC gateway
ii janus-gateway-audioroom 0.0.9-wheezy1 amd64 Cargomedia propretary Janus Audioroom plugin
ii janus-gateway-rtpbroadcast 0.0.12-wheezy1 amd64 Cargomedia propretary Janus RTP broadcast plugin
Result:
main.video
unit keep trying to establish a connection with janus-rtpbroadcast.dev.cargomedia.ch
:cm_janus_video logs
{"time":"2016-04-14T07:01:26.814Z","level":"info","message":"Removed stream","streamId":"105e3127-2291-43a6-95de-0f7f20c0c6ed","channelId":"482b147f090ad9b2b30e70b48cfbaf75","channelKey":"58R3gg3CN1GKyaxZNC5MOw__","pluginId":2323942351,"sessionId":4127462380,"connectionId":"3b1cbbf9-e587-48f3-9a65-5870a0e32ae0"}
{"time":"2016-04-14T07:01:26.815Z","level":"info","message":"Removed plugin","pluginId":2323942351,"sessionId":4127462380,"connectionId":"3b1cbbf9-e587-48f3-9a65-5870a0e32ae0"}
{"time":"2016-04-14T07:01:26.816Z","level":"info","message":"Removed session","sessionId":4127462380,"connectionId":"3b1cbbf9-e587-48f3-9a65-5870a0e32ae0"}
{"time":"2016-04-14T07:01:29.674Z","level":"info","message":"Removed connection","connectionId":"3b1cbbf9-e587-48f3-9a65-5870a0e32ae0"}
{"time":"2016-04-14T07:01:29.822Z","level":"info","message":"Removed stream","streamId":"9a2896f4-73ba-4355-8cff-c20d18bdb340","channelId":"482b147f090ad9b2b30e70b48cfbaf75","channelKey":"58R3gg3CN1GKyaxZNC5MOw__","pluginId":1979157660,"sessionId":3273447074,"connectionId":"04aab27e-a204-4b45-8245-4bac85ee40f2"}
{"time":"2016-04-14T07:01:29.823Z","level":"info","message":"Removed plugin","pluginId":1979157660,"sessionId":3273447074,"connectionId":"04aab27e-a204-4b45-8245-4bac85ee40f2"}
{"time":"2016-04-14T07:01:29.824Z","level":"info","message":"Removed plugin","pluginId":1979157660,"sessionId":3273447074,"connectionId":"04aab27e-a204-4b45-8245-4bac85ee40f2"}
{"time":"2016-04-14T07:01:29.824Z","level":"info","message":"Removed session","sessionId":3273447074,"connectionId":"04aab27e-a204-4b45-8245-4bac85ee40f2"}
{"time":"2016-04-14T07:01:29.824Z","level":"info","message":"Removed connection","connectionId":"04aab27e-a204-4b45-8245-4bac85ee40f2"}
{"time":"2016-04-14T07:01:29.825Z","level":"info","message":"Removed session","sessionId":3273447074,"connectionId":"04aab27e-a204-4b45-8245-4bac85ee40f2"}
{"time":"2016-04-14T07:01:29.825Z","level":"info","message":"Removed connection","connectionId":"04aab27e-a204-4b45-8245-4bac85ee40f2"}
{"time":"2016-04-14T07:01:30.702Z","level":"info","message":"Added connection","connectionId":"90949aa3-74d7-4ca3-8414-5cfcb9e1dd2a"}
{"time":"2016-04-14T07:01:30.704Z","level":"error","message":"Unexpected proxy error. Closing proxy connection.","error":{"stack":"Error: connect ECONNREFUSED\n at exports._errnoException (util.js:746:11)\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1012:19)","message":"connect ECONNREFUSED","code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect"}}
{"time":"2016-04-14T07:01:30.707Z","level":"info","message":"Removed connection","connectionId":"90949aa3-74d7-4ca3-8414-5cfcb9e1dd2a"}
{"time":"2016-04-14T07:01:36.707Z","level":"info","message":"Added connection","connectionId":"e6233f5f-2d1f-4f39-8e10-d00cd7cf9f99"}
{"time":"2016-04-14T07:01:36.710Z","level":"error","message":"Unexpected proxy error. Closing proxy connection.","error":{"stack":"Error: connect ECONNREFUSED\n at exports._errnoException (util.js:746:11)\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1012:19)","message":"connect ECONNREFUSED","code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect"}}
then... repeat ECONNREFUSED error
janus_video logs
vagrant@sk:~$ tail /opt/janus-cluster/video/var/log/janus/janus.log -f
[Thu Apr 14 06:01:46 2016] [4121685059] The DTLS handshake has been completed
[Thu Apr 14 06:01:46 2016] WebRTC media is now available
[Thu Apr 14 06:05:27 2016] No WebRTC media anymore
[Thu Apr 14 06:05:27 2016] Detaching handle from JANUS CM video plugin
[Thu Apr 14 06:05:27 2016] [WSS-0x1b02a00] Destroying WebSocket client
[Thu Apr 14 06:05:30 2016] Cleaning up handle 4121685059...
[Thu Apr 14 06:05:30 2016] [4121685059] WebRTC resources freed
[Thu Apr 14 06:05:30 2016] [4121685059] Handle and related resources freed
[Thu Apr 14 06:05:33 2016] [WSS-0x1973000] Destroying WebSocket client
[Thu Apr 14 06:05:33 2016] Timeout expired for session 1381318733...
then... nothing.
client ws frame
- there's no studio agent log too:root@bulldog:/home/vagrant# tail -f /var/log/studio-agent/studio-agent.log
I, [2016-04-14T05:50:41.810854 #6300] INFO -- gstreamer: Pipeline changing to state `GST_STATE_READY`
I, [2016-04-14T05:50:41.810996 #6300] INFO -- gstreamer: Startup of unit `gstreamer-pipeline`
I, [2016-04-14T05:50:42.315867 #6300] INFO -- gstreamer: Pipeline changing to state `GST_STATE_PAUSED`
I, [2016-04-14T05:50:42.357686 #6300] INFO -- gstreamer: Pipeline changing to state `GST_STATE_PLAYING`
I, [2016-04-14T06:05:33.715517 #6287] INFO -- main: Socket-redis event `stop` received.
I, [2016-04-14T06:05:33.715679 #6287] INFO -- main: Stopping unit `gstreamer-process`
I, [2016-04-14T06:05:33.715800 #6287] INFO -- main: Stopping unit `janus-mountpoint`
I, [2016-04-14T06:05:33.716252 #6300] INFO -- gstreamer: STOPPING (received signal 15)
I, [2016-04-14T06:05:33.748603 #6300] INFO -- gstreamer: Failure at unit `gstreamer-pipeline` (reason: `Pipeline stopped.`)
I, [2016-04-14T06:05:33.748707 #6300] INFO -- gstreamer: Stopping unit `gstreamer-pipeline`
then... nothing.
Expected:
janus-video
should not crash (or should restart automatically)...Workaround:
studio-agent
is not solving this issuesudo /etc/init.d/janus_video restart
At the end, it seems that the janus_video
process crashed:
vagrant@sk:~$ ps aux | grep janus | grep video
cm-janus 7329 0.1 2.5 689776 104084 ? Sl 05:49 0:04 /usr/bin/node /usr/bin/cm-janus -c /opt/cm-janus-cluster/video/etc/cm-janus/config.yaml
vagrant@sk:~$ sudo /etc/init.d/janus_video restart
[....] Stopping janus_video: janus_videoNo process in pidfile '/var/run/janus_video.pid' found running; none killed.
. ok
[ ok ] Starting janus_video: janus_video.
vagrant@sk:~$ ps aux | grep janus | grep video
cm-janus 7329 0.1 2.5 689540 104328 ? Sl 05:49 0:04 /usr/bin/node /usr/bin/cm-janus -c /opt/cm-janus-cluster/video/etc/cm-janus/config.yaml
janus 11144 0.1 0.1 223656 5924 ? Sl 06:46 0:00 /usr/bin/janus -o -C /opt/janus-cluster/video/etc/janus/janus.cfg -L /opt/janus-cluster/video/var/log/janus/janus.log -F /opt/janus-cluster/video/etc/janus
I have this .json
file which points to nonexistent mjr video file. Please make sure that you don't create descriptions without it.
can you give a example
Depends on #105
TODO:
It will allow to run multiple janus
instances as origin
role in cluster mode, where each instance would bind to the same IP/port.
The main goal is to get rid of SPOF
Problem: During high I/O on the janus-gateway machine we experience stuttering of the video stream. The clients experience "packet loss" (probably those packets are never sent?).
To reproduce:
Create a big file:
truncate -s 100M 100M
Then drop FS caches and copy that file to another file in a loop:
while (true); do sync && echo 3 > /proc/sys/vm/drop_caches && rm -f 100M-copy && rsync -a 100M 100M-copy && echo -n .; done
To observe "iowait" run this command in another terminal:
sudo iostat -x 1
During that operation the WebRTC stream will stutter substantially.
Unfortunately this can't be solved with "ionice". This command (with "ionice") has the exact same effect:
while (true); do sync && echo 3 > /proc/sys/vm/drop_caches && rm -f 100M-copy && ionice -c3 rsync -a 100M 100M-copy && echo -n .; done
For #12
Steps to gather data:
1.
apt-get install vallgrind
cd /path/you/want/collected/data/to/go
valgrind --tool=callgrind --trace-children=yes /path/to/janus/bin/janus
apt-get install kcachegrind
kcachegrind callgrind.out.<PID>
Other oprofile
/callgrind
tools will also work, kcachegrind
is an example, manual at: https://kcachegrind.github.io
PS: we might need a version of the source without static
keywords around rtpbcast
functions, but this is pretty trivial to prepare.
Currently if dump file exceeds ~28GB there is RTP header timestamp overflow. It applies for current dump of 5Mbit/s stream.
File for conversion: 36GB
Offset Timestamp reset at: ~28GB
Conversion output:
root@debian-7-amd64-default:/vagrant/janus-gateway# ./janus-pp-rec /vagrant/rec-r5qFZ1zyZPBDcoKPrbNG7Q__-3117504519051-video.mjr video.webm
/vagrant/rec-r5qFZ1zyZPBDcoKPrbNG7Q__-3117504519051-video.mjr --> video.webm
File is 38400471352 bytes
Pre-parsing file to generate ordered index...
[WARN] New .mjr header format
This is a video recording:
-- Codec: vp8
-- Created: 1455033365874179
-- Written: 1455033368407616
Timestamp reset: 2804
Offset Timestamp reset: 30335251060
Counted 58431 RTP packets
Counted 58431 frame packets
[WARN] Lost a packet here? (got seq 53240 after 53235, time ~204963823010733s)
-- 0x0 (fps [-12729600,3600] ~ 3000)
[WARN] No key frame?? assuming 640x480...
[webm @ 0x6c1fb840] Codec for stream 0 does not use global headers but container format requires global headers
(...)
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823006514301 >= 12900200
[ERR] [postprocessing/pp-webm.c:janus_pp_webm_process:350] Error writing video frame to file...
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823006514301 >= 12900240
[ERR] [postprocessing/pp-webm.c:janus_pp_webm_process:350] Error writing video frame to file...
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823006514301 >= 12900280
[ERR] [postprocessing/pp-webm.c:janus_pp_webm_process:350] Error writing video frame to file...
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823006514301 >= 12900320
[ERR] [postprocessing/pp-webm.c:janus_pp_webm_process:350] Error writing video frame to file...
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823006514301 >= 204963823006514301
[ERR] [postprocessing/pp-webm.c:janus_pp_webm_process:350] Error writing video frame to file...
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823041217221 >= 21
[ERR] [postprocessing/pp-webm.c:janus_pp_webm_process:350] Error writing video frame to file...
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823041217221 >= 61
[ERR] [postprocessing/pp-webm.c:janus_pp_webm_process:350] Error writing video frame to file...
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823041217221 >= 101
[ERR] [postprocessing/pp-webm.c:janus_pp_webm_process:350] Error writing video frame to file...
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823041217221 >= 141
[ERR] [postprocessing/pp-webm.c:janus_pp_webm_process:350] Error writing video frame to file...
[webm @ 0x6c1fb840] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 204963823041217221 >= 181
(...)
I proposed a PR for Janus which introduces additional configuration options to bind RTP/RTSP inputs of the streaming plugin to a particular network interface. This is particularly relevant for streaming multicast sources in multi-homed devices (i.e. multiple network ports) but may also be more generally useful in the case of unicast sources (to avoid binding to all network interfaces unnecessarily and use just the one that is actually needed).
You may be interested in backporting and participating in development on PR 776 upstream: meetecho/janus-gateway#776
I noticed that only VP8 is supported for keyframing, etc. h264 support is gaining traction with Chrome enabling it soon (it's working on Canary)
Are there any plans for this?
This plugin is very nice. Thanks for your great effort.
I find that the Janus instance will be crashed when i destroy the mountpoint. May i ask if you have the same issue? If so, is there any fix?
Thanks a lot
Hi , @kris-lab
when I create request, Janus get segmentation falult.
I used default config.
How do you solve it??
[ERR] [record.c:janus_recorder_create:43] Missing codec information
Segmentation fault (core dumped)
{
"janus" => "message",
"title" => "API Workspace",
"transaction" => "asdfasdv788",
"body" =>
{
"request" => "create",
"id" => "23342",
"name" => "test",
"videocodec" => "vp8",
"audiocodec" => "opus",
"audio" => true,
"video" => true,
"description" => "test",
"recorded" => true,
"streams" =>
[{
"videocodec" => "vp8",
"audiocodec" => "opus",
"audiopt" => 111,
"audiortpmap" => "opus/48000/2",
"videopt" => 100,
"videortpmap" => "VP8/90000"
}]
}
}
janus commit https://github.com/meetecho/janus-gateway/commit/3c565b044e1dfc3ce6ad1b0dcd58d4178687c734
janus-gateway-rtpbroadcast commit https://github.com/cargomedia/janus-gateway-rtpbroadcast/commit/02ea9a03a4d7239c38aaf6d6b08470cfc6a1297f
Request:
Response:
Questions:
Reuse "create"
Websocket close it.
Request:
Response:
Stay the same.
Reuse "watch"
Websocket close it.
Websocket close it.
Websocket close it.
Event:
TODO:
We have measured the top throughput of single Janus process. It should be investigated what cause the limits and high CPU usage?
See more:
Benchmark showed the limit of 300Mbit per Janus instance (for more details about hardware please see URLs)
I followed the instruction to compile this plugin. But when I do make
I get
libjanus_rtpbroadcast.c:110:26: fatal error: janus/plugin.h: No such file or directory
What do I have to do to make this work? Do I have to add the janus header to something?
When restarting cm-janus during a video stream, when trying to re-establish the same mountpoint janus usually responds with:
A stream with the provided ID already exists
To me it looks like janus is not dropping the mountpoints when the WS connection is closed.
@kris-lab could you double-check? Is it happening delayed? Can it be fixed easily?
Should we introduce some authentication for super commands
? I would suggest to:
token
which would be stored in Janus
config file and would be known by cm-janus
!command
name at proxy layer!wdyt?
hi kris-lab
can janus-gateway-rtpbroadcast realization the janus cluster?
fore example:
client--->janus-gateway-rtpbroadcast---> janus-gateway-rtpbroadcast---->client
Depends on #110
See #106 (comment)
Currently, if mountpoint
is destroyed right after "thumbnails recorder" opens the dump file, then there is high probability the jobFile
will be created for MJR file/dump
, which actually does not contain any valid key-frame
!
Part of #104
Will allow to run multiple janus instances with replicated mountpoint
.
see http://stackoverflow.com/a/14388707
Notes to myself http://hacked10bits.blogspot.co.uk/2014/12/udp-binding-and-port-reuse-in-linux.html
Regarding the context for this problem, one might be led to ask why I needed a "real" network interface to run multiple SITL instances on a single machine. It turns out that the loopback interface (the one typically with address 127.0.0.1, used for interprocess communications on the local machine) does not support broadcast. There are apparently very good technical reasons for this, but I did not delve deeply into those. It is, however, possible to create a virtual Ethernet interface and even a virtual bridge, and those do support broadcasts.
Not sure if it's really an issue from janus, but it seems strange to receive this plugin error from janus, the watch
request should have been rejected somehow in the first place because i received a status: stopped
event just before the offer.
wdyt @kris-lab ?
"plugindata":{"data":{"streaming":"event","error_code":455,"error":"Can't start: no mountpoint set"}
Full WS communication sequence:
{"janus":"create","transaction":"o7WZTnydmpTd","token":"{\"sessionId\":\"790fb6383dd5ed5e642f97d8b7d60bae\"}"}
{"janus":"success","transaction":"o7WZTnydmpTd","data":{"id":3997528035}}
{"janus":"attach","plugin":"janus.plugin.cm.rtpbroadcast","transaction":"NRQa0OLuFAQ4","token":"{\"sessionId\":\"790fb6383dd5ed5e642f97d8b7d60bae\"}","session_id":3997528035}
{"janus":"success","session_id":3997528035,"transaction":"NRQa0OLuFAQ4","data":{"id":1089790766}}
{"janus":"message","body":{"id":"R0X4rImYFI.1fz1e8aqwHA__","channel_data":"{\"streamChannelType\":269}","request":"watch"},"transaction":"jpmovx9lik9","token":"{\"sessionId\":\"790fb6383dd5ed5e642f97d8b7d60bae\"}","session_id":3997528035,"handle_id":1089790766}
{"janus":"ack","session_id":3997528035,"transaction":"jpmovx9lik9"}
{"janus":"event","session_id":3997528035,"sender":1089790766,"plugindata":{"plugin":"janus.plugin.cm.rtpbroadcast","data":{"streaming":"event","result":{"status":"stopped"}}}}
{"janus":"event","session_id":3997528035,"sender":1089790766,"transaction":"jpmovx9lik9","plugindata":{"plugin":"janus.plugin.cm.rtpbroadcast","data":{"streaming":"event","result":{"stream":{"id":"R0X4rImYFI.1fz1e8aqwHA__","uid":"4d07e6ac35dc1b9b9de6709eea9d0b85","index":1,"audioport":8679,"videoport":8962,"listeners":1,"waiters":0,"stats":{"min":0,"max":0,"cur":0,"avg":0},"frame":{"width":0,"height":0,"fps":0,"key-distance":0},"session":{"webrtc-active":1,"autoswitch-enabled":1,"remb-avg":0}},"status":"preparing"}}},"jsep":{"type":"offer","sdp":"v=0\r\no=- 1454063277441856 1454063277441856 IN IP4 127.0.0.1\r\ns=CM RTP Broadcast\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS janus\r\nm=audio 1 RTP/SAVPF 111\r\nc=IN IP4 127.0.0.1\r\na=mid:audio\r\na=sendonly\r\na=rtcp-mux\r\na=ice-ufrag:eMur\r\na=ice-pwd:XFGkOKuRHqE48BqlWXwhMH\r\na=ice-options:trickle\r\na=fingerprint:sha-256 85:7E:F6:AD:D1:2B:A7:09:AD:D6:84:DF:19:B1:D5:41:A2:B7:57:50:12:96:EE:E0:A8:A8:68:3D:6F:1A:C3:21\r\na=setup:actpass\r\na=connection:new\r\na=rtpmap:111 opus/48000/2\r\na=ssrc:254416757 cname:janusaudio\r\na=ssrc:254416757 msid:janus janusa0\r\na=ssrc:254416757 mslabel:janus\r\na=ssrc:254416757 label:janusa0\r\na=candidate:1 1 udp 2013266431 10.0.2.15 36437 typ host\r\na=candidate:2 1 udp 2013266431 10.10.11.10 57683 typ host\r\na=candidate:3 1 udp 2013266431 10.0.3.21 40580 typ host\r\na=candidate:1 2 udp 2013266430 10.0.2.15 55434 typ host\r\na=candidate:2 2 udp 2013266430 10.10.11.10 55906 typ host\r\na=candidate:3 2 udp 2013266430 10.0.3.21 42480 typ host\r\nm=video 1 RTP/SAVPF 100\r\nc=IN IP4 127.0.0.1\r\na=mid:video\r\na=sendonly\r\na=rtcp-mux\r\na=ice-ufrag:jI0t\r\na=ice-pwd:rorW+moOd5em2HnRDDsfgJ\r\na=ice-options:trickle\r\na=fingerprint:sha-256 85:7E:F6:AD:D1:2B:A7:09:AD:D6:84:DF:19:B1:D5:41:A2:B7:57:50:12:96:EE:E0:A8:A8:68:3D:6F:1A:C3:21\r\na=setup:actpass\r\na=connection:new\r\na=rtpmap:100 VP8/90000\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 goog-remb\r\na=ssrc:4281170276 cname:janusvideo\r\na=ssrc:4281170276 msid:janus janusv0\r\na=ssrc:4281170276 mslabel:janus\r\na=ssrc:4281170276 label:janusv0\r\na=candidate:4 1 udp 2013266431 10.0.2.15 38576 typ host\r\na=candidate:5 1 udp 2013266431 10.10.11.10 48361 typ host\r\na=candidate:6 1 udp 2013266431 10.0.3.21 39725 typ host\r\na=candidate:4 2 udp 2013266430 10.0.2.15 48295 typ host\r\na=candidate:5 2 udp 2013266430 10.10.11.10 39831 typ host\r\na=candidate:6 2 udp 2013266430 10.0.3.21 47042 typ host\r\n"}}
{"janus":"message","body":{"request":"start"},"transaction":"Qrljn1nOdT1d","token":"{\"sessionId\":\"790fb6383dd5ed5e642f97d8b7d60bae\"}","jsep":{"type":"answer","sdp":"v=0\r\no=- 7439943932597348489 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS\r\nm=audio 9 RTP/SAVPF 111\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:RIT7bYdaGhH5ttJX\r\na=ice-pwd:9aRo4Z0enylUUqKMfcjmpXIF\r\na=fingerprint:sha-256 0D:68:49:4F:79:C3:76:FB:2E:A4:FF:B6:EA:A2:6B:C4:0D:6C:F8:DF:BF:23:4C:37:BD:27:92:75:8B:2A:7A:D2\r\na=setup:active\r\na=mid:audio\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10; useinbandfec=1\r\na=maxptime:60\r\nm=video 9 RTP/SAVPF 100\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:RIT7bYdaGhH5ttJX\r\na=ice-pwd:9aRo4Z0enylUUqKMfcjmpXIF\r\na=fingerprint:sha-256 0D:68:49:4F:79:C3:76:FB:2E:A4:FF:B6:EA:A2:6B:C4:0D:6C:F8:DF:BF:23:4C:37:BD:27:92:75:8B:2A:7A:D2\r\na=setup:active\r\na=mid:video\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:100 VP8/90000\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 goog-remb\r\n"},"session_id":3997528035,"handle_id":1089790766}
{"janus":"trickle","candidate":{"candidate":"candidate:3472907538 1 udp 2122260223 10.10.11.1 54067 typ host generation 0","sdpMid":"audio","sdpMLineIndex":0},"transaction":"ozua9mLWGzSN","token":"{\"sessionId\":\"790fb6383dd5ed5e642f97d8b7d60bae\"}","session_id":3997528035,"handle_id":1089790766}
{"janus":"trickle","candidate":{"candidate":"candidate:874861076 1 udp 2122194687 10.0.3.243 58166 typ host generation 0","sdpMid":"audio","sdpMLineIndex":0},"transaction":"oAeKqKiWKudz","token":"{\"sessionId\":\"790fb6383dd5ed5e642f97d8b7d60bae\"}","session_id":3997528035,"handle_id":1089790766}
{"janus":"ack","session_id":3997528035,"transaction":"Qrljn1nOdT1d"}
{"janus":"ack","session_id":3997528035,"transaction":"ozua9mLWGzSN"}
{"janus":"ack","session_id":3997528035,"transaction":"oAeKqKiWKudz"}
{"janus":"event","session_id":3997528035,"sender":1089790766,"transaction":"Qrljn1nOdT1d","plugindata":{"plugin":"janus.plugin.cm.rtpbroadcast","data":{"streaming":"event","error_code":455,"error":"Can't start: no mountpoint set"}}}
{"janus":"detach","transaction":"OvcrOu1okIQc","token":"{\"sessionId\":\"790fb6383dd5ed5e642f97d8b7d60bae\"}","session_id":3997528035,"handle_id":1089790766}
First: determine if this is a real problem, and how it behaves exactly (https://github.com/cargomedia/sk/issues/2891).
The idea with average/delay on the janus side was to prevent too quick switching. What about we replace this logic with immediate switch but based on some "hysteresis loop" where we have some range of sensitivity to upgrade/downgrade in bit/s?
Agree this could be solved with such a hysteresis loop, in our case with fixed levels it could look like this:
add file libjanus_rtpbroadcast.pc
to contain pkg-config
lib metadata and copy it to a correct location after building (e.g. /usr/share/pkgconfig/
)
contents:
prefix=@prefix@
exec_prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Description: Janus-gateway plugin to broadcast RTP video
Libs: -L${libdir} -ljanus_rtpbroadcast @LIBS@
Cflags: -I${includedir}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.