Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Short tutorial on how to compile Vapoursynth and flash3kyuu_deband on Mac OS X and use it with mpv, might be out of date.

How to Vapoursynth + flash3kyuu_db for mpv on Mac OS X

by ChrisK
Thanks to torque

Why debanding?

To fix up poorly encoded anime. These comparisons speak for themselves:

Install dependencies

brew install python3


(You can also install VS via homebrew)

checkout (get the latest release if something broke):

./waf configure
./waf build
sudo pip3.4 install cython
python3.4 build
sudo ./waf install
sudo python3.4 install



./waf configure
./waf build

libf3kdb.dylib in build/

If you want to install it so that it gets loaded automatically:

sudo ./waf install
cd /usr/local/lib/vapoursynth && ln -s ../libf3kdb.dylib


If you build mpv using brew, rebuild it with the --with-vapoursynth option.

When you compile mpv manually, add this to your configure command:

PKG_CONFIG_PATH=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/pkgconfig/ ./waf configure ...

(path may need to be updated with python updates)


Example VS script (f3kdb.vpy):

import vapoursynth as vs
core = vs.get_core()

# only needed when libf3kdb.dylib wasn't installed

clip = video_in
clip = core.std.Trim(clip, first=0, length=500000)
clip = core.f3kdb.Deband(clip, grainy=0, grainc=0, output_depth=16)

To load the script on startup:

mpv --vf=vapoursynth=/path/to/f3kdb.vpy file.mkv

Or add this to mpv's input.conf to toggle debanding during playback using key "b":

b vf toggle vapoursynth=/path/to/f3kdb.vpy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment