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=1or download it from- https://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.sois the VapourSynth module we need. Copy it to somewhere, or install itsudo ./waf installand 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 to- git clone --depth=1 "$2" "$1". Option- --depth=1makes git fetch the minimum amount of data and ignore needless history.
- In file - ./rebuild, change line 4 to- ./update --masterto get master branch by default.
- Fetch sources (master branch): - ./update --master
- Install dependancies: run - mk-build-depsto 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/mpvcan 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.vpydoesn'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 line- Opening video filter: [vapoursynth file=~/.mpv/f3kdb.vpy]in terminal.
Replaced by autotools: