FolkComputer / folk

🎁 Physical computing system.
https://folk.computer
Apache License 2.0
75 stars 4 forks source link

WebRTC Support #154

Open s-ol opened 3 months ago

s-ol commented 3 months ago

Using gstreamer because it seems that's mandatory even if you use a more lightweight WebRTC signalling library. For WebRTC, needs the gst-plugins-rs package. Test program in make test/gstreamer shows a PNG at http://localhost:4273/gst-image/.

stretch goals:

s-ol commented 3 months ago

How to use at the moment:

When the gstreamer pipeline "videotestsrc" frame is /frame/ at /ts/ { ... }

The syntax of the pipeline string is gst-launch-1.0, but gstreamer.folk will automatically add a sink (and videoconvert) at the end.

For webrtc:

osnr commented 2 months ago

(slightly concerned about the long-term goal of replacing camera.folk/v4l2 with gstreamer -- it feels like we should try to use the lowest-level reasonable interface in general to avoid latency and give us configuration power. But otherwise this seems good/useful, continuing to look at it now)

cwervo commented 2 months ago

Okay here are some thoughts after thinking about this for a day, seeking :

s-ol commented 2 months ago
  • @s-ol what do you think about carving this out into its own repo that we vendor? I'm kind of concerned about mixing dependencies that include npm for Gstreamer

Oh, I didn't update the instructions above anymore, npm was necessary to build the gstreamer webrtc demo page for initial testing, but later I compiled the gstwebrtc-api library into a standalone JS bundle and vendored it. Now only the gstreamer distro packages are dependencies and if they aren't detected webrtc.folk errors with a message pointing out what to install.

the flow now is: