Sunday 15 April 2012

psychopy - Cannot use moviestim2 on Mac OSX 10.9.5 -



psychopy - Cannot use moviestim2 on Mac OSX 10.9.5 -

i programme experiments on macbook pro osx 10.9.5, graphic card intel hd graphics 4000 1024 mb, vlc version 2.0.10 twoflower (intel 32bit). used nowadays videos (avi , mp4 files, 60 frames per second) moviestim version 1.80. after upgrading version 1.81 installing standalone version tried utilize moviestim2, adapting code in moviestim2.py. when run code below:

psychopy import visual, core import time, os, pylab os.chdir('/users/till/work/edv/psychopy/test/') win = visual.window([1440, 900]) win.setrecordframeintervals(true) mov = visual.moviestim2(win, 'jwpintro.mov', size=[800,800], pos=[0, 100], flipvert=false, fliphoriz=false, loop=false) shouldflip = mov.play() while mov.status != visual.finished: if shouldflip: win.flip() else: time.sleep(0.001) shouldflip = mov.draw() intervalsms = pylab.array(win.frameintervals[1:])*1000 m=pylab.mean(intervalsms) ntotal=len(intervalsms) ndropped=sum(intervalsms>(1.5*m)) print "ntotal", ntotal print "ndropped", ndropped core.quit()

the video shown in total length, output is

ntotal 142

ndropped 2

(warnings deleted). when run code 1 of videos (file format mov, size adjusted 800x800), generated ffmpeg in format h.264 852 png files 60 frames per sec show moving objects tracking task (no sound data), window closes after showing first frame. output is

ntotal 0

ndropped 0

/applications/psychopy2.app/contents/resources/lib/python2.7/numpy/core/_methods.py:55: runtimewarning: mean of empty slice. warnings.warn("mean of empty slice.", runtimewarning) /applications/psychopy2.app/contents/resources/lib/python2.7/numpy/core/_methods.py:67: runtimewarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount)

(other warnings deleted) tests file formats avi , mp4 generated ntotals of 1 2 , accordingly no runtime warnings , same result.

any help appreciated, because not able homecoming psychopy 1.80 using moviestim before avbin 10 (window freezes, psychopy not crash) workaround.

best,

till

the issue has videos not having sound track. seek setting 'noaudio' kwarg true when create moviestim2.

class="lang-python prettyprint-override">visual.moviestim2(win, 'jwpintro.mov', size=[800,800], pos=[0, 100], noaudio=true, flipvert=false, fliphoriz=false, loop=false)

moviestim2 should able auto observe when there no sound stream @ all; should changed when there time. ;)

if above not work, can post link 1 of sample videos can download , debug?

update: tested suggested workaround, find uncovered other issues. (arrrg..) these issues fixed, means suggestion work, need update psychopy bundle source psychopy github master stream of oct 23rd, 2014, or utilize official bundle update if 1 available released after date.

psychopy

No comments:

Post a Comment