Выполнение следующего:
import imageio
class vidrdf:
def __init__(self, vidfile):
self.vid = imageio.get_reader(vidfile, 'ffmpeg')
vidfile = 'movie.mov'
rdfobj = vidrdf(vidfile)
Я получаю:
Fatal Python error: could not acquire lock for <_io.BufferedReader name=8> at interpreter shutdown, possibly due to daemon threads
Thread 0x00007fd2dc2a8700 (most recent call first):
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio_ffmpeg/_parsing.py", line 61 in run
File "miniconda3/envs/flower/lib/python3.7/threading.py", line 926 in _bootstrap_inner
File “/path/miniconda3/envs/flower/lib/python3.7/threading.py", line 890 in _bootstrap
Current thread 0x00007fd2f0bb9700 (most recent call first):
File “/path/miniconda3/envs/flower/lib/python3.7/subprocess.py", line 1704 in _communicate
File “/path/miniconda3/envs/flower/lib/python3.7/subprocess.py", line 939 in communicate
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio_ffmpeg/_io.py", line 193 in read_frames
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio/plugins/ffmpeg.py", line 342 in _close
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio/core/format.py", line 252 in close
File “/path/miniconda3/envs/flower/lib/python3.7/site-packages/imageio/core/format.py", line 241 in __del__
Aborted (core dumped)
Не получается, если я пытаюсь:
import imageio
class vidrdf:
def __init__(self, vidfile):
self.vid = imageio.get_reader(vidfile, 'ffmpeg')
vidfile = 'movie.mov'
vidrdf(vidfile)
или
import imageio
class vidrdf:
def __init__(self, vidfile):
vid = imageio.get_reader(vidfile, 'ffmpeg')
vidfile = 'movie.mov'
rdfobj = vidrdf(vidfile)
Так что это явно проблема с копированием объекта. Я искал потоки демона, но так как я использую imageio напрямую, я не могу понять, почему и как это решить. Буду признателен за любые рекомендации.