Skip to content

Commit

Permalink
Merge pull request #44 from SimLeek/jit_vids
Browse files Browse the repository at this point in the history
Jit vids
  • Loading branch information
SimLeek authored May 20, 2020
2 parents a2496fc + 699c094 commit 823bb3e
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ venv.bak/
.idea/
.pytest_cache/
.coveragerc
*.mp4
2 changes: 1 addition & 1 deletion displayarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
display is a function that displays these in their own windows.
"""

__version__ = "1.1.0"
__version__ = "1.1.1"

from .window.subscriber_windows import display, breakpoint_display, read_updates
from .frame.frame_publishing import publish_updates_zero_mq, publish_updates_ros
Expand Down
34 changes: 31 additions & 3 deletions examples/videos/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
# Fractal test is from: https://www.youtube.com/watch?v=WgXQ59rg0GM

import os
from pathlib import Path

test_video = os.path.join(os.path.dirname(__file__), "fractal test.mp4")
test_video_2 = os.path.join(os.path.dirname(__file__), "fractal test 2.mp4")
test_video = str(Path.joinpath(Path(__file__).parent, "fractal test.mp4"))
test_video_2 = str(Path.joinpath(Path(__file__).parent, "fractal test 2.mp4"))
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"
}


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:
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)


if __name__ == "__main__":
populate_videos()
Binary file removed examples/videos/fractal test 2.mp4
Binary file not shown.
Binary file removed examples/videos/fractal test.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = 'displayarray'
version = '1.1.0'
version = '1.1.1'
description = 'Tool for displaying numpy arrays.'
authors = ['SimLeek <[email protected]>']
license = 'MIT'
Expand Down

0 comments on commit 823bb3e

Please sign in to comment.