numpyimage 3.5.0__tar.gz → 3.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {numpyimage-3.5.0/numpyimage.egg-info → numpyimage-3.5.1}/PKG-INFO +1 -1
- {numpyimage-3.5.0 → numpyimage-3.5.1}/npimage/vidio.py +6 -3
- {numpyimage-3.5.0 → numpyimage-3.5.1/numpyimage.egg-info}/PKG-INFO +1 -1
- {numpyimage-3.5.0 → numpyimage-3.5.1}/pyproject.toml +1 -1
- {numpyimage-3.5.0 → numpyimage-3.5.1}/LICENSE +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/README.md +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/npimage/__init__.py +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/npimage/align.py +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/npimage/graphics.py +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/npimage/imageio.py +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/npimage/nrrd_utils.py +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/npimage/operations.py +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/npimage/utils.py +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/numpyimage.egg-info/SOURCES.txt +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/numpyimage.egg-info/dependency_links.txt +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/numpyimage.egg-info/requires.txt +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/numpyimage.egg-info/top_level.txt +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/setup.cfg +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/tests/test_heic.py +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/tests/test_pbm.py +0 -0
- {numpyimage-3.5.0 → numpyimage-3.5.1}/tests/test_video_writers.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
Functions for reading and writing
|
|
3
|
+
Functions for reading and writing video files.
|
|
4
4
|
|
|
5
5
|
Function list:
|
|
6
6
|
- load_video(filename) -> np.ndarray
|
|
7
7
|
- lazy_load_video(filename) -> Iterator[np.ndarray]
|
|
8
|
-
- save_video(data, filename) ->
|
|
9
|
-
numpy array of pixel values as a video file.
|
|
8
|
+
- save_video(data, filename) -> None
|
|
9
|
+
Saves a numpy array of pixel values as a video file.
|
|
10
10
|
Arguments for setting framerate, video bitrate, etc are provided.
|
|
11
11
|
|
|
12
12
|
Class list:
|
|
@@ -137,10 +137,13 @@ def lazy_load_video(filename) -> Iterator[np.ndarray]:
|
|
|
137
137
|
Video frame as a numpy array, shape (height, width, colors).
|
|
138
138
|
"""
|
|
139
139
|
av = _import_av()
|
|
140
|
+
rotation = _get_rotation_from_metadata(filename)
|
|
140
141
|
with av.open(Path(filename).expanduser()) as container:
|
|
141
142
|
stream = container.streams.video[0]
|
|
142
143
|
for frame in container.decode(stream):
|
|
143
144
|
img = frame.to_ndarray(format='rgb24')
|
|
145
|
+
if rotation not in [None, '0', 0]:
|
|
146
|
+
img = np.rot90(img, k=-int(rotation) // 90)
|
|
144
147
|
yield img
|
|
145
148
|
|
|
146
149
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|