Added bus_info for v4l2. Added optional forcing OpenCV or V4L2. Added non-linear transform. Added transparent overlay.

This commit is contained in:
Josh Miklos
2020-06-22 16:09:34 -07:00
parent 823bb3e173
commit b8453da881
24 changed files with 334 additions and 719 deletions

View File

@ -9,7 +9,7 @@ def black_and_white(arr):
import time
t0 = t1 = time.time()
for up in display(0, size=(1, 1), callbacks=black_and_white):
for up in display("usb-0000:00:14.0-7"):
if up:
t1 = time.time()
print(1.0 / (t1 - t0))

View File

@ -9,25 +9,25 @@ test_video_3 = str(Path.joinpath(Path(__file__).parent, "fractal test 3.mp4"))
urls = {
"test_video": "https://www.youtube.com/watch?v=LpWhaBVIrZw",
"test_video_2": "https://www.youtube.com/watch?v=GASynpGr-c8",
"test_video_3": "https://www.youtube.com/watch?v=u_P83LcI8Oc"
"test_video_3": "https://www.youtube.com/watch?v=u_P83LcI8Oc",
}
def populate_videos(fps=60, res="720p", ext="mp4"):
from pytube import YouTube # Note: pip install pytube3, not pytube
from pathlib import Path
for n, v in globals().items():
if 'test_video' in n:
if "test_video" in n:
print(f"Checking if '{n}' is downloaded.")
if Path(v).exists():
print("Video already downloaded.")
else:
the_path = Path(v)
print("Downloading...")
YouTube(urls[n]) \
.streams \
.filter(fps=fps, res=res, file_extension=ext)[0] \
.download(output_path=the_path.parent, filename=the_path.stem)
YouTube(urls[n]).streams.filter(fps=fps, res=res, file_extension=ext)[
0
].download(output_path=the_path.parent, filename=the_path.stem)
if __name__ == "__main__":