Coder Social home page Coder Social logo

bad-apple's Introduction

Bad Apple!!

Play the video in the console as ASCII art. You can watch anime by it while you are connected by SSH.

Where there is light, there is Bad Apple!!

Python Module

GIF

Performance

1080p60Hz on modern high-performance PCs.

Help

The file extension generated by preloading is .badapple. Automatically enter preload-replay mode when the input file extension is .badapple.

usage: badapple [options] ... 
  (BadApple-Decoder-OS-ISA-Version)
options:
  -i, --input        video file (string [=./badapple.mp4])
  -o, --output       [preload] output file (string [=])
  -f, --font         font data file (string [=])
  -a, --audio        audio file (string [=])
  -p, --player       player [ffmpeg mpv mpg123 cmus] (string [=])
  -s, --scale        width:height (0 means auto) (string [=0:0])
  -r, --rate         frame rate (double [=1024])
      --not_clear    not clear screen (with ANSI) before each frame
      --contrast     contrast enhancement
      --preload      preload video (not play)
      --debug        [debug]
  -?, --help         print this message

Clone

git clone --recurse-submodules --remote-submodule https://github.com/userElaina/Bad-Apple.git

or

git clone https://github.com/userElaina/Bad-Apple.git
cd Bad-Apple/
git submodule update --init

How to build

*Tested on x86_64 & aarch64

Windows-FFmpeg

Dependencies

FFmpeg (Include ffmpeg ffprobe ffplay)

Compile
g++ "badapple-ffmpeg.cpp" -o "badapple-ffmpeg-win.exe" -w -g -O3

Windows-OpenCV

Dependencies

OpenCV

You may need to compile it yourself.

Compile
# Dynamic (libopencv_world481.dll)
g++ "badapple-opencv.cpp" -o "badapple-opencv481d-v2.1.0-win-amd64.exe" -w -g -O3 -I"$Env:OPENCV481\include" -L"$Env:OPENCV481\x64\mingw\lib" -llibopencv_world481
# Static (libopencv_world481.a)
g++ "badapple-opencv.cpp" -o "badapple-opencv481s-v2.1.0-win-amd64.exe" -w -g -O3 -static -I"$Env:OPENCV481A\include" -L"$Env:OPENCV481A\x64\mingw\staticlib" -lopencv_world481 -llibprotobuf -llibjpeg-turbo -llibwebp -llibpng -llibtiff -llibopenjp2 -lIlmImf -lzlib -lquirc -lade -lcomctl32 -lgdi32 -lole32 -lsetupapi -lwsock32 -lws2_32 -lpthread -luuid -loleaut32

Linux-FFmpeg

Compile

Dependencies

Use your package manager to install or upgrade C++ compiler, FFmpeg and dependencies if need, like

# Debian Ubuntu
sudo apt update
sudo apt install --upgrade gcc g++ ffmpeg
# Arch
sudo pacman -Syu gcc ffmpeg
Compile
g++ "badapple-ffmpeg.cpp" -o "badapple-ffmpeg-linux.out" -w -g -O3

Linux-OpenCV

Dependencies

Use your package manager to install or upgrade C++ compiler, OpenCV and dependencies if need, like

# Debian Ubuntu
sudo apt update
sudo apt install --upgrade gcc g++ libopencv-dev pkg-config
# Arch
sudo pacman -Syu gcc opencv vtk hdf5 pkgconf
Compile
g++ "badapple-opencv.cpp" -o "badapple-opencv-linux.out" -w -g -O3 `pkg-config --cflags --libs opencv4`

Fonts

If you don't want to change the font, (default font is Consola,) then you don't need to use Python.

Dependencies
pip install pillow
Interpret and Run

Change this line

f_font = 'font/consola.ttf'

to your font file path.

python -u "font/font.py"

To Do

C++ Python module

bad-apple's People

Contributors

userelaina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wututua

bad-apple's Issues

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.