ros-drivers / gscam

ROS Camera driver for GStreamer-based video streams.
136 stars 172 forks source link

Multiple ROS sinks from a gstreamer pipeline with `tee` (ROS 2) #95

Open adeguet1 opened 6 months ago

adeguet1 commented 6 months ago

I need to capture a stereo video using a Decklink card. The two channels are combined for a side-by-stereo for the viewer but I also need the unmodified videos for data collection. My gst-launch line looks like:

gst-launch-1.0 \
  decklinkvideosrc device-number=1 connection=sdi mode=1080i5994 ! deinterlace method=greedyh ! tee name=t1 \
  decklinkvideosrc device-number=0 connection=sdi mode=1080i5994 ! deinterlace method=greedyh ! tee name=t0 \
t1. ! queue ! c. \
t0. ! queue ! c. \
compositor name=c \
    sink_0::xpos=0  sink_0::ypos=0 sink_0::width=960 sink_0::height=1080\
    sink_1::xpos=960 sink_1::ypos=0  sink_1::width=960 sink_1::height=1080 ! \
    video/x-raw,width=1920,height=1080 ! \
    autovideosink \
t1. ! queue ! autovideosink \
t0. ! queue ! fpsdisplaysink video-sink=autovideosink text-overlay=true

I have two tees and one compositor so 3 outputs. Is there any way to code this in a launch file? If not, I assume I will have to code this in C++.