psychopy.org | Reference | Downloads | Github

'FFMPEG not downloaded' makes Python crash

TL; DR imageio trying to download ffmpeg with no internet connection makes the application crash.

OS: Win10
PsychoPy version : 1.90.3
Standard Standalone? yes
What are you trying to achieve?: Start the application.

What did you try to make it work?: Launch it with no internet connection.

What specifically went wrong when you tried that?:
Python complains ‘ffmpef not downloaded, download now’ and downloads ffmpeg EVERYTIME PsychoPy2 is launched. With internet connection, the application hangs until finishing downloading; with no internet connection, it crashes.
The problem is similar to moviepy#493. Since the version in PsychoPy2 Standalone is 0.2.3.2, which is older than the current stable version of moviepy, I’m not sure if the problem was fixed in PsychoPy3.
A quick fix is to call imageio.plugins.ffmpeg.download() directly in the shell with internet connection:

import imageio
imageio.plugins.ffmpeg.download()

After doing this, the application stop downloading ffmpeg endlessly.
It may be a good idea to fix this problem for the users.

Hope that helps!
Yuhan

I’ve just come across this myself, running PsychoPy3 3.03 on Windows 10 x64.

Amazingly, all you need to do is drag the window size around and it crashes the application.

Just checked version 3.0.5, and it does not appear to have this problem. It creates the C:<user>\AppData\Roaming\psychopy3" folder structure, creates a “monitor” folder and warns you in the output console that a monitor specification does not exist so creates a temporary one for you but it does not attempt download of ffmpeg.

Additionally the following code does not work in this release:

import imageio
imageio.plugins.ffmpeg.download()

It is deprecated and the following should be used instead:

pip install imageio-ffmpeg

I’m not actually sure why the ffmpeg download crashed some machines (but most were fine) but yes, in the latest release the download step is gone. I won’t go into the details of why the download was previously necessary (there used to be a permissions complication) but imageio has now solved the issue by packaging its binaries into this additional imageio-ffmpeg package. I’m hoping that will be the end of the issue.

@MRCCBU makes a good point that we should also remove the code about ffmpeg.download() since it’s no longer needed (I had left that in, but at least it just gives a deprecation warning)