numpyimage 2.6.2__tar.gz → 2.6.4__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-2.6.2/numpyimage.egg-info → numpyimage-2.6.4}/PKG-INFO +1 -1
- {numpyimage-2.6.2 → numpyimage-2.6.4}/npimage/vidio.py +8 -3
- {numpyimage-2.6.2 → numpyimage-2.6.4/numpyimage.egg-info}/PKG-INFO +1 -1
- {numpyimage-2.6.2 → numpyimage-2.6.4}/pyproject.toml +1 -1
- {numpyimage-2.6.2 → numpyimage-2.6.4}/LICENSE +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/README.md +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/npimage/__init__.py +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/npimage/align.py +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/npimage/graphics.py +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/npimage/imageio.py +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/npimage/nrrd_utils.py +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/npimage/operations.py +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/npimage/utils.py +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/numpyimage.egg-info/SOURCES.txt +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/numpyimage.egg-info/dependency_links.txt +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/numpyimage.egg-info/requires.txt +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/numpyimage.egg-info/top_level.txt +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/setup.cfg +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/tests/test_heic.py +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/tests/test_pbm.py +0 -0
- {numpyimage-2.6.2 → numpyimage-2.6.4}/tests/test_video.py +0 -0
|
@@ -96,12 +96,17 @@ def load_video(filename,
|
|
|
96
96
|
data = np.empty((num_frames, *first_img.shape), dtype=first_img.dtype)
|
|
97
97
|
# Then fill it up frame by frame
|
|
98
98
|
data[0] = first_img
|
|
99
|
+
container.seek(0, stream=stream)
|
|
99
100
|
for i, frame in tqdm(enumerate(frame_iter), total=num_frames,
|
|
100
101
|
desc='Loading video', disable=not progress_bar):
|
|
101
|
-
if i == 0:
|
|
102
|
-
continue
|
|
103
102
|
img = frame.to_ndarray(format='rgb24')
|
|
103
|
+
if i == 0 and not np.array_equal(img, first_img):
|
|
104
|
+
raise RuntimeError('PyAV seek failed. Please report how this happened'
|
|
105
|
+
' at github.com/jasper-tms/npimage/issues')
|
|
104
106
|
data[i] = img
|
|
107
|
+
if (data[-1] == 0).all():
|
|
108
|
+
print('WARNING: Last frame of video is all zeros, this may'
|
|
109
|
+
' indicate an error in video loading unless you expected this.')
|
|
105
110
|
if return_framerate:
|
|
106
111
|
return data, float(stream.average_rate)
|
|
107
112
|
else:
|
|
@@ -399,7 +404,7 @@ class VideoWriter:
|
|
|
399
404
|
'Set overwrite=True to overwrite.')
|
|
400
405
|
self.filename = filename
|
|
401
406
|
self.framerate = str(framerate) # str instead of float to avoid precision issues
|
|
402
|
-
while Fraction(self.framerate).denominator >= 2**
|
|
407
|
+
while Fraction(self.framerate).denominator >= 2**31 or Fraction(self.framerate).numerator >= 2**31:
|
|
403
408
|
# If framerate has too many decimals to be expressed as a
|
|
404
409
|
# ratio of 32-bit ints, which is required by ffmpeg, crop
|
|
405
410
|
# off one decimal point of precision until it is expressable
|
|
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
|