dturing / node-gstreamer-superficial

Superficial gstreamer binding
MIT License
127 stars 45 forks source link

webrtcbin usage [feature request] #48

Closed ldenoue closed 2 years ago

ldenoue commented 3 years ago

First, thanks for creating this NodeJS bindings for GStreamer. Lately, I've discovered the rather new webrtcbin element and wondered what we need to add to gstreamer-superficial to make it usable here.

For reference, here's a python sample code (simpler to understand) that shows interactions with this webrtcbin element: https://gitlab.freedesktop.org/gstreamer/gst-examples/-/blob/master/webrtc/sendrecv/gst/webrtc_sendrecv.py#L129

In particular how could we modify the cpp wrapper files used by gstreamer-superficial to add these:

GstSdp.SDPMessage.new GstSdp.sdp_message_parse_buffer GstWebRTC.WebRTCSessionDescription.new Gst.Promise.new

And also can we emit things to the webrtc element, like done in https://gitlab.freedesktop.org/gstreamer/gst-examples/-/blob/master/webrtc/sendrecv/gst/webrtc_sendrecv.py#L133

I'm aware this would make it less superficial ;)

dturing commented 2 years ago

I would love to see this and thank you for doing some research of (some of) what would be required.

Currently, gstreamer-superficial isn't well setup to support this. We would have to be able to (at least)

This could add some basic webrtc functionality to nodejs, which would be awesome. People would expect a similar interface to the browser's interface to WebRTC though. Maybe https://github.com/node-webrtc/node-webrtc is a solution?

I am happily using gst-webrtcbin in some other projects (not with nodejs), so maybe someday... :)

chfritz commented 1 year ago

@ldenoue, FYI: I had the same need and got it to work using node-gtk instead following this C implementation as an example. These examples of working with gstreamer through node-gtk were also very helpful in the process.