Best hardware for 4k video SDI input / run OpenCV for overlay / 4k video SDI output with reduced delay?

Good afternoon,

I am trying to catch a 4k live broadcast video thanks to an SDI connector, add an overlay thanks to OpenCV / Python script, then re-send live by SDI output,with very minimum lad/delay.

Unfortunately the new OpenCV Oak has no camera input

Would you have any hint please ?

Thank you

Well, I’m not sure that a computer vision library would be the best tool to add an overlay live to a video feed.
Specialized live video software could be better adapted and much easier to use.

1 Like

if you want SDI input, there exists capture hardware that uses USB3 or PCI Express interfaces.

they’re not paying me to say this but I’ve had decent results with Magewell devices. there’s also the whole family of “Decklink” devices from “Blackmagic Design”.

I have no idea how to emit SDI. I’m sure the previously mentioned mfgs have some solution for that… HDMI/DisplayPort to SDI perhaps?

OpenCV video I/O APIs are not generally optimized for latency. be aware of that. you may need to use manufacturer-provided libraries for most direct I/O.

1 Like

Thx for ur replies guys

I intend to film poker games.

1- receive a video input from a pro camera, thus the SDI connector
2-detect playcards,
3- sometimes swap the content of the card or add some image to it.
4- Broadcast the resulting video

Where would the speed bottle neck lay ? I thought that OpenCV had some decent speed ?

  • What if the input video is uncompressed ? Would it go much faster ?

  • Could I have the SDI input connected straight into some CSI / I2C of some Opencv.ai A1 kit ?

  • Use GPU instead of CPU ?

Thank you

If you want to do some image processing too (like card detection), OpenCV makes sense.
I don’t know how it handles SDI input/output, but it can be interfaced to other SDKs, something like this (pseudocode):

int w = sdi.getWidth();
int h = sdi.getHeight();
char* buffer = sdi.capture();
Mat image(w,h,CV_8UC3,buffer); //transform the input buffer to OpenCV Mat
//process the image
Mat result; //copy your result here
char *output = new char[w*h*3];
memcpy(output,result.ptr[0],w*h*3);
sdi.send(output);

First develop your code for static images and time it. If it’s too slow (takes more than 0.03s/image - this will be probably the case for 4K video), you’ll have to optimize it. The best way to gain speed is to go from CPU to GPU. Fortunately most OpenCV functions have CUDA implementations.

1 Like

Yes, good idea, I will do that

Oups, I have some learning curve in front of me then :slight_smile:

Should I go for the Jetson nano then, which is the Nvidia way ? Or OpenCV.AI ?

Thanks a lot Kbarni, highly appreciated !

Why not use a desktop computer? It’s much more powerful. Don’t forget, 4K real time video processing is very computationally intensive! And you’ll also have to add the SDI interfaces…
Anyway, choose the hardware according to the needs; it’s simpler than having to optimize the processing for some weak hardware or scale back the quality just because you wanted to implement it on some cheap boards.
If you need embedded computing (especially for real time 4K…), go for a Nvidia (Nano or Xavier, according to the needs).
As long as you use only standard OpenCV functions, CUDA is quite easy. Generally all you need to do is to replace cv::somefunction(...) with cv::cuda::somefunction(...).

Because I want to end-up with some idiot-proof black box, with just a power source, an off-on switch, and 2 SDI ( input and output)

That is great I did not know it was that easy.

Thx mate ! You are very helpful indeed. I guess I will narrow my quest to Nano, and maybe compare it to the Open Ai kit which is said to have more computational abilities, but no Cuda ( but I may be wrong ). I think the Raspberry 4 has a VideoCore IV GPU

Apparently OpenCV works with OpenCl ? That means the Raspberry 4 should also be quite capable ?

still, develop on a desktop computer. you are a beginner. you have enough to deal with. worry about squeezing it into tiny hardware later.

all your concerns right now are wasted. your primary problem should be how to get 4K SDI video into anything.

I said latency. you asked for latency. that’s not speed. I made no claims about speed.

a proof of concept is required to get actual performance numbers. anything else is speculation or anecdotal.

in theory. you could look into whether anyone has managed to make OpenCL usable on the rpi4… and then, whether the tooling is standard enough so that OpenCV can use it.