Does anyone have tried to send binary data in the datachannel? what sending speed could you achieve?

270 views
Skip to first unread message

Paul Peter

unread,
Feb 27, 2021, 6:06:06 PM2/27/21
to meetecho-janus
i have tried to send videodata by datachannel, but i can only achieve 2MB/s on my embedded device(Cortex™-A9 CPU). i don't think the speed is limited by the device'cpu perfermace because when the videodata was sent, the cpu usage is only 50%. 

Mirko Brankovic

unread,
Feb 28, 2021, 12:58:20 PM2/28/21
to meetecho-janus
That is probably webrtc aimed bitrate limit, in case you didn't set upper limit to some higher

On Sun, Feb 28, 2021, 00:06 Paul Peter <pppau...@gmail.com> wrote:
i have tried to send videodata by datachannel, but i can only achieve 2MB/s on my embedded device(Cortex™-A9 CPU). i don't think the speed is limited by the device'cpu perfermace because when the videodata was sent, the cpu usage is only 50%. 

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/4277bf70-542f-40a9-8445-c31c75037e52n%40googlegroups.com.

Mirko Brankovic

unread,
Mar 1, 2021, 10:27:52 AM3/1/21
to meetecho-janus
For HD camera i see it goes up to 2.5mbps, maybe for FHD it would go higher but I don't have it for a test.
Here is the example of SDP munging
bw.png

But you also have to set a higher bitrate on janus room creation. I suspect it will work the same for data channels as for video/audio channels.

Hope it helps


On Mon, Mar 1, 2021 at 4:12 PM Paul Peter <pppau...@gmail.com> wrote:
Hi, thanks for you answer. Do you know how to set the bitrate limit?

Mirko Brankovic <mirkobr...@gmail.com> 于2021年2月28日周日 下午5:58写道:


--
----------------
Best regards,
-Chong chen
Department of Biomedical Engineering 
Zhejiang University
Room 105, Zhou Yiqing Technology Building
38 Zheda Road, Hangzhou 310027 P.R. China


--
Regards,
Mirko

Mirko Brankovic

unread,
Mar 1, 2021, 11:48:36 AM3/1/21
to meetecho-janus
It could be that libwebrtc will give more advantage to videostream over datachannel, probably you can do some research there.
But i wouldn't recommend to use datachannels for video stream, since as far as i understood, datachannels will be dropped soon from libwebrtc because of all RTCP security holes.
Confirm it first to be sure.

On Mon, Mar 1, 2021, 17:36 Paul Peter <pppau...@gmail.com> wrote:
this is the datachannel speed i have now
image.png

Mirko Brankovic <mirkobr...@gmail.com> 于2021年3月1日周一 下午3:27写道:

Mirko Brankovic

unread,
Mar 1, 2021, 11:50:07 AM3/1/21
to meetecho-janus
SCTP protocol, not RTCP, sorry 😐

Mirko Brankovic

unread,
Mar 1, 2021, 2:28:03 PM3/1/21
to meetecho-janus
Take that information with reserve, since I can't find the source and don't remeber if i read it on tweeter or some other social network.
Maybe it was to replace sctp as protocol with something new

On Mon, Mar 1, 2021, 19:20 Paul Peter <pppau...@gmail.com> wrote:
drop datachannel? but then how to send message by webrtc?


Mirko Brankovic <mirkobr...@gmail.com> 于2021年3月1日周一 下午4:50写道:

Mirko Brankovic

unread,
Mar 2, 2021, 3:24:20 AM3/2/21
to meetecho-janus
that could be, I guess you can set up peer2peer conn, and see if you can achieve bigger speed over datachannel

On Mon, Mar 1, 2021 at 9:56 PM Paul Peter <pppau...@gmail.com> wrote:
Hi Mirko,
ok, no problem. the video i send by datachannel is video archive which i think send by datachannel is better than by video channel. in video channel, the stream data can only be sent by rtp packet, right? by datachannel, i can directly send the mp4 video file which could be playback by the chrome client. i thought  the sending speed is limited by the sctp library which i am not familiar with. it seems the sending  data is chunk by this function  janus_sctp_data_to_dtls , usrsctp_init(0, janus_sctp_data_to_dtls, NULL), then dtls encrypt the chunk data(1k byte size) and send ithe chunk data one by one. 

Mirko Brankovic <mirkobr...@gmail.com> 于2021年3月1日周一 下午7:28写道:


--
----------------
Best regards,
-Chong chen
Department of Biomedical Engineering 
Zhejiang University
Room 105, Zhou Yiqing Technology Building
38 Zheda Road, Hangzhou 310027 P.R. China


--
Regards,
Mirko

Alessandro Toppi

unread,
Mar 2, 2021, 5:31:24 AM3/2/21
to meetecho-janus
SCTP performance might be affected by a very high number of factors, in particular when a SFU like Janus acts as a middle layer.

- CPU used: Cortex A9 is a low end architecture.
Do not try to strictly compare RTP with SCTP performances because their execution path should not be the same in general. In WebRTC media are encoded in the SRTP layer reusing the DTLS key set. Conversely DataChannels/SCTP messages are encapsulated in DTLS, so the traversed stack will not be the same for media and datachannels. They only share the transport at ICE-level.

- UDP buffers size (both on client and server).
Probably not your case since the rates you shared are pretty low, anyway worth trying.

- DTLS cipher used.
Some suites have higher throughput while some others benefits from HW acceleration. The different stacks (DTLS and SRTP) may also have different implementation and performances.

- Congestion Control, Message Size and MTU.
In DataChannels (at least on W3C 1.0 API) you have the chance to regulate the amount of data sent through the buffered amount threshold.
Also the size of the message you are sending might affect final throughput.
Finally the MTU in the network path and in janus.jcfg might also play a role.

Reply all
Reply to author
Forward
0 new messages