-3

I have a PCI-E capture card, and I have to use APIs for it supplied by the manufacturer. They provide prebuilt .lib and .dll file. How can I use it in Golang? Or is it possible to get the output of capture card by using GOCV?

  • maybe you could write a C wrapper with the compiler that was used by the manufacturer and call that C code in Go https://karthikkaranth.me/blog/calling-c-code-from-go/ – Micka Jun 22 '19 at 07:17

1 Answers1

0

There three ways:

  1. You can load and call the dll from Go. This is documented in https://github.com/golang/go/wiki/WindowsDLLs.
  2. You can load and call your dll or link the lib using cgo and call this from your Go code. This is more complicated and requires more brain power.
  3. You can use syscall.NewProc.

I would use the first. They are all documented in https://github.com/golang/go/wiki/WindowsDLLs with examples.

You can also look on Github for examples by searching for syscall.syscall9.

If your machine has the drivers and it’s openCV compatible you could use GOCV to capture data.

georgeok
  • 5,321
  • 2
  • 39
  • 61