You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
run get_reader sequentially for thousands time, get IOError: Could not load meta information #273
Ran into this as well, dug a little deeper. It looks like the ffmpeg plugin is not properly cleaning up the processes it spawns. Issuing a hard imageio._proc.kill() after you are done with your logic will kill the process spawned by Popen effectively solving your problem. I've tried to figure out how to patch the ffmpeg plugin, but didn't see a quick fix, issuing a self.proc.kill() in the terminate did not work for some reason.
I messed with this yesterday in the interactive shell, there is a second problem (potentially): somehow the Popen spawned ffmpeg twice - I could not yet reliably reproduce, but it seems to happen every once in a while. Could it be that it does clean up one process but not the second one? Doesn't explain why _proc.kill() works though 😕
The problem does not seem to occur on Windows. The fact that manually issuing _proc.kill() works is interesting. Have you verified (e.g. with a print call) that the _terminate() method is indeed being called?
The basis for the new ffmpeg plugin is https://github.com/imageio/imageio-ffmpeg, which I just made a first release for. That small library can also be used by itself (allthough its rather low-level). It should also be much more robust against daemon processes, by how its implemented, but also because it has extensive tests for this, which I ran on Win/OSX/Linux.
It would be really helpful if you could try it on your data and confirm that it does not suffer from the same problem.
just recently I got this problem but at first, it works but I don't know what made it like this, I did updates the python and imageio if that's relevant. I also uninstalled and reinstalled all. I was trying to use imageio in python to convert an mp4 to gif. the error starts when it trying to read the file
Video path: C:\Python3\Projects\vid2gif\alita.mp4
C:\Python3\Projects\vid2gif\output\alita.gif
Reading C:\Python3\Projects\vid2gif\alita.mp4
Traceback (most recent call last):
File "C:\Python3\Projects\vid2gif\converter.py", line 36, in <module>
gifMaker(clip, '.gif') #alita.gif
File "C:\Python3\Projects\vid2gif\converter.py", line 22, in gifMaker
reader = imageio.get_reader(inputPath) #imageio read the clip
File "C:\Python\Python37\lib\site-packages\imageio\core\functions.py", line 143, in get_reader
return format.get_reader(request)
File "C:\Python\Python37\lib\site-packages\imageio\core\format.py", line 164, in get_reader
return self.Reader(self, request)
File "C:\Python\Python37\lib\site-packages\imageio\core\format.py", line 214, in __init__
self._open(**self.request.kwargs.copy())
File "C:\Python\Python37\lib\site-packages\imageio\plugins\ffmpeg.py", line 322, in _open
self._initialize()
File "C:\Python\Python37\lib\site-packages\imageio\plugins\ffmpeg.py", line 465, in _initialize
self._meta.update(self._read_gen.__next__())
File "C:\Python\Python37\lib\site-packages\imageio_ffmpeg\_io.py", line 150, in read_frames
raise IOError(fmt.format(err2))
OSError: Could not load meta information
=== stderr ===
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20181017
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
C:\Python3\Projects\vid2gif\alita.mp4: Permission denied
lol nevermind fixed it. recently I installed an antivirus called Iobit Malware Fighter it blocked or will try to ask your first to allow the process but even after you allowed it, it still blocked you. so I uninstalled it. anyway thanks for the quick reply :)
Activity
almarklein commentedon Sep 5, 2017
Bah, yet another issue with ffmpeg. I think we really need that pyav plugin (#115)...
Disable UCF11 test (#2615)
Disable UCF11 test (microsoft#2615)
Disable UCF11 test (microsoft#2615)
ranieuwe commentedon Feb 19, 2018
Ran into this as well, dug a little deeper. It looks like the ffmpeg plugin is not properly cleaning up the processes it spawns. Issuing a hard
imageio._proc.kill()after you are done with your logic will kill the process spawned by Popen effectively solving your problem. I've tried to figure out how to patch the ffmpeg plugin, but didn't see a quick fix, issuing a self.proc.kill() in the terminate did not work for some reason.almarklein commentedon Feb 19, 2018
A recurring issue :(
ranieuwe commentedon Feb 20, 2018
I messed with this yesterday in the interactive shell, there is a second problem (potentially): somehow the Popen spawned ffmpeg twice - I could not yet reliably reproduce, but it seems to happen every once in a while. Could it be that it does clean up one process but not the second one? Doesn't explain why _proc.kill() works though 😕
almarklein commentedon Mar 12, 2018
The problem does not seem to occur on Windows. The fact that manually issuing
_proc.kill()works is interesting. Have you verified (e.g. with a print call) that the_terminate()method is indeed being called?yelantf commentedon Aug 15, 2018
so, how to avoid this? I tried that (reader)._proc.kill() but it would easily cause
OSError: [Errno 3] No such process.almarklein commentedon Sep 3, 2018
@yelantingfeng put a try-except around that. Sight ... its ugly, but if it works ... until we get a better video plugin.
yelantf commentedon Sep 4, 2018
ok, then, thank you.
yelantf commentedon Feb 3, 2019
still not fixed?
almarklein commentedon Feb 3, 2019
Since I'm not being payed to work on this, there is no guarantees on fixing this in any set period of time.
That said, I happen to be working on a new ffmpeg plugin, which I expect to be much more robust.
almarklein commentedon Feb 4, 2019
The basis for the new ffmpeg plugin is https://github.com/imageio/imageio-ffmpeg, which I just made a first release for. That small library can also be used by itself (allthough its rather low-level). It should also be much more robust against daemon processes, by how its implemented, but also because it has extensive tests for this, which I ran on Win/OSX/Linux.
It would be really helpful if you could try it on your data and confirm that it does not suffer from the same problem.
almarklein commentedon Feb 5, 2019
I am going to assume that #425 (making use of the above mentioned library) will fix this. Feel free to reopen if the error persists after this change!
Eldrants commentedon Sep 16, 2019
just recently I got this problem but at first, it works but I don't know what made it like this, I did updates the python and imageio if that's relevant. I also uninstalled and reinstalled all. I was trying to use imageio in python to convert an mp4 to gif. the error starts when it trying to read the file
almarklein commentedon Sep 16, 2019
That looks like a permission problem. Perhaps the video was written with elevated permissions, causing it inaccessible by a normal process?
Eldrants commentedon Sep 16, 2019
I don't think so... before this, it worked fine. I've also tried other video.
Eldrants commentedon Sep 16, 2019
lol nevermind fixed it. recently I installed an antivirus called Iobit Malware Fighter it blocked or will try to ask your first to allow the process but even after you allowed it, it still blocked you. so I uninstalled it. anyway thanks for the quick reply :)