Performance not competitive against torchcodec #2263
oakaigh
started this conversation in
3. General
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 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
All reactions