Quick tip - How to peek into Gstreamer pipelines

When developing a pipeline sometimes you want to check that what you think is passing through the pipeline is what you intended.
Especially before sending data to hailonet.

To add a “video tap” into your pipeline you can use this snippet:

tee name=probe_tee !  \
queue leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0  ! \
videoconvert ! autovideosink name=probe_display sync=false  \
probe_tee. ! queue leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0

This will create a tee and a video output window.
You can add it wherever you want in the pipeline.

Define it as a variable to ease usage: (python example)

DISPLAY_PROBE = f'tee name=probe_tee !  \
queue leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0  ! \
videoconvert ! autovideosink name=probe_display sync=false  \
probe_tee. ! queue leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 '

Example usage:

DETECTION_PIPELINE = f'{QUEUE()} name=pre_detection_scale ! \
        videoscale qos=false ! \
        {QUEUE()} name=pre_detecion_net ! \
        video/x-raw, pixel-aspect-ratio=1/1 ! \
        {DISPLAY_PROBE} ! \
        hailonet hef-path={hef_path} ! \
        {QUEUE()} name=pre_detecion_post ! \
        {DETECTION_POST_PIPE} ! \
        {QUEUE()}'

If you found this (or other posts) useful, please hit the :heart: button to help promote it to more people. Have insights, corrections, or questions? Share your thoughts in the comments!

3 Likes