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. You can change this using properties times/maxNumLoops/phase.

"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
maxNumLoops
phase
loopMode
speed
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
info
report

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 file

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, t2 = <cd>inf<cd> = end. If you combine with maxNumLoops/phase below, those properties work within the part specified here.

maxNumLoops
phase
loopMode

Default: maxNumLoops = play once
Default: phase = start at start of movie file
Default: loopMode = 1

maxNumLoops is a number > 0 that is number of loops through the movie file or time range to play, after which the object ends. Note this number can be fractional, not just integer. <cd>inf<cd> = repeat until a condition you set in property end.

phase is start time in the movie file or time range (sec). 0 = start. phase is best used to set a starting point for a looping stimulus. If you just want to play the file from a certain point to its end (or from a certain point to its start playing in reverse), use times above instead with maxNumLoops = 1.

loopMode is a number that goes to Psychtoolbox Screen('PlayMovie') input loop. It applies if properties above are set such that the movie element loops through end/start of the movie file. This is a technical parameter that you can usually leave at default.

speed

Default: normal

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

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