Thanks a lot for the useful package! Sorry if my question betrays a basic misunderstanding:
I have an avi file that I am reading and pims works great accessing individual frames, initially:
pims_movie = pims.Video('filename.avi')
for ind in range(10,12):
movie_frame = pims_movie[ind]
print("\n", ind)
print(movie_frame[:5, :5, 0])
It prints out reasonable values:
10
[[ 85 87 89 90 93]
[ 87 89 90 92 96]
[ 88 89 91 93 97]
[ 89 92 93 94 97]
[ 92 94 96 98 102]]
11
[[ 86 88 90 90 91]
[ 90 89 90 93 95]
[ 90 90 91 95 96]
[ 91 93 95 96 98]
[ 94 96 97 99 102]]
But if I run the for loop again (without reloading the movie), I get arrays of zeros back:
10
[[0 0 0 0 0]
[0 0 0 0 0]
[0 0 0 0 0]
[0 0 0 0 0]
[0 0 0 0 0]]
11
[[0 0 0 0 0]
[0 0 0 0 0]
[0 0 0 0 0]
[0 0 0 0 0]
[0 0 0 0 0]]
Is this expected behavior? Am I supposed to be closing out the video and reloading it, or using a context manager, or something?
Thanks a lot for the useful package! Sorry if my question betrays a basic misunderstanding:
I have an
avifile that I am reading and pims works great accessing individual frames, initially:It prints out reasonable values:
But if I run the for loop again (without reloading the movie), I get arrays of zeros back:
Is this expected behavior? Am I supposed to be closing out the video and reloading it, or using a context manager, or something?