PsychoPy plays movie files, but no sound

1,138 views
Skip to first unread message

Leyla Roksan Caglar

unread,
Nov 30, 2014, 6:07:51 PM11/30/14
to psychop...@googlegroups.com


Hello Everyone, 

I'm having trouble with PsychoPy playing the sound of my movie files. I have built an experiment in which PsychoPy extracts 12 different movie files from the excel sheet. All of the movies play when I run the experiment, but there is no sound. The movies do look a bit jerky, but I think that could be fixed my changing the video file format or the screen size.

I don't get an error from PsychoPy, so it clearly things that everything must be running smoothly. The only error I get are the following, which I have read can safely be ignored:
1.1881 WARNING Movie2 stim could not be imported and won't be available
1.2085 WARNING TextBox stim could not be imported and won't be available.
1.2085 WARNING TextBox Font Manager Found No Fonts.

Here are a couple of things I have already tried:
1) The movies do play sound when I run them in QuickTime or VLC player. So there is nothing wrong with the sound of the movie files.
2) I have tried to play simple audio files and those won't play the sound either. 
3) I have Piglet and Pyo installed and have uninstalled and reinstalled both. No success. 
4) I have looked through other previous posts on here that address movie and sound issues. None of them seemed to be relevant for my case. 

I can just not figure out why I'm having these problems, so any help will be very much appreciated!

Best, 
Leyla

Jonathan Peirce

unread,
Dec 1, 2014, 4:35:47 AM12/1/14
to psychop...@googlegroups.com
I expect the sound within your movie is in something like AAC format (a proprietary format that we would have to pay royalties to use). I think you need to save your movie with something like "linear PCM" or "uncompressed" audio
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/7f800d00-eb9c-43a0-80cf-a1e057f5731d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sol Simpson

unread,
Dec 1, 2014, 10:39:42 AM12/1/14
to psychop...@googlegroups.com
You could try using the visual.MovieStim2 type instead of the standard MovieStim. 

See the /demos/stimuli/MovieStim2.py demo.

If Jon is correct and the issues is the audio encoding, using MovieStim2 will play AAC audio, since your VLC install is what is handling the audio playback. It does on Windows and OS X at least.

Leyla Roksan Caglar

unread,
Dec 1, 2014, 10:03:21 PM12/1/14
to psychop...@googlegroups.com
Dear Jon and Sol, 

Thank you for your quick replies! I converted the videos to a use an audio file that isn't compressed (.mpg) and the sound finally works! 

However, now I seem to have encountered yet another problem. I have 12 videos that are being looped and even though PsychoPy was able to run through the routine and get to the next phase of the experiment before, the screen now freezes while going through the videos and I have to restart my laptop to get out of it. I have already checked whether there is a specific video that is causing this, but PsychoPy always gets stuck at a different video. Initially I thought that the size of the videos might have been too big, so I reconverted everything into the smallest possible size and each video is now about 800KB big.
Any idea what this might be related to?

Thank you for all your help! 
Best, 
Leyla

Austin Theodore

unread,
May 6, 2015, 3:28:08 PM5/6/15
to psychop...@googlegroups.com
Hey Everyone,

I am having the same problem as you had. My movie stimuli start running, and then the screen freezes, and I have to force shut down my computer. I have tried running this on two computers (both Mac), but I get the same problem. I have tried using 'loop=True' at the end of each of the movie stimuli, but that also did not fix the issue:

#initialize movie objects
stimdisp=visual.MovieStim(win=win, filename=path, ori=0, pos=[0, 0],
    size=[300, 300], loop=True)
jitter=visual.MovieStim(win=win, filename='99_avi/image01_99_percent_noise.avi',
    ori=0, pos=[0, 0], size=[300, 300], loop=True)
jitter_sync=visual.MovieStim(win=win, filename='99_avi/image01_99_percent_noise.avi',
    ori=0, pos=[0, 0], size=[300, 300], loop=True)
cue_sync_fix=visual.MovieStim(win=win, filename='99_avi/image01_99_percent_noise.avi',
    ori=0, pos=[0, 0], size=[300,300], loop=True)

Any ideas on how I can fix this issue?

Thank you!
Austin 

Frank P.

unread,
May 6, 2015, 4:48:49 PM5/6/15
to psychop...@googlegroups.com
Dear Austin,

I am also using movies with PsychoPy a lot and have made the best experiences with PsychoPy 1.80.06, which I am using in most movie related experiments at the moment. However, I am using it on Windows machines, so my experiences might not be valid for your Mac. The only thing you need to be aware of with that version is that movies are flipped horizontally, so you just need to add a flipHoriz=True to the MovieStim call (at least on Windows).

Beginning with PsychoPy 1.81.x I am experiencing heavy problems, like the freezing you mention when using the avbin backend, or PsychoPy hanging at the end of movies for about 1 sec when using MovieStim2 with movies including an audio stream. Furthermore, the support for looping a movie has been removed in PsychoPy 1.81.x (I hope that I remember correctly that pyglet 1.2 started to be bundled with PsychoPy beginning 1.81.x)

So I would try to use a fresh installation of PsychoPy 1.80.06 and I would expect your problems to vanish.

Frank.

Austin Theodore

unread,
May 7, 2015, 11:12:49 AM5/7/15
to psychop...@googlegroups.com
Frank,

Thank you for your quick response! It is working now!

-Austin
Reply all
Reply to author
Forward
0 new messages