-
Notifications
You must be signed in to change notification settings - Fork 139
Building
- cmdline (For building CLI, use a modified version, will download automatically by CMake)
- OpenCV (C++ lib, OpenCV3 or newer)
- OpenCL (recommend to use the sdk provided by Intel , see #13)
- Qt5 (for GUI)
- boost filesystem (optional, 1.6 or newer, for compiler that doesn't support filesystem yet)
- TBB (optional)
- CUDA (optional)
- DirectShow SDK (for DSFilter)
- VapourSynth SDK (for VapourSynth plugin)
- AviSynthPlus SDK (for AviSynthPlus plugin)
Compiler: MSVC (recommend VS2019), Clang (Mingw64 are not fully support C++17 filesystem
yet)
Use CMake to generate the project, all libs will be auto found by CMake except VapourSynth, you need to specify it manually.
- For MSVC, remember to change generating method form
debug
torelease
, and compile it. - For clang, just
make
it.
Get your binary file in bin
folder.
- CMake 3.0 or higher is required
- OpenCV, OpenCL
- Compiler: [G++](recommend g++8 or higher), Clang
- boost filesystem (optional)
- Qttools5 (qttools5-dev and qttools5-dev-tools) (Can be ignored for cli build)
Use CMake to generate the project
cmake ..
Just make
it.
Get your binary files in bin
folder.
Tested on Ubuntu 18.04 with g++ 8.4.0
#install dependency
sudo apt install libopencv-dev ocl-icd-opencl-dev cmake
#clone repo
git clone https://github.com/TianZerL/Anime4KCPP.git
#cmake it
cd Anime4KCPP && mkdir build && cd build && cmake ..
#make it
make
#check it
cd bin && ./Anime4KCPP_CLI -V
Building on macOS (from NightMachinary)
We need to install all the aforementioned dependencies via brew (excpet OpenCL which is provided by Apple):
brew install opencv qt ffmpeg openh264 cmake
For brew's qt to work you need to set these (see latest instructions by brew info qt
):
# If you need to have qt first in your PATH run:
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc
# For compilers to find qt you may need to set:
export LDFLAGS="-L/usr/local/opt/qt/lib"
export CPPFLAGS="-I/usr/local/opt/qt/include"
# For pkg-config to find qt you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/qt/lib/pkgconfig"
Now we need to fix macOS libomp problem (copied from here):
-
Install LLVM with openmp and libomp with brew
brew update brew install llvm libomp
-
Run CMake with the new compilers
# in repo's root cmake -DCMAKE_C_COMPILER="/usr/local/opt/llvm/bin/clang" -DCMAKE_CXX_COMPILER="/usr/local/opt/llvm/bin/clang++" .
Now we just run make
. The binaries should have been installed to ./bin/
.
Note that Apple has deprecated OpenCL (to force its own proprietary Metal API), and may remove support for it in later versions.
- Create a new project in your Android studio
- Copy all of the files of Android to your project
- Copy Anime4KCore folder to app/src/main/cpp/
- Set your libs (OpenCV OpenCL for Android) path in app/src/main/cpp/CMakeLists.txt
- Build
NOTICE: You must build the OpenCV with FFmpeg for Android by yourself, otherwise the video processing will be faulted.