In this article
A requested video timestamp does not identify all decoding work needed to reach the accepted frame.
The comparison being tested
A video-inference benchmark requests isolated timestamps and divides runtime by the number of returned frames. Another implementation looks faster because it accepts the first frame after seeking instead of decoding to the target. Those outputs may represent different observations. Even when outputs match, different keyframe distances can change hidden decode-forward work. Random-access throughput needs both a target-acceptance contract and an account of processed dependencies.
The confounding mechanism
PyAV documents seeking near a keyframe and recommends decoding forward to the desired position in typical cases. The seek offset uses the selected stream’s time base when supplied, otherwise the container API’s base. A timestamp request is not an exact universal frame-index lookup. Compressed dependencies, demuxing and decoder buffering can require work on material not returned to the inference model.
Fix the experimental contract
Fix source media, target timestamps, stream identity, offset conversion and the rule for accepting a returned frame. State whether the test measures seek-only, seek-through-target decoding or complete inference. Preserve codec and keyframe structure rather than comparing different encodes as identical input. If temporal tolerance is allowed, define it before testing and retain the actual accepted presentation timestamp.
A step-by-step comparison
First build a small source fixture with identifiable frame content and target locations around keyframes. Seek using the documented units, then decode until the declared acceptance condition holds. Record processed packets or decoded frames where observable, including discarded predecessors. Compare ordered and random target requests separately. Verify accepted pixels and timestamps before attributing a runtime difference to a faster decoder or model.
Evidence required for the result
The report needs requested and accepted times, keyframe context, decoder settings, failure outcomes and the amount of intermediate work. A control intentionally returns the first post-seek frame: it should fail the target contract when that frame is not acceptable. Keep missing targets explicit instead of replacing them with nearby frames under an undocumented rule. End-to-end results must retain actual inference input identity.
Interpretation and limits
Not every format supports identical seeking semantics, and any_frame is not a guarantee that dependency decoding disappears. Storage caching and request order remain additional influences. This protocol concerns offline random-access benchmark work, rather than choosing event-clip boundaries or deleting coded dependencies from a live stream. No new video decoding performance is claimed; the goal is comparable accepted observations and visible hidden work.
Primary references and related reading
A requested video timestamp does not identify all decoding work needed to reach the accepted frame. PyAV container seeking and decoding; PyAV time and presentation timestamps.
The proposed investigation of video seek decode forward work is not an executed deployment benchmark. Related reading: PyAV video datasets: presentation timestamps are safer than frame-number clocks; Index video keyframes: scene detection versus fixed-rate sampling.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.