Quantcast
Viewing all articles
Browse latest Browse all 4890

Camera board • Re: synchronously capture images by two triggered GS cameras

Do you happen to have software that can subtract two video streams from two cameras using libcamera-vid?
I can only show how my i420toh264 method can to that.

Code:

pi@raspberrypi5:~ $ rpicam-vid --help | grep yuv  --codec arg (=h264)                   Set the codec to use, either h264, libav, mjpeg or yuv420pi@raspberrypi5:~ $ 
Image may be NSFW.
Clik here to view.
Image



This code does alpha blending for a single frame:
https://github.com/Hermann-SW2/userland ... .c#L47-L53

Code:

    for(y=0; y<height; ++y)    {      for(p=buf+y*nStride, q=alpha+y*width, x=0; x<width; ++x)      {        p[x] = (((unsigned)p[x]) * q[x]) / 255;      }    }


With this sample alpha blending file (normally values 0-255, here only 255 (white) and black (0)):
Image may be NSFW.
Clik here to view.
Image


The black cross gets subtracted from all input frames:
Image may be NSFW.
Clik here to view.
Image

So the output frames will have the frame subtracted, whereas "overlays" only affect camera preview and not the recorded video.


You will need to write new code that will subtract frame N of one camera from frame N of the other camera.


I am sure that gstreamer pipelines can do the same, I have not used gstreamer recently.

Statistics: Posted by HermannSW — Tue Mar 26, 2024 10:32 am



Viewing all articles
Browse latest Browse all 4890

Trending Articles