Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 15:17
    guest271314 commented #544
  • 14:45
    guest271314 commented #544
  • 14:33
    guest271314 commented #544
  • 14:31
    paullouisageneau commented #544
  • 14:15
    guest271314 commented #544
  • 12:19
    paullouisageneau commented #544
  • Jan 26 06:01
    guest271314 commented #544
  • Jan 25 22:08
    paullouisageneau labeled #545
  • Jan 25 22:08
    paullouisageneau opened #545
  • Jan 25 19:17
    paullouisageneau commented #544
  • Jan 25 14:03
    guest271314 opened #544
  • Jan 24 22:50
    paullouisageneau commented #543
  • Jan 24 15:40
    deblauwetom closed #529
  • Jan 23 09:08
    kuzux opened #543
nemirtingas
@nemirtingas:matrix.org
[m]
I have no idea, I only use libdatachannel in C++ projects as a static library.
inaryart
@inaryart
there are too few wasm users, so there are not too many tests, there may be problems. wait for @paullouisageneau to answer
1 reply
inaryart
@inaryart
image.png
WEBRTC module is not embedded in the project
Paul-Louis Ageneau
@paullouisageneau
@inaryart Oh, indeed, the Websocket part calls an utility function from the WebRTC part
Could you please check it works for you?
inaryart
@inaryart
it works fine now
Paul-Louis Ageneau
@paullouisageneau
excellent!
Emily Jia
@emilyyjia
Hi, I've been using this library in order to send data between two native clients. I now want to add voice chat, so I'm wondering if it's possible to do that by sending the microphone input in a similar way to the audio in the streamer example? Of course I'd have to figure out how to capture the microphone input and play it when it reaches the other client, but I feel like that overhead probably wouldn't exceed the overhead of switching to google's native library, which to my knowledge does support media capture. I've been really appreciating how simple to use this library is!
nemirtingas
@nemirtingas:matrix.org
[m]
Hi, you can test portaudio (https://github.com/PortAudio/portaudio) if you need some cross-platform small library for audio Capture/Playback. Its a wrapper around native ways to get audio stuff.
Emily Jia
@emilyyjia
Thanks! I'm deciding between that one now in addition to miniaudio and rtaudio.
Paul-Louis Ageneau
@paullouisageneau
@emilyyjia Hi, it's indeed possible to send audio from microphone, only it requires to capture and encode it yourself, as libdatachannel only implements the network side of things
nemirtingas
@nemirtingas:matrix.org
[m]
You can basically send anything you want using libdatachannel.
I use it as a P2P game network library.
Paul-Louis Ageneau
@paullouisageneau
There are basically two possibilities: the DIY approach of using portaudio to capture sound and libopus to encode samples, and send them like in the streamer example (you need to set up opus packetization with libdatachannel), or the simpler approach of using ffmpeg or gstreamer for everything (they can even output RTP packets than you can send directly in a libdatachannel track)

You can basically send anything you want using libdatachannel.

Ha ha yes but audio and video must still be encoded properly

nemirtingas
@nemirtingas:matrix.org
[m]
Only if you want to use the WebRTC Audio/Video protocol.
SRTP I believe ?
Paul-Louis Ageneau
@paullouisageneau
Yes indeed!
Emily Jia
@emilyyjia

Thanks, I really appreciate the help with that! I do have a followup question - using the same sort of idea, the data I'm currently sending over the datachannel is somewhat analogous to video in a normal video call situation. I'm taking care of the encoding and decoding myself to essentially produce the "frame" that is being sent through the datachannel. Would it be better/possible to leverage the videostream in this sense to send this arbitrary piece of data which represents a frame?

I guess possible benefits I'm looking for are the synchronisation with the audio and achieving even lower latency with the features of a full media stream.

Paul-Louis Ageneau
@paullouisageneau
@emilyyjia Sure, it's possible to send arbitrary video data over tracks if you control both endpoints. To achieve this, you should not set any track handler and wrap your data into RTP packets that you send directly on the track. It boils down to adding a valid RTP header, you can use the helper struct rtc::RTPin rtc/rtp.hpp
1 reply
However, note that there are limitations: the RTP payloads must be small enough (less than RTC_DEFAULT_MAXIMUM_FRAGMENT_SIZE, which is 1140 bytes), and contrary to data channels there is no retransmission or loss correction, you have to handle that yourself.
nemirtingas
@nemirtingas:matrix.org
[m]
Is there any optimization when choosing binary instead of string when sending messages over a datachannel ?
I'm always using rtc::Datachannel::send(std::string) even if my buffer contains a compressed binary data.
nemirtingas
@nemirtingas:matrix.org
[m]
:point_up: Edit: Is there any benefit when choosing binary instead of string when sending messages over a datachannel ?
I'm always using rtc::Datachannel::send(std::string) even if my buffer contains a compressed binary data.
Paul-Louis Ageneau
@paullouisageneau
Using a binary prevents a copy, so there is a tiny performance benefit
Apart from that, there is no difference
nemirtingas
@nemirtingas:matrix.org
[m]
Hmm, guess I'll have to switch then
Paul-Louis Ageneau
@paullouisageneau
It contains a couple fixes, in particular one for a deadlock (a regression in 0.15.4 observed on WebRTC servers), and libjuice is updated to 0.9.3 to fix an issue with non-monotonic timestamps that could trigger periods of high CPU usage on some platforms
nemirtingas
@nemirtingas:matrix.org
[m]
WebRTC servers ? Or WebSocket servers ?
Paul-Louis Ageneau
@paullouisageneau
I mean the WebRTC server use case (a streaming server for instance) were you handle a relatively high number of Peer Connections
nemirtingas
@nemirtingas:matrix.org
[m]
Ah ok.
Murat Do─čan
@murat-dogan
Thank you. I am releasing node-datachannel v0.1.13 with new libdatachannel release.
nemirtingas
@nemirtingas:matrix.org
[m]
And I backported again to CXX14
Paul-Louis Ageneau
@paullouisageneau
The main changes are blocking cleanup and video orientation support
nemirtingas
@nemirtingas:matrix.org
[m]
Hi, any idea why rtc::PeerConnection::rtcSignalingState is public here ?
https://github.com/paullouisageneau/libdatachannel/blob/master/include/rtc/peerconnection.hpp#L71
Paul-Louis Ageneau
@paullouisageneau
ha ha that's a mistake
there should just be the type definition
the value must be accessed with signalingState()
nemirtingas
@nemirtingas:matrix.org
[m]
Bad copy/paste from rtc/rtc.h ?
Paul-Louis Ageneau
@paullouisageneau
yes probably!
thanks for noticing, I'll clean it up
nemirtingas
@nemirtingas:matrix.org
[m]
Thats what I was thinking, a public member in the API interface sounds weird x)
Paul-Louis Ageneau
@paullouisageneau
libdatachannel v0.16.4 is out :tada: https://github.com/paullouisageneau/libdatachannel/releases/tag/v0.16.4
The main fixes in v0.16.3 and v0.16.4 are ICE candidates gathering enhancements in the libjuice dependency
nemirtingas
@nemirtingas:matrix.org
[m]
Thanks, updated again my cxx14 port :).
nemirtingas
@nemirtingas:matrix.org
[m]
And sent new merge requests to vcpkg to update
libdatachannel v0.16.0 -> v0.16.4
libjuice v0.9.1 -> v0.9.6
Paul-Louis Ageneau
@paullouisageneau
@nemirtingas Thank you very much!
nemirtingas
@nemirtingas:matrix.org
[m]
Updates merged into vcpkg.
Paul-Louis Ageneau
@paullouisageneau
@nemirtingas:matrix.org Thanks :+1: