Dear Ti staff,
We are developing a pipeline for a new feature, but encountered some performance issues that we would like to have some help.
The basic structure of the pipeline looks like this, the same video stream will have two different treatment in two sub streams , be combined together and pushed to kmssink:
1. The first sub stream will crop the video stream with fixed parameters.
2. The second sub stream, having full video stream as input, will crop & zoom the video with variable parameters. Instead of tee, we used the tiovxmultiscaler to create two different streams, and modified the tiscaler plugin to accept dynamic parameters.

The pipeline is as follows:
gst-launch-1.0 \
v4l2src device=/dev/video3 io-mode=5 ! \
video/x-bayer, width=1920, height=1280, format=bggr12, framerate=60/1 ! queue leaky=2 ! \
tiovxisp sensor-name=SENSOR_OX3C \
dcc-isp-file=/opt/imaging/ox3c/dcc_viss_wdr.bin \
sink_0::dcc_2a_file=/opt/imaging/ox3c/dcc_2a_wdr.bin sink_0::device=/dev/v4l-subdev2 format-msb=11 \
sink_0::pool-size=2 src::pool-size=2 ! \
queue leaky=2 ! \
tiovxldc dcc-file=/opt/imaging/ox3c/dcc_ldc_wdr.bin sensor-name=SENSOR_OX3C ! \
video/x-raw, format=NV12, width=1920, height=1280,framerate=60/1 ! queue leaky=2 ! \
tiovxmultiscaler name=split_0 src_0::roi-startx=0 src_0::roi-starty=0 src_0::roi-width=1920 src_0::roi-height=1280 target=0 \
src_1::roi-startx=0 src_1::roi-starty=0 src_1::roi-width=1100 src_1::roi-height=1200 target=1 \
interpolation-method=16385 \
split_0. ! queue ! \
video/x-raw, width=1920, height=1280 ! \
tiscaler roi-startx=0 roi-starty=0 roi-width=800 roi-height=430 method=0 ! \
queue ! \
video/x-raw, width=1280, height=720, framerate=60/1 ! mosaic_0. \
split_0. ! queue ! \
video/x-raw, width=640, height=720 ! mosaic_0. \
tiovxmosaic name=mosaic_0 target=0 src::pool-size=4 \
sink_0::startx="<0>" sink_0::starty="<0>" sink_0::widths="<1280>" sink_0::heights="<720>" \
sink_1::startx="<1280>" sink_1::starty="<0>" sink_1::widths="<640>" sink_1::heights="<720>" ! \
video/x-raw,format=NV12, width=1920, height=720 ! queue max-size-buffers=1 leaky=0 ! \
kmssink driver-name=tidss async=false sync=false
We used gst_tracer to monitor the performance, and observed high latency.

Whats worse, with photoresistors and oscilloscope, the latency measurement was even bigger than 200ms, which is much bigger than the accumulated latency from the above picture.
Regarding the total latency, currently I have two question:
1. How would tiovxmultiscaler behave in this case? My assumption is that the video data would be copied once for each frame, contributing considerable amount of latency.
2. Would tiovxmosaic wait for both sub streams to be ready? The second sub stream involves more procedures so the processing time should be longer than the first one. If that is the case, can tiovxmosaic generate the output with the timing of the first sub stream, and how to achieve that?
BTW, currently there may be too many queues in the pipeline, we'll try to cut down the number, but achieving the framerate of 60fps would be our priority.
Thank you very much for the help in advance and looking forward to your reply. If you need any other details, please don't hesitate to tell us.
Regards,
Huang Jingjie


















