There are two ways to limit pipeline execution to a specific number of frames:
Option 1 — ``num-buffers`` on ``filesrc``
Set num-buffers directly on the filesrc element. For filesrc pipelines, num-buffers is accurate. For multifilesrc pipelines with raw video format inputs, Option 2 (eos-after) is the preferred way to control frame count accurately.
filesrc location=input.bgr num-buffers=<N> ! rawvideoparse ...
Option 2 — ``identity eos-after``
Insert an identity element with eos-after=<N+1> into the pipeline. To process N frames, set eos-after=N+1 — the final buffer triggers EOS and is not written to the sink. For example, to process 10 frames, use eos-after=11.
This works for both filesrc and multifilesrc pipelines, preferably placed just before the final sink element — fpsdisplaysink if present, otherwise filesink:
... ! vvas_xoverlay ! queue ! identity eos-after=<N+1> ! filesink location=output.bgr
# or
... ! vvas_xoverlay ! queue ! identity eos-after=<N+1> ! fpsdisplaysink sync=false video-sink="filesink location=output.bgr"