Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ChrisK2/10606922 to your computer and use it in GitHub Desktop.
Save ChrisK2/10606922 to your computer and use it in GitHub Desktop.
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

Vapoursynth

(You can also install VS via homebrew)

checkout https://github.com/vapoursynth/vapoursynth.git (get the latest release if something broke):

./bootstrap.py
./waf configure
./waf build
sudo pip3.4 install cython
python3.4 setup.py build
sudo ./waf install
sudo python3.4 setup.py install

flash3kyuu_db

checkout https://github.com/SAPikachu/flash3kyuu_deband.git:

./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

mpv

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

Example VS script (f3kdb.vpy):

import vapoursynth as vs
core = vs.get_core()

# only needed when libf3kdb.dylib wasn't installed
core.std.LoadPlugin("/path/to/libf3kdb.dylib")

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

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