Capturing video GStremer

Raspberry Pi cameras (V1, V2, wide angle etc), HDMI capture modules etc.
Post Reply
Sencis
Posts: 4
Joined: Fri Dec 10, 2021 10:09 am

Capturing video GStremer

Post 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";

Sencis
Posts: 4
Joined: Fri Dec 10, 2021 10:09 am

Re: Capturing video GStremer

Post 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";

User avatar
Realizator
Site Admin
Posts: 850
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Capturing video GStremer

Post by Realizator »

Hi Sencis,

Am I got you right that you are using HDMI output and HDMI capture device to get video frames?
Eugene a.k.a. Realizator

Sencis
Posts: 4
Joined: Fri Dec 10, 2021 10:09 am

Re: Capturing video GStremer

Post 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

User avatar
Realizator
Site Admin
Posts: 850
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Capturing video GStremer

Post 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.
Eugene a.k.a. Realizator

Post Reply