BestSource 2 – Frame Accurate Seeking in Everything!

Many of you VapourSynth and Avisynth users are probably familiar with FFMS2, the reasonably useful source plugin that can open almost everything and fairly often seeks properly. Or at least it used to seek fairly well back when it was released 17 years ago. Since then the number of seeking workarounds and complexity has reached insane levels due to many newer video codecs having more and more complex reordering with invisible frames and other tricks. This broke every single original assumption made about seeking. And then the new assumptions were broken. And the new new assumptions failed. And the shiniest and freshest assumptions produced the wrong frames before finally ending at the current state of not being completely broken again.

Due to the insane tedium of trying to find new workarounds I lost interest in trying to fix FFMS2. Instead I started on BestSource. The first official release 2 years ago did pure linear decoding only with some caching and tricks behind the scenes to allow for relatively fast jumping around (by linear decoding standards). It was correct but for high resolution files over 5 minutes it was not enjoyable to use. It definitely had its niche use cases but FFMS2 still had hardcore followers for a reason.

That was however just where the project stopped due to a lack of time. The plan was always to implement seeking by hashing the output frames and using that to figure out where seeking actually takes us. And now it’s happened. Perfect and fast seeking in almost all formats and containers. Complete with proper RFF handling and in most cases the index only takes up 9 bytes per frame where 8 of them is the hash itself. FFMS2 is now officially obsolete.

But why didn’t anyone do it earlier? The idea is obvious. Many FFMS2 contributors with sufficient coding skills have thought about doing it. And after you’ve accepted an indexing pass it’s a no-brainer! Except that back in 2007 it would’ve been unacceptably slow. Even parsing a whole movie to index it generated complaints because hard drives were true snails. Doing a full decode of every frame would’ve ensured nobody wanted to use it. Besides, handling the delay introduced by b-frames wasn’t hard and only mpeg4 asp and h.264 existed that had to be tested for this complexity. For a short time it was possible to both be fast and correct. Apart from the poor and unreliable seeking in FFmpeg’s mpeg/mpegts demuxers which would surely be fixed soon and then all popular containers would work well! (It has to this day not been improved at all)

FFMS2000 – Help Test the Future

The past few weeks I’ve spent quite a bit of time re-factoring and updating FFMS2 and the result is now ready for initial testing in this doom9 thread. It’s a much needed update to clear out all unnecessary old hacks and finally deal with a few issues.

Report all regressions you find here or over att doom9 and I’ll try to fix with them.

FFMS 2.23 – Trigger Warning

Why do we need a trigger warning you ask? Because the mere idea of FFMS2 being updated is a big shock to most people? No. In fact it was caused by me once again declaring that XP is a dead end. This time using slightly different wording. If you meet any of these unfortunate users in real life don’t tell them that XP support ended long ago. They may go on a violent rampage or even worse, be offended.

Also a pile of bugs got fixed but nobody actually cares about that, after all we’ve now got a controversy surrounding this release and that’s more interesting.

XP Background

Look at this image and remember the good old times that were actually shit