Show HN: OpenCV over WebRTC (in Go)

43 Sean-Der 8 9/7/2025, 9:31:29 PM github.com ↗

Comments (8)

est · 11h ago
For anyone curious, this line of comment shows how it's done:

> startCameraAndStream opens the webcam with GoCV, sends raw frames to FFmpeg (via stdin), reads IVF from FFmpeg (via stdout), and writes them into the WebRTC video track.

Sean-Der · 3h ago
If people want to build it another way you could do any of these, examples all on the repo!

* Use FFMPEG lib directly * GStreamer * Use libvpx, examples is in mediadevices repo

c-hendricks · 2h ago
Huh, wonder if go2rtc could use this to make HKSV cameras work.
RezaSi · 18h ago
Neat demo — cool to see GoCV + Pion working together over WebRTC. Curious if you’ve tried running object detection or overlays before sending the stream?
Sean-Der · 16h ago
I did! I tried integrating with a couple different of the examples on here [0]

The good detection ones required users to download something first, so I was worried the friction would make people less likely to use them. The one I almost went with was hand-gestures, but it wasn't as reliable.

I haven't used opencv that much. I see people talk about in Pion discord (and examples like this) and gets me into. I think someone more proficient could build a more compelling demo pretty quickly :)

[0] https://gocv.io/writing-code/more-examples/

valorzard · 18h ago
I used to do some basic CV stuff back when I did the First Robotics Competition (FRC) in high school, so it's cool to see it being done over WebRTC!
Sean-Der · 16h ago
Hey good to see you, we gotta get your PR merged and on here also :)

It's really cool how you can have a heavy server doing all this cool computer vision stuff, but then a simple client that just does WebRTC.

If you adjusted the example you can quickly be sending OBS or ffmpeg in. Then that gets really cool/powerful

valorzard · 16h ago
Yeah the PR is pretty much "done" at this point (there's more stuff I could probably do but perfect is the enemy of good)