spdl.io.DecodersStats¶
- class DecodersStats¶
Counters of a bulk hardware video decoder, for performance analysis.
Returned by the
stats()method of the bulk hardware video decoders, which decode many clips concurrently on worker threads (lanes) with a pool of hardware decoder sessions.Counters and times (
*_ns, summed over the lanes) only increase: take two snapshots and divide the differences by the elapsed wall time (times also bynum_lanes) to get rates and fractions of lane time. The other fields are gauges of the current state. A backend leaves the fields that do not apply to it at zero.How to read them:
Starved: a large share of
idle_ns. The producer (demuxing, submission) is the bottleneck, or too few clips are in flight.Saturated:
queue_wait_nsandqueuedgrow. Clips are submitted faster than they are decoded.Engine-bound:
sync_nsis close tobusy_ns. More lanes do not help.Setup-bound: a large
setup_nswith manymisses. The decoder cache (max_memory_bytes) is too small, or the clip sizes are too varied for thesize_buckets.Copy-bound: a large
copy_wait_ns.frames_in_flightis too low.
The rest of
busy_nsis bitstream parsing and submission to the driver (CPU).Added in version 0.10.0.
Attributes
Time spent creating decoders on cache misses.
Time the lanes spent decoding clips.
Clips decoded.
Part of
busy_nsspent waiting for older frames to be copied out before taking another one.Cached decoders now, idle or in use.
Time spent destroying decoders in the background.
Number of hardware decode engines of the device.
Idle decoders released under
max_memory_bytes.Clips that failed, including
unsupported.Frames output (with
frame_indices, only the selected ones).Decoder leases served by a cached decoder.
Cached decoders not in use now.
Time the lanes waited for a clip.
Estimated GPU memory of the cached decoders now.
Decoder leases that created a decoder.
Number of lanes (worker threads).
Evicted decoders waiting for destruction in the background.
Time the clips spent queued before a lane took them.
Clips waiting for a lane now.
Clips being decoded now.
the parser, and leasing and reconfiguring a decoder.
for a decoded frame to be ready, or for a free decode surface.
Clips the hardware cannot decode.
- property alloc_ns¶
Time spent creating decoders on cache misses.
- property busy_ns¶
Time the lanes spent decoding clips.
busy_ns / (num_lanes * wall)is the lane utilization.
- property clips¶
Clips decoded.
- property copy_wait_ns¶
Part of
busy_nsspent waiting for older frames to be copied out before taking another one.
- property decoders¶
Cached decoders now, idle or in use.
- property destroy_ns¶
Time spent destroying decoders in the background.
- property engines¶
Number of hardware decode engines of the device.
- property evictions¶
Idle decoders released under
max_memory_bytes.
- property failed¶
Clips that failed, including
unsupported.
- property frames¶
Frames output (with
frame_indices, only the selected ones).
- property hits¶
Decoder leases served by a cached decoder.
- property idle_decoders¶
Cached decoders not in use now.
- property idle_ns¶
Time the lanes waited for a clip.
- property memory_bytes¶
Estimated GPU memory of the cached decoders now.
- property misses¶
Decoder leases that created a decoder.
- property num_lanes¶
Number of lanes (worker threads).
- property pending_destroys¶
Evicted decoders waiting for destruction in the background.
- property queue_wait_ns¶
Time the clips spent queued before a lane took them. Divide by
clips + failedfor the mean.
- property queued¶
Clips waiting for a lane now. Their outputs are already allocated.
- property running¶
Clips being decoded now.
- property setup_ns¶
the parser, and leasing and reconfiguring a decoder. Includes
alloc_ns.- Type:
Part of
busy_nsspent on per-clip setup
- property sync_ns¶
for a decoded frame to be ready, or for a free decode surface.
- Type:
Part of
busy_nsspent waiting for the decode engine
- property unsupported¶
Clips the hardware cannot decode. Decode them on the CPU.