Skip to content

Buffering with TIOVX Appsink

Daniel Chaves edited this page Sep 20, 2021 · 4 revisions

This represents an special use case, where the AppSink takes reference buffers from its upstream according with it's max-buffers property. By default, this property it's zero, which implies infinite amount of buffers. But the buffer pool the TIOVX elements have it's fixed size. So we need to comply that the AppSink does not have more buffers requests than the available at the TIOVX output buffer pool:

appsink max-buffers < tiovx output buffer pool size
  1. Incrementing the output buffer pool size on the TIOVX elements:
  • out-pool-size property to the TIOVXColorConvert element.
  • src_0::pool-size property to the TIOVXMultiScaler element.
  1. Adding the drop=true max-buffers=3 properties to the AppSink element.

All together in a pipeline:

LINK="file://path/to/my_video.mp4" 
GST_DEBUG=3 gst-launch-1.0 uridecodebin uri=$LINK caps=video/x-h264 ! queue ! h264parse ! \
v4l2h264dec capture-io-mode=5 ! video/x-raw,format=NV12 ! queue ! \
tiovxmultiscaler src_0::pool-size=8 sink::pool-size=8 ! \
tiovxcolorconvert in-pool-size=8 out-pool-size=8 ! video/x-raw,width=320,height=240,format=RGB ! \
perf ! appsink sync=true qos=false emit-signals=true drop=true max-buffers=3 -e

Note: The perf element corresponds to the RidgeRun Gst-Perf [1] element that leads you watch the passing buffers.

[1] https://github.com/RidgeRun/gst-perf

Clone this wiki locally