The following pipeline demonstrates the use of the vvas_xmetaaffixer plug-in, where in, it is taking input on the master sink pad which has the inference metadata result for the resnet model (classification). On the slave sink pad, it is taking the 720p scaled version of the input image. Output on the master source pad will have no change in the metadata information. For output on the slave source pad, vvas_xmetaaffixer uses the master pad’s classification inference result and adds it as meta data
Note
The following JSON examples are only samples. Ensure
model-pathis set to point to your available model before running.
gst-launch-1.0 filesrc location=<INPUT>.nv12 \
! rawvideoparse width=<INPUT_WIDTH> height=<INPUT_HEIGHT> format=nv12 ! queue ! tee name=t \
! vvas_xinfer config-file=/etc/vvas/configs/infer/resnet50_onnxrt.json name=infer1 ! queue \
! ma.sink_master vvas_xmetaaffixer name=ma ma.src_master \
! queue ! vvas_xmetaconvert config-location=/etc/vvas/configs/metaconvert/metaconvert_config.json ! vvas_xoverlay \
! filesink location=output_master.nv12 t. \
! vvas_xabrscaler xclbin-location=/run/media/mmcblk0p1/x_plus_ml.xclbin \
! "video/x-raw, width=1280, height=720, format=NV12" \
! queue max-size-time=0 max-size-bytes=0 \
! ma.sink_slave_0 ma.src_slave_0 \
! queue min-threshold-buffers=4 ! vvas_xmetaconvert config-location=/etc/vvas/configs/metaconvert/metaconvert_config.json ! vvas_xoverlay ! filesink location=output_slave.nv12 -v
Note
When master and slave branches are split from a tee, size the slave-branch
queue so it does not back-pressure the tee and starve the master
(inference) branch. For raw/uncompressed video, set max-size-bytes=0 on the
slave-branch queue (as shown previously); otherwise a single large buffer can
exceed the default byte limit and stall the branch, leaving some output frames
without metadata until the timeout elapses.