FastLED 3.9.3
Loading...
Searching...
No Matches
print_vid.py
1# imports for file manip
2import os
3from pathlib import Path
4
5HERE = Path(__file__).resolve().parent
6VIDEO_DAT = HERE / "video.dat"
7
8# open video file
9with open(VIDEO_DAT, "rb") as f:
10 # print out the first 1000 bytes of the file as a tuple of RGB values
11 size = os.path.getsize(VIDEO_DAT)
12 # size is 1000 or min of 1000 and file size
13 size = min(size, 5000)
14 for i in range(size):
15 r = f.read(1)
16 g = f.read(1)
17 b = f.read(1)
18 print(f"({r[0]}, {g[0]}, {b[0]})")