Code Monkey home page Code Monkey logo

anime4k-1's Introduction

Logo of the project

Anime4K-PyWrapper

Wrapper for Anime4K

Makes it easy to encode a Anime using the MPV shaders with predefined encoding profiles!

Installing / Getting started

What you need:

  • Linux (sorry its the fault of mpv)
  • Python 3.X
  • mpv > 0.32
  • ffmpeg
  • mkvnixtool (e.g mkvtoolnix on Ubuntu)
  • mediainfo (e.g libmediainfo-dev mediainfo on Ubuntu)
  • A dedicated GPU (no VM) [AMD/NVIDIA/Intel]

Installing the necessary python libs

pip3 install -r requirements.txt

Initial Configuration

Download the latest shaders (GLSL (v3.1 Stable)) from here. Put them all into one folder for example called shaders

Upscaling your first Anime!

Assuming your Anime Movie/Episode is called input.mkv and has a resolution of 1920x1080. Now you want to upscale it to 4K (3840x2160). Here are the commands you would run.

  1. Encode the Video (to x264 and upscale it using the shader with the first Option [CPU])
python3 Anime4K.py -m shader --shader_dir "./shaders" --width 3840 --height 2160 -i input.mkv --output x264_upscale.mkv
  1. Choose the option CPU (only x264 4:4:4)... (for this example)
  2. Follow the dialogues - they should be pretty self explanatory
  3. Your file should now be in x264_upscale.mkv
  4. Now we need to encode the file to x265 10bit
python3 Anime4K.py -m encode -i x264_upscale.mkv --output x265_10bit.mkv
  1. Choose your desired encoding preset.
  2. The output file x265_10bit.mkv has no audio or subtitles we add them in the next step.
  3. Extract the audio and subtitles from the original file
python3 Anime4K.py -m audio -i input.mkv
python3 Anime4K.py -m subs -i input.mkv
  1. Now we have the audio files and subtitles in the current folder.
  2. Now lets add them into the final output
python3 Anime4K.py -m mux -i x265_10bit.mkv -o input_upscaled_with_audio_and_subs.mkv

Feel free to explore the other options of the program (or profiles) by typing:

python3 Anime4K.py --help

[Optional] Encoding ffmpeg progressbar

To get a overview of your current encoding of ffmpeg you may install the ffmpeg-progressbar-cli

npm install --global ffmpeg-progressbar-cli

Don't worry the script will also work with normal ffmpeg.

Features

  • Encode Videos with Anime4K shaders easily
  • Encode using NVENC or CPU
  • Extract Audio and subtitles automatically
  • Predefined profiles for Anime4K and ffmpeg

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

Links

Licensing

The code in this project is licensed under GNU GENERAL PUBLIC LICENSE.

anime4k-1's People

Contributors

thoughtfuldev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.