I am trying to build a GStreamer pipeline which interleaves images from multiple cameras into a single data flow which can be passed through a neural network and then split into separate branches for sinking. I am successfully using the appsrc
plugin and the Basler Pylon 5 - USB 3.0 API to create the interleaved feed. However, before I go through the work to write the neural network GStreamer element, I want to get the splitting working.
Currently, I am thinking of tagging the images with an "ID" indicating which camera it came from. Then I thought I could split the data flow using this tag. However, I have not been able to find any subject matter dealing with this issue exactly. I have seen that you can use tee
plugin to branch the pipeline, but I haven't seen it used to split based on tags. Is it possible to use tee
to do this?
I have seen people use tee
to split a feed based on the source with something like this:
gst-launch-1.0 -vvv \
tee name=splitter \
$VSOURCE \
! $VIDEO_DECODE \
! $VIDEO_SINK splitter. \
$VSOURCE1 \
! $VIDEO_DECODE \
! $VIDEO_SINK splitter.
However, this does not allow me to have a single path through the neural network element.
If it helps, here is a diagaram of the pipeline I envision:
cam1 ---\ /---> udpsink/appsink
\ /
appsrc-->neural_network-->tee---
/ \
cam2 ---/ \---> udpsink/appsink