Opened 3 years ago
Last modified 3 years ago
#1100 new enhancement
More intelligent video cache for backwards seeking
| Reported by: | rmrm | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Video | Version: | 2.1.7 |
| Severity: | minor | Keywords: | |
| Cc: | Platform: | All | |
| Sub Component: |
Description
Apparently Aegisub keeps a cache of the last 8 decoded frames to avoid lengthly seeks.
However, when seeking backwards frame-by-frame, once you escape the cache, every new frame takes a lengthy seek, which is quite painful.
A better way to handle this is, when seeking backwards, fetch the frame 7 frames before the requested one, or the nearest keyframe, whichever is closer. Then fetch all the frames sequentially until the desired one.
This cuts the number of expensive seeks to 1/8, and doesn't make them much slower than before (barring a few memory copies). Going to the next frame is no problem either: since you just decoded the last frame, decoding the very next one is fast even if it isn't on the cache - no seek required from the decoder.
An option to configure the number of cached frames would be nice too.

We're aware of this problem. Eventually we'll be changing the frame cache to MB or % of memory versus a static list of a # of frames that gets invalidated quickly.