-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbadapple.sh
More file actions
executable file
·32 lines (25 loc) · 885 Bytes
/
badapple.sh
File metadata and controls
executable file
·32 lines (25 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
W=80
H=64
VID_SIZE="${W}x${H}"
FPS=20
# Download video
echo "Downloading video..."
youtube-dl https://www.youtube.com/watch?v=FtutLA63Cp8 -o bad
echo "Converting video..."
# Convert video to two tone black and white
ffmpeg -hide_banner -loglevel error -y -i bad.mkv -vf "fps=$FPS,scale=$VID_SIZE,format=monow" -f rawvideo bad_mono
du -bsh bad_mono | cut -f -1
# Script to encode the video
echo "Encoding video..."
python videnc.py $W $H
du -bsh bad_mono.enc | cut -f -1
# Compile decoder
echo "Compiling decoder..."
cc -DW=$W -DH=$H -DNDEBUG -O2 decoder/main.c -o decoder/decoder
# Test decoder against original data
echo "Testing decoder..."
decoder/decoder | cmp - bad_mono
# Display decoded video
echo "Displaying decoded video..."
#decoder/decoder | ffplay -hide_banner -loglevel error -f rawvideo -pixel_format monow -video_size $VID_SIZE -framerate $FPS pipe: