Performance not competitive against torchcodec #2263
Replies: 1 comment
-
|
The cause is decoder threading, not the seek. av.open() defaults to It hits seeking because seek() only jumps to the nearest keyframe; you then Fix: opt into frame threading before decoding: container = av.open(path)
stream = container.streams.video[0]
stream.thread_type = "AUTO" # or "FRAME"On my 8-core machine this took 40 random seeks from ~96 ms to ~28 ms each |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It appears that random access (with approximate seeking) in pyav can be 5x slower than torchcodec. The video used for benchmarking is
av.datasets.curated("pexels/time-lapse-video-of-sunset-by-the-sea-854400.mp4").I have tested other mp4 files and for files with short gops (e.g. 2), although the differences are not as big (~2x), seeking seems to consistently take almost the same amount of time as decoding.
Beta Was this translation helpful? Give feedback.
All reactions