Show HN: OpenCV over WebRTC (in Go)

(github.com)

55 points | by Sean-Der 1 day ago

4 comments

  • valorzard 1 day 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 1 day 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 1 day 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)
  • est 1 day 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 1 day 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

  • RezaSi 1 day 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 1 day 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/

  • c-hendricks 1 day ago
    Huh, wonder if go2rtc could use this to make HKSV cameras work.