A stimulus class for playing movies (mpeg, avi, etc...) in PsychoPy.
Example:
mov = visual.MovieStim(myWin, 'testMovie.mp4', flipVert=False)
print mov.duration
print mov.format.width, mov.format.height #give the original size of the movie in pixels
mov.draw() #draw the current frame (automagically determined)
See MovieStim.py for demo.
| Parameters : |
|
|---|
Draw the current frame to a particular visual.Window (or to the default win for this object if not specified). The current position in the movie will be determined automatically.
This method should be called on every frame that the movie is meant to appear
Load a movie from file
| Parameters : |
|
|---|
Brings up a warning if avbin is not found on the computer. After the file is loaded MovieStim.duration is updated with the movie duration (in seconds).
Pause the current point in the movie (sound will stop, current frame will not advance). If play() is called again both will restart.
Continue a paused movie from current position
Seek to a particular timestamp in the movie. NB this does not seem very robust as at version 1.62 and may cause crashes!
Add or remove a stimulus from the list of stimuli that will be automatically drawn on each flip
| Parameters : |
|
|---|
See ~MovieStim.loadMovie (the functions are identical). This form is provided for syntactic consistency with other visual stimuli.
Sets the opacity of the movie to newOpacity
Stop the current point in the movie (sound will stop, current frame will not advance). Once stopped the movie cannot be restarted - it must be loaded again. Use pause() if you may need to restart the movie.