FastLED
3.9.3
Loading...
Searching...
No Matches
print_vid.py
1
# imports for file manip
2
import
os
3
from
pathlib
import
Path
4
5
HERE = Path(__file__).resolve().parent
6
VIDEO_DAT = HERE /
"video.dat"
7
8
# open video file
9
with
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]})"
)
examples
SdCard
data
print_vid.py
Generated on Thu Nov 14 2024 00:00:34 for FastLED by
1.11.0