A script that converts videos into a format playable by a Python turtle.
Project description
bad-apple-turtle
A program that plays Bad Apple!! on a Python Turtle
This had just been nearly completely re-written to be better in almost every way. Pypotrace is no longer used in this version.
Python-vlc is used when playing back a video along side the turtle, but it technically optional. Make sure VLC Media Player is installed before python-vlc if you want to use it.
You can install this with pip install bad-apple-turtle
. If you want VLC support, run pip install bad-apple-turtle[vlc]
, and if you also want to be able to download videos for the script, you can do pip install bad-apple-turtle[vlc,yt-dlp]
. From there, you can run the command with bad-apple-turtle
. If you want a quick demo and have yt-dlp installed, you can just do bad-apple-turtle --demo
.
You have several options when running the command. You can directly play a video in a turtle by specifying it in the command with -v
/--video
. If you don't want the original to play next to it, you can use the --no-vlc
argument. If you want to export the resulting vectorized video to a file, you can also specify an output file with -o
/--output
. You can then play the vectorized video again later using -i
/--input
. If you specify a vectorized video and a normal video at the same time, the turtle will play the vectorized one while VLC will play the normal video. If you just want to output a file without playing the video at the same time, you can use the --no-play
argument. Once the vectorized video is exported, the original is no longer required for turtle playback, though there is no audio included.
If the turtle is not synchronized with the video, you can try increasing the --vlc_delay
option, though it's already fairly high. If you are getting lots of dropped frames, you can use the simplification options, which are --max-points
and --min-area
. --max-points
is the maximum number of points in a frame times the square root of the number of curves before the vectors are simplified. --min-area
is the minimum area a curve needs for it to be rendered. Alternatively, you can try increasing --tolerance
, which is how much time offset is allowed before frames are dropped, or get a faster computer.
Increasing the --threshold
will increase how much of the greys are converted to black, and decreasing it will increase the amount of white. You can also use -ss
and -to
to specify starting and ending frames to playback (or export to a file)
There are other options and I recommend you use --help
for more information.
I used this video for testing: https://www.youtube.com/watch?v=UkgK8eUdpAo
Theoretically, you could probably put any video through this, but I do not know how well it would work and it would be converted to binary black and white.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bad-apple-turtle-2.1.1b0.tar.gz
.
File metadata
- Download URL: bad-apple-turtle-2.1.1b0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 510aa7355d785d114909396a9ee3db5c7ef654eb074396fb03b0c358a135aea7 |
|
MD5 | 4276c6c89f926ffe802c75c3b408490d |
|
BLAKE2b-256 | e2359d4ad6272227913554a29f96bbacb7c9a85fae63537bf2ec1a196d790d4d |
File details
Details for the file bad_apple_turtle-2.1.1b0-py3-none-any.whl
.
File metadata
- Download URL: bad_apple_turtle-2.1.1b0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 194702d37655f4a2a165912b866322e91561610510d4af7ffa00b0af3bc6f0ce |
|
MD5 | 7ad9990c204d05fc833dd209853f5a96 |
|
BLAKE2b-256 | 314ece40fbe9aec93910929954bd22d8656f906a044f28bc6e798924a733a418 |