psychopy.org | Reference | Downloads | Github

Can't play movie in Win32

OS (e.g. Win10): Win 7
PsychoPy version (e.g. 1.84.x): 3.2.4 with python 2

What are you trying to achieve?:
I built a program by using IOS system + psychopy 3.2.1, and everything runs well on my own iMAC. But when I tried to run this program on the scanner PC( win7 + psychopy 3.2.4+python2), movies can’t play at all.

the error massage I got is: Need ffmpeg exe

but we checked the folder, the ffmpeg exe already existed, what should I do to solve this problem?

Thank you so much!

I wonder whether ffmpeg is really available in the expected location. Thus, I suggest that you run the following script once in order to ensure that ffmpeg is available:

import imageio
imageio.plugins.ffmpeg.download()

This will download ffmpeg, thus make sure that you have internet access.

@frank.papenmeier Thank you for your reply!

our collaborator @lazar checked the file, and he found the ffmpeg is installed, the real problem is this:

https://discourse.psychopy.org/t/popen-subprocess-still-broken/9815

He suspects there is some problem with the installation itself. He tried with psychopy2, and it is exactly the same problem. So the problem is with the psychopy installer not setting things up correctly.

Could you please give us some suggestions?

Many thanks!

Hi Vicky,

the problem described in the referenced post seems different from what you posted, at least a different error message is reported. While reading the other post, I wondered: Why not just use PsychoPy 1.85.6? This is the latest stable PsychoPy 2 release and it also has MovieStim3 support?

All the best,

Frank.

Hi Frank @frank.papenmeier,

Thanks for your reply. The task has already been built by using Psychopy3-python3, while this task couldn’t transfer to the PC system successfully. I tried PsychoPy2 as well, but our task couldn’t work at all.

As the post I attached below, the ffmpeg download does not work and is no longer needed because ffmpeg is included as a part of the installation:

Plus, we don’t have an option to have an internet connection.

Do you have any suggestions about that? Thanks a lot!

Best,
Vicky

Hi Vicky,

given your description, I am still not sure whether I fully understand what there is happening on your machine and what error it is that you are facing.

If you share your experiment and again name the PsychoPy version that you are using on Windows, I could cross-check whether the issue is occuring on my maschine too.

All the best,

Frank.

@frank.papenmeier Hi Frank,

Thank you so much for your kindly help!

A brief version of our task has been attached(since the size of original one is too large). we use video with MP4 format.
Video_Cues_test_model.psyexp (75.6 KB)

Our PC in scanner room is Window7, win32, without internet connection. The version of Psychopy is 3.2.4 with python 2.

I have tried to replace the videos to the pics, and our task with pics cues run well. so the main problem is the Psychopy can’t play video on that machine.

Many thanks!

Best,
Vicky

Hi Vicky,

I could replicate the issue. You can solve it by manually adding ffmpeg to your PC as follows:

1.) Manually download https://github.com/imageio/imageio-binaries/raw/master/ffmpeg/ffmpeg-win32-v3.2.4.exe on a machine with internet access.

2.) Copy it to your experimental PC into the following folder:

C:/Users/[Labor]/AppData/Local/imageio/ffmpeg/

Replace “[Labor]” with the respective user name that you are using to run PsychoPy on your PC.

You might need to create the /imageio/ffmpeg/ folders first.

Start PsychoPy and your video should work.

All the best,

Frank.

Dear Frank

ffmpeg is installed by default psychopy installer.
it runs by itself in a terminal or by just double-clicking on it.
So, there does not appear to be any need to install ffmpeg separately.

python cannot execute it via popen() in subprocess.py. tried it on the latest psychopy2 and psychopy3, same result same error.

Tried it on completely different systems, same result…

looks like a problem with the installer or the library…

Lazar

Dear Lazar and Vicky,

why argue and not just follow my workaround that I posted you yesterday?

As I wrote: I could replicate the issue and the above workaround fixes it. So, just try it yourself please!

Edit: An please make sure to copy it to the exact folder that I wrote in my last post. Otherwise, it will have no effect.

All the best,

Frank.

Dear Frank

I am not sure who is arguing.

I think a specific question was posed asking for help.

The difficulty with the work-around you suggest is that the system has multiple users and then multiple copies of the ffmpeg would have to be installed.

Further, ffmpeg runs when executed from the command line.
The IMAGEIO_FFMPEG_EXE environmental variable is set correctly to point to the ffmpeg executable (by the way, the installer did not set this variable, it had to be set manually) Without this environmental variable,
psychopy spits out a long list of irrelevant messages…

I then have to conclude that there is something wrong with the installation. It is a reproducible problem as we have several installations affected by this. You also seem to confirm the problem as well.

It would be good if someone could take a look at this issue and maybe suggest a more universal solution…

Lazar

Dear Lazar,

did you ever try my solution? Certainly, this is not universal but if it gets your experiment running, then it should be good enough as a beginning.

All the best,

Frank.

Dear Frank

Certainly, a goal of many individual researchers is to get “their” experiment running. However, the requirements are different in this particular case.

there is a (confirmed-by-me) bug in subprocess.py library which prevents normal operation.
the bug is present in psychopy2 and psychopy3 distributions.

it is possible to work-around the bug by setting up a path to ffmpeg so it does not contain any “funny” characters and using IMAGEIO_FFMPEG_EXE to point to ffmpeg.

I wish it were not another “self-help” forum…

Lazar