Skip to content

Instantly share code, notes, and snippets.

View Twilight0's full-sized avatar
🏠
Working from home

Paradigm Shifter Twilight0

🏠
Working from home
View GitHub Profile
@Twilight0
Twilight0 / encode.py
Created October 26, 2020 20:14 — forked from gasman/encode.py
Encoding a file as a Youtube video - https://www.youtube.com/watch?v=hyqLv2_zBdA
# Encode inputfile.tar.gz as a series of video frames
# Frames are written to frames/frameNNNN.png
from PIL import Image
with open('inputfile.tar.gz', 'rb') as f:
data = f.read()
WIDTH = 120
HEIGHT = 90
CHUNK_SIZE = int((WIDTH * HEIGHT) / 8)