movie

 element objects

Plays a movie file (avi, mov, etc.). Note if you have image files to use as frames, you can use tool images2movie in <PsychBench folder>/tools to render them into a movie file.

▸ Object ends on its own?

By default yes, when the movie file ends. Or you can set repeat = <cd>true<cd> if you want to repeat the movie until a condition you set in property end.

"Ends on its own" means ends automatically at that point. If an element can end on its own, you don't need to set end conditions for it in property end (unless you want it to maybe end earlier).

No—runs until any condition you set in property end.

Input properties
Record properties
movie
elements (see below)

fileName
crop
height
times
speed
repeat
phase
grayscale
volume

All visual elements
position
depth

nn_eyes
rotation
flipHorz
flipVert

colorMask
alpha
intensity
contrastMult
convolution
shader
filterOrder
filterGrayscale
filterResolutionMult
filterGamma

channelResolution
backColor
addDisplay

All visual elements
position

All adjuster elements have
adjust

All elements
start
end

startBuffer
endBuffer

vary
staircase

All objects
report
info

fileName

No default

A string that is name of movie file to show. Include path if the file is not in the MATLAB current folder or search path (or not the first file with that name on the search path). File can be any format and codec GStreamer accepts, which should include all the major ones.

crop

Default: show whole movie image

A 1×4 vector [x_tl y_tl x_br y_br] setting part of the movie image to show. +x = right, +y = down, <cd>[0 0]<cd> = top left of image. Units are px in the movie file (independent of your screen or the size you show the movie at). For right and bottom you can use <cd>inf<cd> to mean that edge of the image, e.g. <cd>[0 0 inf inf]<cd> = show whole image. Other properties like height below are applied after crop.

height

Default: 1 px in movie file = 1 px on screen

A number that is height on screen to show at (deg).

OR a string setting overall size of the movie on screen:

<cds>"fit"  <cds> – fit to window
<cds>"fitw" <cds> – fit width to window
<cds>"fith" <cds> – fit height to window
<cds>"fill" <cds> – fill window
<cds>"px"   <cds> – native resolution: 1 pixel in movie file = 1 pixel on screen (scaled down if you use a partial screen window)

All the fit and fill options assume the movie is centered in the window.

times

Default: play whole movie

You can set this to a vector [t1 t2] (sec) to play only a specific time range in the movie file. t1 = <cd>0<cd> = start of file, t2 = <cd>inf<cd> = end of file.

Note: Currently this property only works if the movie is not set to repeat, i.e. if you leave repeat below = default <cd>false<cd>.

speed

Default: normal

Play speed: +1 = normal, −1 = backward, etc. Not all play speeds are possible for all movie formats—see Psychtoolbox Screen('PlayMovie') for more information.

repeat
phase

Default: repeat = ends on its own when movie file ends
Default: phase = start at start

repeat = <cd>true<cd>/<cd>false<cd>: repeat until a condition you set in property end. If <cd>false<cd>, the element ends on its own at the end of the movie file. Or you can set to a number for more options—see Psychtoolbox Screen('PlayMovie') input loop.

If repeat = <cd>true<cd>, you can set phase to specify a start time in the movie file (sec). 0 = start.

grayscale

Default: show a color movie in color

<cd>true<cd>/<cd>false<cd>: show a color movie in grayscale.

volume

Default: current system volume

A number between 0–1: 0 = no sound, 1 = current system volume. This scales the volume in your system sound settings. Mainly useful if you want different movie elements to play at different volumes.

Adjustable properties

You can vary or allow the subject to adjust the following properties of an object of this type when it's running. If you need to make other properties adjustable, you can edit the element type code—see Element Type Programming Manual.

Adjustable properties

Adjustable properties

position
nn_eyes
rotation
colorMask
alpha
intensity
contrastMult
drawCodeVars

(None)

(None)

Input properties
Record properties

PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results using input property report.

movie
elements (see below)

All elements
startTime
endTime
duration
n_startFrame
n_endFrame
startLatencyBufferable
endLatencyBufferable