Can HD high frame-rate movies work in Psychopy?

771 views
Skip to first unread message

ShoinExp

unread,
Apr 24, 2014, 9:17:44 AM4/24/14
to psychop...@googlegroups.com
Hi all,
    I'm using Builder 1.80.02 on Mac OSX 10.8.
    I'm trying to play a HD movie file with 60fps in Builder and it freezes on the first frame.  No error message happens and the audio plays (though is choppy).  I've spent a couple of hours testing the movie under various combinations of audio and video codecs to try and find some version of the video that will play and it seems that it will play if the video is lower resolution or if the frame-rate is lower, but if I have high resolution and high frame rate, it freezes.  It doesn't seem to be a memory issue, because some of the lower-resolution files that DID play were larger files (bizarrely).  I also tried making the ISI very long and loading the movie during that, but that didn't help which again suggests it's not a memory issue.
    Does anyone know of a format I can convert my videos to that will allow them to be played with high-def and high frame-rate?
    Thanks!
    Mark

ShoinExp

unread,
Apr 24, 2014, 9:57:10 AM4/24/14
to psychop...@googlegroups.com
Hi all,
    Just to add more information to this, I've got hold of a computer running Ubuntu 14.04 and PsychoPy 1.79.01, and the same movie files are working properly there.  I also tested PsychoPy 1.75 on Mac OSX 10.6 and the movie files do NOT work there.  So Mac seems to be the common denominator.  I can use the Ubuntu computer for my research, so that's good news for me, but just for future reference does anyone have any ideas about why this is happening on Mac and what to do it about it?
    Thanks!
    Mark

ShoinExp

unread,
Apr 24, 2014, 1:32:20 PM4/24/14
to psychop...@googlegroups.com
Hi all,
     To add even more information to this issue - I have now tested several codecs on Windows 7 (PsychoPy 1.80.03), Mac OSX 10.9.3 (PsychoPy 1.80.01), Mac OS X 10.6.8 (PsychoPy 1.75), Mac OSX 10.8.4 (PsychoPy 1.80.01), Ubuntu 12.10 (PsychoPy 1.77.01), Ubuntu 14.04 (PsychoPy 1.79.01) - yes, there are a lot of different computers in my lab.
     None of the high res, high frame-rate movies works on any of these versions EXCEPT Ubuntu 14.04.  Even there, though, while the movie plays, it is dropping frames and sometimes stuttering.   The movies also play under Ubuntu 12.10 but they stutter a lot there.
     If anyone has any trick to getting these movies to play consistently, I'd love to hear it.
     Thanks,
     Mark

Jonathan Peirce

unread,
Apr 24, 2014, 3:25:36 PM4/24/14
to psychop...@googlegroups.com
Sol has been working on a replacement movie stim using opencv and it's looking like having better performance. The main stumbling block is me being able to package the opencv lib into standalone, but I think I'm close to getting that to work.

Jon
--
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/03f67122-6b3b-41ec-80f5-2bb697561a39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk/

Sol Simpson

unread,
Apr 24, 2014, 8:23:09 PM4/24/14
to psychop...@googlegroups.com
In can play HD movies using MovieSTim2 on Windows 7, but only 25 / 30 fps have been tested. Are you able to email me a link to a HD 60 fps video you are using (and having trouble playing) so I can try it on win7 using moviestim2?

Thanks,

Sol.

ShoinExp

unread,
Apr 25, 2014, 1:28:17 AM4/25/14
to psychop...@googlegroups.com
Hi,
    Thanks Jon and Sol for your help.  Sol, can you send me an e-mail at mark.a.j.scott AT gmail.com so that I can send you a link to some example video clips off the board?  Part of my ethics committee rules for experiments is not to post any videos from the experiments online, so I can't put a link up here (I'd just create a new one for you but I don't have the HD camera with me).
    Thanks,
    Mark

ShoinExp

unread,
Apr 25, 2014, 1:39:44 AM4/25/14
to psychop...@googlegroups.com
Hi Sol,
     I just rummaged around on my hard-drive and found a clip of a faculty member who was helping me set up the camera, so I can post that one without violating my ethics-board rules :-)
     Here's the dropbox link to that HD 60fps clip.
     https://dl.dropboxusercontent.com/u/9696463/Clip4.mov
     Thanks!
     Mark

Sol Simpson

unread,
Apr 25, 2014, 4:54:00 PM4/25/14
to psychop...@googlegroups.com
I ran the video you linked below at full 1920x1080 res using the MovieStim2.py demo and it seems to run fine on Win7, i7, nvidia 580GTX video. Here is the output when I print the frame index, frame flip time, and time since last flip from within a function set using win.callOnFlip. 

Frame 1 2.3246 0.0000
Frame 2 2.3574 0.0328
Frame 3 2.3710 0.0136
Frame 4 2.3877 0.0167
Frame 5 2.4044 0.0167
Frame 6 2.4210 0.0166
Frame 7 2.4377 0.0167
Frame 8 2.4543 0.0166
Frame 9 2.4919 0.0376
Frame 10 2.5043 0.0124
Frame 11 2.5210 0.0166
Frame 12 2.5376 0.0167
Frame 13 2.5543 0.0167
Frame 14 2.5710 0.0167
Frame 15 2.5876 0.0167
Frame 16 2.6043 0.0167
Frame 17 2.6210 0.0166
Frame 18 2.6377 0.0167
Frame 19 2.6543 0.0166
Frame 20 2.6710 0.0167
Frame 21 2.6877 0.0167
Frame 22 2.7043 0.0166
Frame 23 2.7210 0.0167
Frame 24 2.7377 0.0167
Frame 25 2.7543 0.0166
Frame 26 2.7709 0.0166
Frame 27 2.7877 0.0167
Frame 28 2.8043 0.0166
Frame 29 2.8209 0.0167
Frame 30 2.8376 0.0167
Frame 31 2.8543 0.0167
Frame 32 2.8710 0.0166
Frame 33 2.8877 0.0167
Frame 34 2.9043 0.0167
Frame 35 2.9210 0.0167
Frame 36 2.9376 0.0166
Frame 37 2.9543 0.0167
Frame 38 2.9710 0.0167
Frame 39 2.9877 0.0167
Frame 40 3.0043 0.0166
Frame 41 3.0210 0.0167
Frame 42 3.0376 0.0166
Frame 43 3.0543 0.0166
Frame 44 3.0710 0.0167
Frame 45 3.0876 0.0167
Frame 46 3.1043 0.0167
Frame 47 3.1210 0.0167
Frame 48 3.1377 0.0167
Frame 49 3.1550 0.0173
Frame 50 3.1710 0.0160
Frame 51 3.1877 0.0167
Frame 52 3.2043 0.0167
Frame 53 3.2210 0.0167
Frame 54 3.2376 0.0166
Frame 55 3.2543 0.0167
Frame 56 3.2710 0.0166
Frame 57 3.2876 0.0167
Frame 58 3.3044 0.0167
Frame 59 3.3209 0.0166
Frame 60 3.3377 0.0167
Frame 61 3.3543 0.0166
Frame 62 3.3710 0.0167
Frame 63 3.3876 0.0167
Frame 64 3.4044 0.0167
Frame 65 3.4210 0.0166
Frame 66 3.4376 0.0166
Frame 67 3.4543 0.0167
Frame 68 3.4710 0.0166
Frame 69 3.4876 0.0166
Frame 70 3.5043 0.0167
Frame 71 3.5210 0.0167
Frame 72 3.5376 0.0167
Frame 73 3.5544 0.0168
Frame 74 3.5710 0.0166
Frame 75 3.5877 0.0167
Frame 76 3.6043 0.0167
Frame 77 3.6209 0.0166
Frame 78 3.6377 0.0167
Frame 79 3.6543 0.0167
Frame 80 3.6710 0.0166
Frame 81 3.6876 0.0166
Frame 82 3.7043 0.0167
Frame 83 3.7210 0.0166
Frame 84 3.7376 0.0167
Frame 85 3.7544 0.0167
Frame 86 3.7709 0.0166
Frame 87 3.7876 0.0167
Frame 88 3.8043 0.0167
Frame 89 3.8209 0.0166
Frame 90 3.8376 0.0167
Frame 91 3.8544 0.0167
Frame 92 3.8709 0.0166
Frame 93 3.8876 0.0167
Frame 94 3.9043 0.0167
Frame 95 3.9210 0.0166
Frame 96 3.9376 0.0167
Frame 97 3.9544 0.0167
Frame 98 3.9709 0.0166
Frame 99 3.9876 0.0167
Frame 100 4.0043 0.0167
Frame 101 4.0210 0.0167
Frame 102 4.0376 0.0166
Frame 103 4.0543 0.0167
Frame 104 4.0709 0.0166
Frame 105 4.0876 0.0167
Frame 106 4.1043 0.0167
Frame 107 4.1210 0.0167
Frame 108 4.1376 0.0167
Frame 109 4.1544 0.0167
Frame 110 4.1710 0.0167
Frame 111 4.1876 0.0166
Frame 112 4.2043 0.0167
Frame 113 4.2210 0.0167
Frame 114 4.2376 0.0167
Frame 115 4.2543 0.0167
Frame 116 4.2710 0.0167
Frame 117 4.2876 0.0166
Frame 118 4.3043 0.0167
Frame 119 4.3210 0.0167
Frame 120 4.3376 0.0166
Frame 121 4.3543 0.0167
Frame 122 4.3709 0.0166
Frame 123 4.3876 0.0167
Frame 124 4.4043 0.0167
Frame 125 4.4209 0.0167
Frame 126 4.4376 0.0167
Frame 127 4.4543 0.0167
Frame 128 4.4709 0.0167
Frame 129 4.4877 0.0167
Frame 130 4.5043 0.0166
Frame 131 4.5209 0.0166
Frame 132 4.5376 0.0166
Frame 133 4.5543 0.0167
Frame 134 4.5710 0.0167
Frame 135 4.5876 0.0166
Frame 136 4.6043 0.0167
Frame 137 4.6209 0.0166
Frame 138 4.6376 0.0167
Frame 139 4.6543 0.0167
Frame 140 4.6709 0.0166
Frame 141 4.6876 0.0167
Frame 142 4.7044 0.0168
Frame 143 4.7209 0.0166
Frame 144 4.7376 0.0166
Frame 145 4.7543 0.0167
Frame 146 4.7709 0.0166
Frame 147 4.7876 0.0167
Frame 148 4.8043 0.0167
Frame 149 4.8209 0.0167
Frame 150 4.8376 0.0167
Frame 151 4.8543 0.0167
Frame 152 4.8711 0.0168
Frame 153 4.8876 0.0165
Frame 154 4.9043 0.0167
Frame 155 4.9210 0.0168
Frame 156 4.9376 0.0165
Frame 157 4.9542 0.0167
Frame 158 4.9709 0.0167
Frame 159 4.9876 0.0167
Frame 160 5.0043 0.0166
Frame 161 5.0210 0.0167
Frame 162 5.0376 0.0166
Frame 163 5.0543 0.0167
Frame 164 5.0709 0.0166
Frame 165 5.0876 0.0167
Frame 166 5.1042 0.0166
Frame 167 5.1209 0.0167
Frame 168 5.1376 0.0167
Frame 169 5.1542 0.0166
Frame 170 5.1709 0.0167
Frame 171 5.1876 0.0167
Frame 172 5.2043 0.0167
Frame 173 5.2209 0.0166
Frame 174 5.2376 0.0167
Frame 175 5.2543 0.0167
Frame 176 5.2709 0.0166
Frame 177 5.2876 0.0167
Frame 178 5.3043 0.0167
Frame 179 5.3209 0.0166
Frame 180 5.3377 0.0168
Frame 181 5.3543 0.0166
Frame 182 5.3709 0.0167
Frame 183 5.3876 0.0166
Frame 184 5.4042 0.0167
Frame 185 5.4209 0.0167
Frame 186 5.4376 0.0167
Frame 187 5.4543 0.0167
Frame 188 5.4709 0.0166
Frame 189 5.4876 0.0166
Frame 190 5.5043 0.0167
Frame 191 5.5209 0.0167
Frame 192 5.5376 0.0167
Frame 193 5.5543 0.0167
Frame 194 5.5709 0.0166
Frame 195 5.5876 0.0167
Frame 196 5.6043 0.0167
Frame 197 5.6209 0.0166
Frame 198 5.6376 0.0167
Frame 199 5.6542 0.0167
Frame 200 5.6709 0.0167
Frame 201 5.6876 0.0167
Frame 202 5.7042 0.0167
Frame 203 5.7209 0.0166
Frame 204 5.7376 0.0167
Frame 205 5.7542 0.0167
Frame 206 5.7709 0.0166
Frame 207 5.7876 0.0167
Frame 208 5.8042 0.0166
Frame 209 5.8209 0.0167
Frame 210 5.8376 0.0167
Frame 211 5.8542 0.0167
Frame 212 5.8709 0.0167
Frame 213 5.8876 0.0166
Frame 214 5.9042 0.0167
Frame 215 5.9210 0.0167
Frame 216 5.9376 0.0166
Frame 217 5.9542 0.0167
Frame 218 5.9709 0.0167
Frame 219 5.9876 0.0166
Frame 220 6.0042 0.0167
Frame 221 6.0209 0.0167
Frame 222 6.0376 0.0167
Frame 223 6.0542 0.0166
Frame 224 6.0709 0.0167
Frame 225 6.0876 0.0167
Frame 226 6.1042 0.0167
Frame 227 6.1209 0.0167
Frame 228 6.1376 0.0167
Frame 229 6.1542 0.0167
Frame 230 6.1709 0.0167
Frame 231 6.1876 0.0167
Frame 232 6.2042 0.0166
Frame 233 6.2209 0.0167
Frame 234 6.2376 0.0167
Frame 235 6.2542 0.0167
Frame 236 6.2709 0.0167
Frame 237 6.2876 0.0167
Frame 238 6.3042 0.0167
Frame 239 6.3209 0.0167
Frame 240 6.3376 0.0167
Frame 241 6.3543 0.0167
Frame 242 6.3709 0.0166
Frame 243 6.3875 0.0167
Frame 244 6.4043 0.0167
Frame 245 6.4209 0.0166
Frame 246 6.4376 0.0167
Frame 247 6.4542 0.0167
Frame 248 6.4709 0.0167
Frame 249 6.4875 0.0167
Frame 250 6.5042 0.0167
Frame 251 6.5209 0.0167
Frame 252 6.5375 0.0167
Frame 253 6.5542 0.0167
Frame 254 6.5709 0.0167
Frame 255 6.5875 0.0167
Frame 256 6.6042 0.0167
Frame 257 6.6209 0.0166
Frame 258 6.6376 0.0167
Frame 259 6.6542 0.0167
Frame 260 6.6709 0.0167
Frame 261 6.6875 0.0167
Frame 262 6.7042 0.0167
Frame 263 6.7209 0.0167
Frame 264 6.7375 0.0167
Frame 265 6.7542 0.0167
Frame 266 6.7709 0.0167
Frame 267 6.7876 0.0167
Frame 268 6.8042 0.0166
Frame 269 6.8209 0.0167
Frame 270 6.8376 0.0166
Frame 271 6.8543 0.0168
Frame 272 6.8710 0.0166
Frame 273 6.8875 0.0166
Frame 274 6.9042 0.0167
Frame 275 6.9209 0.0167
Frame 276 6.9375 0.0167
Frame 277 6.9542 0.0167
Frame 278 6.9709 0.0167
Frame 279 6.9876 0.0167
Frame 280 7.0042 0.0166
Frame 281 7.0209 0.0167
Frame 282 7.0376 0.0167
Frame 283 7.0542 0.0166
Frame 284 7.0709 0.0167
Frame 285 7.0875 0.0166
Frame 286 7.1042 0.0167
Frame 287 7.1209 0.0167
Frame 288 7.1375 0.0167
Frame 289 7.1542 0.0167
Frame 290 7.1709 0.0167
Frame 291 7.1875 0.0167
Frame 292 7.2042 0.0167

ShoinExp

unread,
Apr 26, 2014, 2:39:34 AM4/26/14
to psychop...@googlegroups.com
Hi Sol,
    That's great news!  If I understand correctly MovieStim2.py is not the current movie player in PsychoPy, so your results mean that when the new movie player is incorporated into PsychoPy it will be able to handle playing these movies.  Is that right?  If so, do you have a rough timeline of when it will be included in PsychoPy (just so I can prioritize experiments to avoid using HD until it's ready)?
    Thanks!
    Mark
Frame 259<span class="Apple-tab-span" style="white-space:pre
...

Sol Simpson

unread,
Apr 26, 2014, 11:53:27 AM4/26/14
to psychop...@googlegroups.com
That is correct; at least on a Win7 PC with a i7 (4 core with hyperthreading) 3.4 GHz CPU and a good video card like the nvidia 580GTX (which is old now, but a comparable performance current video card).  

Also, the movie clip was very short, are they all this short? If the actual ones are much longer; it would be good to test with one that is longer. I do not know if things could go wonky after a period of playing. I do not think they would, I have played a ~ 1200 x 500 pix, 30 fps movie, that is ~ 100 minutes long right through without trouble or any memory leaks I could see. Testing is the only way to know for sure though.

Jon would be the one to best guestimate when MovieStim2 gets into an official release. Given other things that are going on and the fact that the new stim still needs some finishing coding and a lot of testing, if I dared to guess I would guess 1 - 3 month range. Again, Jon is the one who has a handle on the bigger picture here.


On Saturday, April 26, 2014 2:39:34 AM UTC-4, ShoinExp wrote:
Hi Sol,
    That's great news!  If I understand correctly MovieStim2.py is not the current movie player in PsychoPy, so your results mean that when the new movie player is incorporated into PsychoPy it will be able to handle playing these movies.  Is that right?  If so, do you have a rough timeline of when it will be included in PsychoPy (just so I can prioritize experiments to avoid using HD until it's ready)?
    Thanks!
    Mark

...

ShoinExp

unread,
Apr 27, 2014, 3:45:03 AM4/27/14
to psychop...@googlegroups.com
Hi Sol,
    Thanks very much, I'll hold off on any HD experiments for a while.  yes, the videos I'm going to use are all really short (>2 sec) so if it worked with the clip I sent, it should work for my experiments.
    Thanks!
    Mark

Samuel Mehr

unread,
Dec 28, 2014, 4:51:07 PM12/28/14
to psychop...@googlegroups.com
Hi there, reviving this thread as it seems in the interim opencv is now packaged with PsychoPy. I'm trying to play 60fps videos with it and am getting very choppy playback with many warnings reported:

4.0828 WARNING MovieStim2 dropping video frame index: 2
4.0872 WARNING MovieStim2 dropping video frame index: 3
4.0915 WARNING MovieStim2 dropping video frame index: 4
4.0958 WARNING MovieStim2 dropping video frame index: 5
4.1003 WARNING MovieStim2 dropping video frame index: 6
4.1047 WARNING MovieStim2 dropping video frame index: 7
4.1090 WARNING MovieStim2 dropping video frame index: 8
4.1133 WARNING MovieStim2 dropping video frame index: 9
4.1176 WARNING MovieStim2 dropping video frame index: 10
4.3502 WARNING Multiple Movie frames have occurred - I'll stop bothering you about them!

etc. I'm running a quad-core 3.4GHz iMac and have no video playback issues outside of PsychoPy so I'm wondering if I've coded the experiment improperly? At the moment all I've got is a static image in the first routine, then opencv playing a ~8s clip at 60fps.

Maybe I should render the video in a different format? So far I've tried a few codecs in .avi containers, as well as one in .mov. The videos are animations originally created in Flash and then rendered via Adobe ME, Compressor, or MPEGStreamclip.

please advise!
thanks,
Sam

Samuel Mehr

unread,
Dec 28, 2014, 5:37:31 PM12/28/14
to psychop...@googlegroups.com
quick update: running PsychoPy on the same iMac but in a Boot Camp copy of Windows 7, playing 1920x1080 video using opencv (the raw .mov render from Flash), I have exactly the same issue with frame dropping.

Now, when I add "waitBlanking=False" to the window setup, the video plays beautifully (even cleaner than in VLC outside of PsychoPy).

So... my question is: is it possible to get comparably good playback to work in OS X? I would prefer to not need to dual boot all of our lab's machines. Adding that statement in OSX PsychoPy didn't seem to do the trick, though I'm currently trying it again with other video formats.

Thanks in advance for your help. fyi, most of our lab (https://software.rc.fas.harvard.edu/lds/) is switching over to this PsychoPy!

Jonathan Peirce

unread,
Dec 29, 2014, 6:28:37 AM12/29/14
to psychop...@googlegroups.com
I'm afraid there isn't a single answer to "can HD movies be played smoothly in psychopy". I think the answer is that we haven't got this as efficient as it could be it takes a very powerful machine to make it happen right now.

But it's interesting that the same machine can play the movie smoothly under win but not OSX. There's a suggestion that switching the mac psychopy to use 64bit binaries (we're still currently using 32bit for the standalone) will improve performance. The one thing that's holding us back from that so far is sound production; we're using pyo or pygame for sounds right now and I haven't got either to compile as 64bit libraries. PySoundCard looks very promising and I think that will work fine in 64bit so that's the aim.

In the meantime, while we work on improving the HD movie handling I'd suggest you reduce the resolution of the movie a little unless 1920x1080 is genuinely needed. I agree you could try some different formats; most of this is trial and error, but do let the list know if you find something that works for you.

cheers,
Jon
--
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.

For more options, visit https://groups.google.com/d/optout.

Samuel Mehr

unread,
Dec 29, 2014, 11:14:38 AM12/29/14
to psychop...@googlegroups.com
Thanks for all this info, Jon. We present videos to infant via projected images (roughly 8' diagonal) so this is a feature we'd love to have at some point. Until then, I'll try some more formats and resolutions (720p at 60fps might be adequate) and maybe add dual booting to our lab machines.

Will reply here if I have any news to report! The software is really a great fit for our needs and we're excited to get the whole lab moved over to it from our current hodgepodge of presentation packages.

best,
Sam

--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/bk2zRKYGmZI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.

To post to this group, send email to psychop...@googlegroups.com.

Samuel Mehr

unread,
Dec 29, 2014, 9:42:23 PM12/29/14
to psychop...@googlegroups.com
Dear Jon et al,

I've tried a ton of combinations of formats and the best bet for smooth HD playback of 2D animations in PsychoPy is 720p60 videos rendered in Apple Animation with MPEG-2 audio in an .avi container. Hope this is useful to other folks who are using HD videos.

I did notice that right at the beginning of the experiment I get many more dropped frames than later on. Is there a way to "fully" prepare the videos so that the whole video is more consistent?

thanks,
Sam

ps, for those who are interested in presenting very nice animations (visually & aurally), I had best results with the following workflow...

1. Animate in Flash/Blender/whatever at 60fps and render lossless copy at 1080p with no audio track
2. Make a soundtrack in Audition/Final Cut/Premiere & render a lossless master at 720p with uncompressed audio
3. Package that in an .avi via MPEGStreamclip (720p60 w/ MPEG-2 audio)
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-users+unsubscribe@googlegroups.com.
To post to this group, send email to psychopy-users@googlegroups.com.

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk/

--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/bk2zRKYGmZI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-users+unsubscribe@googlegroups.com.
To post to this group, send email to psychopy-users@googlegroups.com.

Sol Simpson

unread,
Dec 31, 2014, 11:23:23 AM12/31/14
to psychop...@googlegroups.com
Can you email me a link to one of the videos you are using that is giving trouble? I'd like to play around with encodings and see if I can find a 'sweet spot' for that.

As well, are you testing the movie via a Builder generated script or using a 'hand coded' script like demos/coder/stimuli/moviestim2.py? If you have not tried using the moviestim2.py coder demo, can you see if it performs differently (on either OS) for you than the script generated from Builder?

Re OSX vs Win and 64 vs. 32 bit python: I have also found a big difference between Windows and OS X performance for moviestim2 on my mac mini, even when using the psychopy standalone python on each OS. On OS X, I find using Anaconda Python 2.7 64 bit, with dependencies installed as per discussion form thread focussed on this task, makes a /huge/ improvement in moviestim2 playback performance. So, unless you need pygame and/or pyo installed for audio only file playback, it might be worth the time to setup Anaconda Python 2.7 64 bit on your OSX box.

Finally, if you could give the specs for the iMac used, including the video card / chipset,  that would be very useful.

Thanks,

Sol

Samuel Mehr

unread,
Dec 31, 2014, 12:41:58 PM12/31/14
to psychop...@googlegroups.com
Dear Sol,

Thanks for the help! 

Here's a sample video: https://www.sugarsync.com/pf/D9732234_98587548_6828553. This one was my 'sweet spot' — 720p60 avi encoded with Apple Animation and uncompressed audio (above I mentioned MP2 audio but I later found no appreciable difference in playback quality with higher quality audio, so left it uncompressed). If you'd like to start with a higher quality source, I can send you the original in 1080.

I was using the Builder but would love to learn enough python chops to do it entirely at the script level (link to my builder file: https://www.sugarsync.com/pf/D9732234_97711287_445513). The rest of the experiment is comprised of longer clips like these (~35s max), with a couple of loops and a counterbalancing script at the beginning that defines 3 variables, to tell the loops which videos to play and in which order. There's also a redundant window setup script in there since I was switching back and forth enough from Builder to Coder that I didn't want to lose the waitBlanking=False item.

Pretty much all we do in our experiments is show infants pictures and videos (rarely do we use standalone sounds), so I don't see why we wouldn't use Anaconda if the videos will be smoother, and if it's straightforward to implement. If we do, could people in lab still use the Builder interface to write their experiments? or would they need to do everything at the script level?

I haven't tried the moviestim2 demo but will when I next get to lab (not sure if I'll get in today) and when I do I'll also send you the specs. It would be awesome if we can get this going on OSX, since I doubt people will like the added time of dual-booting...

thanks again!
Sam

--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/bk2zRKYGmZI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.

To post to this group, send email to psychop...@googlegroups.com.

Michael MacAskill

unread,
Jan 1, 2015, 1:12:42 AM1/1/15
to psychop...@googlegroups.com

> On 1/01/2015, at 06:41, Samuel Mehr <samue...@gmail.com> wrote:
>
> Pretty much all we do in our experiments is show infants pictures and videos (rarely do we use standalone sounds), so I don't see why we wouldn't use Anaconda if the videos will be smoother, and if it's straightforward to implement. If we do, could people in lab still use the Builder interface to write their experiments? or would they need to do everything at the script level?
Hi Sam,

You can certainly still use Builder. The only difference is how you launch PsychoPy: instead of double-clicking the PsychoPy standalone icon, you need to launch another copy of PsychoPy, from the command line. This forces it to be run using the 64 bit Anaconda version of Python rather than the 32 bit version that is currently packed within the standalone program. Once it is launched, you’ll see PsychoPy running as normal, although it only gets a boring generic icon in the Dock.

I keep thinking we need to post an updated list of instructions of how to do this, as it is the same process that developers who want to contribute to PsychoPy need to go through, and it has changed a bit since the web instructions were written. I’ll post a draft of that in another thread for comments.

Regards,

Michael

Samuel Mehr

unread,
Jan 1, 2015, 1:30:49 AM1/1/15
to psychop...@googlegroups.com
Thanks Michael, that sounds great, as it would enable other users of the same presentation computer to continue using 32-bit psychopy for their studies without needing to change anything!

I'll check out the updated instructions once they're posted, to be sure I'm running the appropriate code. And Sol, once I've got Anaconda going I'll let you know if the playback is smoother.

Sam

--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/bk2zRKYGmZI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

Samuel Mehr

unread,
Jan 1, 2015, 2:20:38 PM1/1/15
to psychop...@googlegroups.com
Sol, below is a copy of the specs of one of the iMacs I'm using. Eventually I'd like to be able to do this on a slightly less powerful machine but this'll do for now. On the docket for today is trying the Anaconda 64-bit and if that's no good then also the moviestim2 demo.

Sam

Model Name: iMac
Model Identifier: iMac14,2
Processor Name: Intel Core i5
Processor Speed: 3.4 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 6 MB
Memory: 16 GB
Boot ROM Version: IM142.0118.B00
SMC Version (system): 2.15f2

Chipset Model: NVIDIA GeForce GTX 775M
Type: GPU
Bus: PCIe
PCIe Lane Width: x16
VRAM (Total): 2048 MB
Vendor: NVIDIA (0x10de)
Device ID: 0x119d
Revision ID: 0x00a2
ROM Revision: 3755

Displays:
iMac:
Display Type: LCD
Resolution: 2560 x 1440
Pixel Depth: 32-Bit Color (ARGB8888)
Main Display: Yes
Mirror: Off
Online: Yes
Built-In: Yes

To unsubscribe from this group and all its topics, send an email to psychopy-users+unsubscribe@googlegroups.com.
To post to this group, send email to psychopy-users@googlegroups.com.

Samuel Mehr

unread,
Jan 1, 2015, 4:16:29 PM1/1/15
to psychop...@googlegroups.com
Hi Sol,

I've just tried to use the moviestim2 demo instead of my own script. The included video works fine, but when I replace it with that test video I sent you ("calibration.avi") it's as choppy as ever, even when presented in the smaller window that the demo file sets up. I'm guessing the solution will be best with 64-bit psychopy, assuming I can get it working (see Mike's instructions post — I've got psychopy running but it doesn't recognize my 64-bit copy of VLC for moviestim2, so can't yet play videos!)

Sam

Sol Simpson

unread,
Jan 5, 2015, 10:04:33 AM1/5/15
to psychop...@googlegroups.com
Sorry for the delay in reply. Thanks for all the updates, files,  and info. I will look into this more in the next few weeks. Jon has also been doing some tuning of the movie2 stim code that may end up helping some.

Please do let me know how the Anaconda Python 2.7 64 bit setup set goes if /when you have time to try it. I'll also try running the movie you sent on my mac mini and let you know how it goes.

Happy New year.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

Samuel Mehr

unread,
Jan 5, 2015, 1:33:25 PM1/5/15
to psychop...@googlegroups.com
Hi Sol: I've now got pp running in Anaconda 2.7 — but actually see very little difference in playback quality using the 720p60 videos between it and the 32-bit version, at least on my main machine (ie, it drops about every other frame). That said, the render I described above plays well enough to be acceptable for use so I'm now piloting it with a cohort of infants, but it would be ideal if at some point we can figure out higher quality playback, both for 60fps in general but also at 1080p — especially for those experiments in which we use videos of real people and not just animations!

Looking forward to hearing what you find out.

thanks for all the help and happy new year
Sam

Sol Simpson

unread,
Jan 7, 2015, 10:16:31 AM1/7/15
to psychop...@googlegroups.com
If you are seeing no difference, and with a 60 fps video every second frame is being dropped,my guess is that the current movie2 frame scheduling code is not working correctly for 60 fps video; perhaps because it is equal to the monitor refresh rate. If you make a version of the video that is say 30 or 45 fps, my bet is that you will see the diff, and that very few frames will drop on the 64 bit env.

This guess is based on my testing with is a .mp4 video that is 1280 x 536 pixels @ 30 fps. I have a mac mini with Intel video as an OSX test box; its specs are lower than what you have. This 30 fps runs great in the 64 bit env on OSX, dropping only a few frames if played for an hour. However the same video plays horribly, even hanging the experiment all together, if I try and use the 32 bit psychopy python on OSX. The same video, on the same mac mini but running Windows 7 via bootcamp, runs fine using either the psychopy standalone 32bit python, or the Anaconda 64bit python. 

I'll try and get to looking into this issue by middle of next week, using the 60 fps video demo you provided. If I recall, you sent a link to the /optimized' version of the video. Could you also send me a link to get the original video (original encoding and container format) too?

Thank you. 

Samuel Mehr

unread,
Jan 7, 2015, 5:14:10 PM1/7/15
to psychop...@googlegroups.com
Sure thing, Sol. Here's a link to the full-quality render: https://www.sugarsync.com/pf/D9732234_98587548_6823044. As a test, I rendered a copy at 55 fps so the framerate was different than the monitor refresh rate... it looked about as choppy as before, and still reported dropping roughly every other frame.

Sam

Sol Simpson

unread,
Jan 13, 2015, 7:38:59 PM1/13/15
to psychop...@googlegroups.com

Hi Sam,

I have spent the day looking at the moviestim2 stuff. I have only been able to test on Windows so far, using a modified version of the moviestim2.py demo called MovieStim2TimingTest.py. I've made a pull request that includes this new script, so it should get into the psychopy/psychopy master branch of github sometime in the next couple days. I also made some changes to the moviestim2 class, related to the time it takes to get and draw each frame from the video, furthering the improvement made by Jon a few weeks ago. 

No great new news specific to your situation right now though; I just wanted to give you an update on where I am at on this.  I am able to run the 'calibration.mov' video you sent, but when I try using the 'calibration.avi' file opencv gives an exception saying there was an error reading the file. Not sure what is up with that. On Windows 7 (have not dusted off the mac mini yet), with an i7 CPU and nvidia graphics card, I am able to play the calibration.mov video at 1280x720, 60 fps, with 5 - 10 frames getting dropped at most, almost always near the start of the video. 


In general, I think there is something not right about the frame display scheduling and audio channel playback synchronization near the start of a video that will sometimes cause frames to be video dropped just to sync up with the audio stream time. Not exactly sure. I will try and look into that soon.

When you have a chance, if you could get the updated psychopy source when the  'MovieStim2TimingTest.py' has been made available, and run it on your computers.  If you can then email me the results file that the script saves, which has information about the computer's hardware and software, as well as a tab delimited table of video frame timing data. This will help understand what the bottleneck is on your systems. FYI, I am attaching the report created by the script for the calibration.mov video when played on my setup. The actual frame by frame timing data starts on line 75 of the file. So for this run of the video, 5 frames were dropped, being frames 2 - 5, and 11.

I'm going to start a thread on the psychopy-dev group about the moviestim2 performance as determined by using the  'MovieStim2TimingTest.py' script, this is all getting out of scope for the user group I think. So please keep an eye out for that for more details as they become available.

Thank you.
calibration_mov_frame_timing.txt

Samuel Mehr

unread,
Jan 15, 2015, 6:58:08 PM1/15/15
to psychop...@googlegroups.com
Hi Sol, for me this will have to wait till the end of the month, as I'm away from lab where the relevant machines are. Will check in when I return!

best
Sam

--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/bk2zRKYGmZI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

Samuel Mehr

unread,
Feb 3, 2015, 4:22:11 PM2/3/15
to psychop...@googlegroups.com
Hi Sol, I'm just getting back to lab and catching up. Would it still be useful to get you the test info? If so, just checking: would installing a fresh copy of standalone PsychoPy now include MovieStim2TimingTest.py ? or do I need to do something else to get a copy of that?

let me know; I should be able to take a look in the next couple of days.

best
Sam

On Tue, Jan 13, 2015 at 7:38 PM, Sol Simpson <s...@isolver-software.com> wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/bk2zRKYGmZI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

Sol Simpson

unread,
Feb 3, 2015, 5:08:23 PM2/3/15
to psychop...@googlegroups.com
If you install a fresh copy of the psychopy standalone 1.82, it will have the new test and the updated movie2 stim I believe. 

Someone else has reported the updated movie2 code in 1.82 now only shows a black box instead of the frames on their OSX boxes, so it would be good to know if you get that issue as well or not. The test will save info about your computer sw and hw including the graphics card info.

I have run the new test script with your 60 fps video and 2 others on 3 windows computers and my mac mini with python 32 bit and 64 bit. The plan was to send out a summary of the findings, but have not had the time yet.

Samuel Mehr

unread,
Feb 3, 2015, 7:27:39 PM2/3/15
to psychop...@googlegroups.com
Hi Sol, I installed standalone 1.82 and haven't found the MovieStim2TimingTest.py file anywhere. I tried to run an existing experiment with those 60fps videos, and got a 1280x720 black box. sounds from the video played while the box was there.

Let me know how to get the test file and I'll run that as well.

Sam

Sol Simpson

unread,
Feb 4, 2015, 11:16:00 AM2/4/15
to psychop...@googlegroups.com
So you are getting the same issue as Frank. Can you update your movie2.py source file, as discussed in this post, and let me know if the black frame issue goes away. That will help me narrow down what the compatibility issue could be.

If the MovieStim2TimingTest.py file is not in the psychopy/demos/coder/stimuli folder in 1.82, then you can grab it from github, here.

Thanks again,

Samuel Mehr

unread,
Feb 4, 2015, 4:30:13 PM2/4/15
to psychop...@googlegroups.com
Thanks, Sol. I replaced my movie2.py file with the one at the end of the post you linked to, and it fixed the black frame issue.

For some reason when I originally searched github, the testing file didn't turn up. Anyway, now I've got it and ran, so attached are two frame timing result files. The first is with a .mov file rendered from Flash (in which the audio didn't play properly — it was just static noise) and the second is the same video rendered with the Apple Animation codec an .avi container. I'm not entirely sure but the playback seemed a bit smoother than usual on the .avi though placebo effects may be setting in....

best,
Sam

Intro_avi_frame_timing.txt
Intro_mov_frame_timing.txt

Sol Simpson

unread,
Feb 5, 2015, 11:04:40 AM2/5/15
to psychop...@googlegroups.com
Thanks for the logs. 

1) You are using an nvidia card as well, so my guess is that the osx nvidia opengl driver does not like the target pixel format constant I changed. I'll try using a different , but equivalent constant that hopefully will work on all osx nvidia opengl drivers. Since I can not reproduce the issue on my mac mini (that has an ati card), can I send you an updated file to test so I know if what I changed actually fixes the issue?

2) The average draw time of the avi formatted file was 8 msec, while the mov was 25 msec! Even though the draw time was 1/2 the video frame frame, the movie code is still skipping every second frame or so. This means there is a bug in the movie2 code logic that determines when a frame should be dropped to /keep up/ with the expected video position at that time. I will also look into fixing this.

Samuel Mehr

unread,
Feb 5, 2015, 11:07:09 AM2/5/15
to psychop...@googlegroups.com
sure thing! happy to continue testing as needed. I should note that I'm not doing the testing on the exact same machine we'll be using in our lab (that one is usually in use and I can't mess around with video settings without screwing up ongoing studies) but it's a very similar imac (I think same video card) so I don't anticipate any issue with swapping over to that one.

thanks,
Sam

--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/bk2zRKYGmZI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.

Jonathan Peirce

unread,
Feb 9, 2015, 8:01:07 AM2/9/15
to psychop...@googlegroups.com
Sol, I've worked out the issue with the movie being black. It looks like some versions of OpenCV (or some versions of OSX?) can't use the opencv retrieve() function the way we had it but this seems to work instead:
    https://github.com/psychopy/psychopy/commit/6b2a48deafddb89c19b7beafb79b30f6466e36cc

Sam, I'll try to get a new release out today with this fixed.

cheers
Jon
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.

For more options, visit https://groups.google.com/d/optout.

-- 
Jon Peirce
http://www.peirce.org.uk


This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.
Reply all
Reply to author
Forward
0 new messages