Page 1 of 1

Capturing video GStremer

Posted: Thu Dec 23, 2021 12:16 pm
by Sencis
Is there a way to capture (video0 & video2) with GStreamer in one pipeline?

This method displayed the image of only camera 2, it was expected that both images will be displayed together on the left and right, respectively.

Code: Select all

" gst-launch-1.0 max-buffers=1 drop=true sync=false" 
" v4l2src device=/dev/video"+ std::to_string(device_1) + " !" 
" video/x-raw," 
" width=(int)" + std::to_string(capture_width) + "," 
" height=(int)" + std::to_string(capture_height) + "," 
" format=GRAY8," 
" framerate=(fraction)" + std::to_string(framerate) +"/1 !" 
" appsink" 
" v4l2src device=/dev/video"+ std::to_string(device_2) + " !" 
" video/x-raw," 
" width=(int)" + std::to_string(capture_width) + "," 
" height=(int)" + std::to_string(capture_height) + "," 
" format=GRAY8," 
" framerate=(fraction)" + std::to_string(framerate) +"/1 !" 
" appsink";

Re: Capturing video GStremer

Posted: Fri Dec 24, 2021 9:21 pm
by Sencis
it seems this is how it works

Code: Select all

 " gst-launch-1.0 -e"
            " v4l2src device=/dev/video0 ! videorate !"     
            " video/x-raw,"
            " width=(int)640,"
            " height=(int)400,"
            " format=GRAY8,"
            " framerate=(fraction)50/1 !"
            " m.sink_0"
            " v4l2src device=/dev/video2 ! videorate !"
            " video/x-raw,"
            " width=(int)640,"
            " height=(int)400,"
            " format=GRAY8,"
            " framerate=(fraction)50/1 !"
            " m.sink_1"
            " glvideomixer name=m sink_1::xpos=640 ! video/x-raw, width=(int)1280, height=(int)400, format=GRAY8, framerate=(fraction)50/1 !"
            " appsink max-buffers=1 drop=true sync=false";

Re: Capturing video GStremer

Posted: Mon Dec 27, 2021 2:14 pm
by Realizator
Hi Sencis,

Am I got you right that you are using HDMI output and HDMI capture device to get video frames?

Re: Capturing video GStremer

Posted: Thu Dec 30, 2021 11:46 am
by Sencis
No, I am using two ov9281 csi-2 cameras. Link to the topic by cameras: https://forums.raspberrypi.com/viewtopic.php?t=325883

Re: Capturing video GStremer

Posted: Tue Jan 04, 2022 9:55 pm
by Realizator
Uh, got you, thanx!

We've tried to use glvideomixer for bigger resolutions and color images, but the performance was poor. The idea was to find the workaround for the stereoscopic mode until the Bullseye new video subsystem fully supports it. Now we're still on Bullseye.