LABSN / expyfun

Experimental paradigm functions.
BSD 3-Clause "New" or "Revised" License
13 stars 21 forks source link

BUG: Fix video playback with other visuals #413

Closed larsoner closed 4 years ago

larsoner commented 4 years ago

Closes #358

larsoner commented 4 years ago

@drammock this fixes a bug with video playback when other visuals are used. Can you give it a look?

codecov[bot] commented 4 years ago

Codecov Report

Merging #413 into master will increase coverage by 0.01%. The diff coverage is 80.95%.

@@            Coverage Diff             @@
##           master     #413      +/-   ##
==========================================
+ Coverage   88.36%   88.37%   +0.01%     
==========================================
  Files          49       50       +1     
  Lines        6582     6609      +27     
  Branches     1090     1093       +3     
==========================================
+ Hits         5816     5841      +25     
- Misses        513      514       +1     
- Partials      253      254       +1     
larsoner commented 4 years ago

@LiesbethGijbels can you see if the advanced_video.py example works for you? In theory it should allow you to use expyfun video functions to show your video rather than cv2.

larsoner commented 4 years ago

@drammock can you look and try this out?

drammock commented 4 years ago

Not easily. see spatialaudio/python-rtmixer#22

drammock commented 4 years ago

running advanced_video.py example on Linux looks good after installing pillow(which is an unstated dependency, maybe only for screenshots?). I see the video shrinking and then moving rightward, with the background color changing behind it. Keyboard button presses do not work to pause the video however.

drammock commented 4 years ago

After setting config value RESPONSE_DEVICE to keyboard, I still can't pause the video.

larsoner commented 4 years ago

I broke that bit of the example, it should be fixed now (pausing using 1. pauses things on my machine). If you get no keyboard response at all, perhaps try simple_experiment.py to see if other experiments work or not. It will tell us if the problem is specific to this example, or to expyfun/pyglet overall

drammock commented 4 years ago

hmm, button presses not working in simple_experiment either. I've probably forgotten some dumb aspect of the setup; it's been so long since I set up a new system like this.

larsoner commented 4 years ago

Make sure the window that pops up actually has focus, you might need to click on it to get it to really have focus

drammock commented 4 years ago

you might need to click on it to get it to really have focus

yeah, I've been doing that; still no dice.

larsoner commented 4 years ago

Maybe try changing Pyglet versions? pip install pyglet==1.3.2 or pyglet<1.5 to get some 1.4 variant...?

If that doesn't work, which window manager are you running? I can try to replicate. Running just from a terminal with python -i whatever.py I assume?

drammock commented 4 years ago

downgrading to pyglet 1.4 worked!