A short guide to build & install VapourSynth, flash3kyuu_db and use it with mpv for debanding video on playback on Ubuntu & Mint
Based on ChrisK2's "How to Vapoursynth + flash3kyuu_db for mpv on Mac OS X" guide https://gist.github.com/ChrisK2/10606922
Install basic building tools:
sudo apt-get install build-essential yasm intltool automake autoconf libtool devscripts equivs
Install the libraries and headers for libavutil, libavcodec, and libswscale:
sudo apt-get install libavutil-dev libavcodec-dev libswscale-dev
Install python3 and cython for python3:
sudo apt-get install python3-dev cython3
Get the latest version of VapourSynth:
git clone https://github.com/vapoursynth/vapoursynth.git --depth=1
or download it fromhttps://github.com/vapoursynth/vapoursynth/releases
Fetch Waf, configure, build:
python3 ./bootstrap.py ./waf configure ./waf build python3 ./setup.py build
Install:
sudo ./waf install sudo python3 ./setup.py install
Run this 3-lines Python 3 script to test if the installation succeeded:
import vapoursynth as vs core = vs.get_core() print(core.version())
- Get the latest version:
git clone https://github.com/SAPikachu/flash3kyuu_deband.git --recursive --depth=1
./waf configure
./waf build
- The file
flash3kyuu_deband/build/libf3kdb.so
is the VapourSynth module we need. Copy it to somewhere, or install itsudo ./waf install
and use this path/usr/local/lib/libf3kdb.so
Get the latest version
git clone https://github.com/mpv-player/mpv-build.git --depth=1
In file
./update
, change line 7 togit clone --depth=1 "$2" "$1"
. Option--depth=1
makes git fetch the minimum amount of data and ignore needless history.In file
./rebuild
, change line 4 to./update --master
to get master branch by default.Fetch sources (master branch):
./update --master
Install dependancies: run
mk-build-deps
to generate a dummy package that depends on the required packages (mpv-build-deps_1.0_amd64.deb
) and install it.Enabling optional ffmpeg dependencies (optional):
sudo apt-get install libx264-dev libmp3lame-dev libfdk-aac-dev echo --enable-libx264 >> ffmpeg_options echo --enable-libmp3lame >> ffmpeg_options echo --enable-libfdk-aac >> ffmpeg_options echo --enable-nonfree >> ffmpeg_options
Build:
./build -j4
. The binary./mpv/build/mpv
can be used as-is.Install:
sudo ./install
Make a VapourSynth file (
~/.mpv/f3kdb.vpy
)import vapoursynth as vs core = vs.get_core() core.std.LoadPlugin("/usr/local/lib/libf3kdb.so") 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()
Add this line to
~/.mpv/input.conf
:b vf toggle vapoursynth=/home/yourusername/.mpv/f3kdb.vpy
.~/.mpv/f3kdb.vpy
doesn't work for some reasons.Open a video to test:
mpv /path/to/banding.mkv
. Press b to enable the filter. You should see visual improves, and this lineOpening video filter: [vapoursynth file=~/.mpv/f3kdb.vpy]
in terminal.
python3 ./bootstrap.py
python3: can't open file './bootstrap.py': [Errno 2] No such file or directory
What kind of file is this? Where it supposed to be?