OSError: [Errno 22] Invalid argument
Hello,
I have an experiment that keeps crashing because of an "unexpected error". It gives "OSError: [Errno 22] Invalid argument" as the reason.
I apologize, I'm not sure what information is useful. So here is what I can think of:
- The experiment is set up to display video stimuli using media player mpy and images.
- The .mp4 video files and .jpg image files are in a pool folder.
- The error seems to come up completely randomly. Sometimes the experiment plays all the way through without problem.
- The backend is Expyriment
The last few lines from the debug window:
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/site-packages/moviepy/video/io/ffmpeg_reader.py", line 237, in ffmpeg_parse_infos proc = sp.Popen(cmd, **popen_params) File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/subprocess.py", line 1319, in _execute_child data = _eintr_retry_call(os.read, errpipe_read, 1048576) File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call return func(*args) OSError: [Errno 22] Invalid argument
Thanks in advance.
Comments
Hi Grace,
That's an usual error. It seems like the movieplayer fails to launch some external process, possibly ffmpeg which handles video playback. @Daniel have you seen this before?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
No I have never seen this before. It indeed seems if moviepy has some trouble opening the video file. Maybe it is corrupt? Grace, have you tried working with different videos, or to reencode the video that causes this with handbrake or vlc?
Given that moviepy is causing the trouble here, I think there currently is little we can do about this, except for maybe upgrading moviepy in the next release.