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 by num_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_ns and queued grow. Clips are submitted faster than they are decoded.

  • Engine-bound: sync_ns is close to busy_ns. More lanes do not help.

  • Setup-bound: a large setup_ns with many misses. The decoder cache (max_memory_bytes) is too small, or the clip sizes are too varied for the size_buckets.

  • Copy-bound: a large copy_wait_ns. frames_in_flight is too low.

The rest of busy_ns is bitstream parsing and submission to the driver (CPU).

Added in version 0.10.0.

Attributes

alloc_ns

Time spent creating decoders on cache misses.

busy_ns

Time the lanes spent decoding clips.

clips

Clips decoded.

copy_wait_ns

Part of busy_ns spent waiting for older frames to be copied out before taking another one.

decoders

Cached decoders now, idle or in use.

destroy_ns

Time spent destroying decoders in the background.

engines

Number of hardware decode engines of the device.

evictions

Idle decoders released under max_memory_bytes.

failed

Clips that failed, including unsupported.

frames

Frames output (with frame_indices, only the selected ones).

hits

Decoder leases served by a cached decoder.

idle_decoders

Cached decoders not in use now.

idle_ns

Time the lanes waited for a clip.

memory_bytes

Estimated GPU memory of the cached decoders now.

misses

Decoder leases that created a decoder.

num_lanes

Number of lanes (worker threads).

pending_destroys

Evicted decoders waiting for destruction in the background.

queue_wait_ns

Time the clips spent queued before a lane took them.

queued

Clips waiting for a lane now.

running

Clips being decoded now.

setup_ns

the parser, and leasing and reconfiguring a decoder.

sync_ns

for a decoded frame to be ready, or for a free decode surface.

unsupported

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_ns spent 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 + failed for 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_ns spent on per-clip setup

property sync_ns

for a decoded frame to be ready, or for a free decode surface.

Type:

Part of busy_ns spent waiting for the decode engine

property unsupported

Clips the hardware cannot decode. Decode them on the CPU.