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)

R67 & R68 – A Quick Succession of Bug Fixes

Lots of bug fixes, especially for audio handling. R67 is more or less a useless pile of regressions so avoid that one. There were a few mistakes made when converting lot of path handling code to C++17.

Also the ccf* and fm* enums in Python have been renamed. Or more exactly they were never supposed to be public in the first place. The one person affected by this has been informed there are no refunds.

New discord server and no more discussion page

The discussion page never really worked well. I forgot to check it and so did the people posting there if I asked something. So now it’s gone. It’s instead been replaced by the “Help and Chat” page (name may change later) which lists a few places where VapourSynth users usually hang out.

I also started a discord server for VapourSynth since the other ones I was in died. Find the link in the “Help and Chat” page. That’s a bad name. I’ll change it later.

R66 & R65 – Installation Scripts and Many Small Improvements

Lots of people have asked for an installer that also sets up Python and all other basic components so they can get started quickly. Because of this I have now created a PowerShell script that will set up a complete portable environment. Just grab Install-Portable-VapourSynth-R*.ps1 from the release and run it. Everything will be installed into the current directory. It will probably be expanded upon further in the next release and install even more things so feel free to suggest the additional things you want. Maybe an optional editor or the option to directly install the most common plugins and scripts. Or even optional VFW integration?

Now to the small things. Python 3.12.x is now required. Several rare memory leaks and crashes were fixed. There’s a new graph output mode in vspipe that also includes filter times. Audio headers in VFW have been improved so normal DirectShow media players can be used for audio preview.

R64 – New things break old things

This release fixes a lot of new things, Zen4 CPUs, Cython 3.x and OSX (not so new) compilation broken in R63.

It’s also the end for 32 bit binaries compiled by me. These binaries get almost no downloads and x64 was first introduced 24 years ago. At this point all x86 fans have a 64 bit CPU. And if you don’t you probably shouldn’t be processing video at all. 32 bit builds are also a lot less useful now that most Avisynth plugins have either been ported or have 64 bit support.

Next thing to go will probably be optimizations for x86 CPUs with less than AVX2. It’s already been 10 years since AVX2 was introduced and 8 years since all CPUs have shipped with support for it. These are more or less the same numbers SSE2 had back when I originally released VapourSynth with a SSE2 minimum requirement.

I bet many doom9 users will rage when that day comes, just like when XP support was removed.

R60 – Fix bugs and remove deprecated functions in Python

Not much to say about this release apart from the fact that it finally removes all functions that got deprecated with the release of the API4 branch. If you were still using these you were doing things wrong anyway. May break some old scripts but most already have updated versions. The removed functions are:

  • get_frame_async_raw
  • get_plugins
  • get_functions
  • list_functions
  • get_format
  • register_format