In a tee + vvas_xmetaaffixer pipeline, some frames on the slave/overlay
branch are output without metadata (for example, missing classification labels or
bounding boxes) - typically the first few frames, until the affixer timeout
elapses. The textual/master output might look correct while the overlay branch does not.
Root cause
The tee splits a common source into a master (inference) branch and one or
more slave branches. If a slave-branch queue fills and back-pressures the
tee, the tee blocks all of its branches - including the master branch
that feeds vvas_xinfer. With no buffer arriving on the master pad, the affixer
has no metadata to attach; its timeout watchdog then fires and force-pushes the
slave buffers downstream without metadata.
This is most common with raw (uncompressed) video, where a single buffer can be
large (for example a full-resolution RGB/RGBx or NV12 frame). The default queue
byte limit (max-size-bytes, ~10 MB) can be smaller than one such buffer, so the
queue fills after a single frame and immediately back-pressures the tee.
Confirm with debug logs
Enable the vvas_xmetaaffixer logs at level 7 (cumulative - captures both
following messages):
GST_DEBUG=vvas_xmetaaffixer:7 gst-launch-1.0 ...
Two messages indicate the problem:
Timeout occured-GST_INFO(level4); thetimeoutwatchdog fired because buffers did not arrive on all sink pads within thetimeoutduration.buffer is not availale at master pad-GST_LOG(level7); the master (inference) branch has no buffer; that is, it is being starved.
Example log when the slave-branch queue back-pressures the tee:
0:00:02.003456789 1234 0xaaaabbbb INFO vvas_xmetaaffixer gstvvas_xmetaaffixer.c:timeout_func:<ma> Timeout occured
0:00:02.003457012 1234 0xaaaabbbb LOG vvas_xmetaaffixer gstvvas_xmetaaffixer.c:vvas_xmetaaffixer_process:<ma> buffer is not availale at master pad
Seeing Timeout occured together with repeated buffer is not availale at
master pad messages - and output frames missing metadata until the timeout
elapses - confirms the slave-branch queue is back-pressuring the tee.
Fix
Size the slave-branch queue so it does not back-pressure the tee. For raw
video, remove the byte cap (and, if needed, the time cap):
... ! queue max-size-bytes=0 max-size-time=0 ! ma.sink_slave_0 ...
A large finite cap such as max-size-bytes=67108864 (64 MB) works equally well.
These settings keep slave buffers queued long enough for the affixer to match them
to the master metadata within the timeout window, so all output frames are
correctly annotated.