Skip to content

Bad Apple!!

Ubuntufanboy edited this page Nov 29, 2022 · 2 revisions

Bad Apple!! Wiki

Really zoomed out gnome terminal

Table of contents

  • How it works
  • Common errors
  • How to edit the code
  • About the creator

How it works

First file (framer.py)

framer.py is the easiest to understand. framer.py uses a tool called yt-dlp which will download bad apple off of youtube. Next, framer.py uses a tool called ffmpeg which takes the video file and turns it into about ~3000 frames (15 frames per second) an important thing to note is ffmpeg downloads these frames in the format output000001 for the first file then output000002 for the second and so on... framer.py has finished it's job at this point and passes it onto convert.py

Second file (convert.py)

convert.py is rather simple as well convert.py has a cool algorithm that turns this output069420 into -> new69420 after doing that, convert.py shrinks the image into a much smaller image that is the size of the terminal.

99% of all weird glitches happen here

Final file (main.py)

main.py is hands-down the most complicated file by a mile Before we can go any further explaining how the code works, we need to understand a crucial concept which doubles load time speed. This picture shows what the old Version 1.1 used to do.

Example image

As you can see, the poor worker here cannot process all of these frames! Our poor worker is being bullied by the code! But! There is a way to fix this We can spread the load of the files into smaller bits

Example image

The worker went from needing to process 3000 frames to only 750! Not only does this run much faster, The worker also does not need to be sad anymore...


With that out of the way, we can continue looking at the code.

Clone this wiki locally