Remix.run Logo
Show HN: OpenCV over WebRTC (in Go)(github.com)
56 points by Sean-Der 4 days ago | 9 comments
valorzard 3 days ago | parent | next [-]

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 3 days ago | parent [-]

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 3 days ago | parent [-]

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)

est 3 days ago | parent | prev | next [-]

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 3 days ago | parent [-]

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

RezaSi 3 days ago | parent | prev | next [-]

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 3 days ago | parent [-]

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/

consepcion 12 hours ago | parent | prev | next [-]

Consepcion jimenez vinagre

c-hendricks 3 days ago | parent | prev [-]

Huh, wonder if go2rtc could use this to make HKSV cameras work.