fpsdisplaysink
What it is
fpsdisplaysink is a video sink wrapper used for quick performance checks. It
receives video buffers, sends them to a real video sink, and measures:
- current FPS
- average FPS
- dropped-frame rate
- rendered-frame count
- dropped-frame count
By default it draws the FPS text on top of the video. It can also print or emit the measurements without drawing text.
Use another sink as backend
fpsdisplaysink is not usually the final renderer by itself. It owns an
internal video-sink property, and that property can be set to another sink.
Use xvimagesink:
Use autovideosink:
Use fakesink when you want to benchmark the pipeline without displaying
video:
Use a more complex backend by quoting the sink bin:
Set video-sink before the pipeline starts. In application code, configure it
while the pipeline is still in NULL state.
Useful properties
| Property | Use |
|---|---|
video-sink |
Select the real backend sink used to render or consume video. |
text-overlay |
Show FPS text on the video. Set false for headless logging or benchmarking. |
fps-update-interval |
Measurement update period in milliseconds. Default is 500. |
sync |
Sync rendering to the pipeline clock. Set false to measure how fast the pipeline can run. |
silent |
Disable status message output. |
signal-fps-measurements |
Emit the fps-measurements signal for application code. |
Example: measure max throughput without display sync:
Example: update the FPS display once per second:
Runtime measurements
The element exposes read-only counters:
frames-rendered: number of frames rendered by the backend sinkframes-dropped: number of frames dropped by the backend sinkmin-fps: minimum measured FPSmax-fps: maximum measured FPSlast-message: current status text
For applications, enable signal-fps-measurements=true and connect to the
fps-measurements signal. The callback receives:
fps: current measured FPSdroprate: current dropped-frame rateavgfps: average FPS
Common patterns
Display video and overlay FPS:
Measure a decode pipeline without drawing overlay text:
Benchmark a pipeline without a real display: