LoadMovieIntoTexturesDemoOSX(moviename [, fromTime=0][, toTime=end][, indexisFrames=0][, benchmark=0])
A demo implementation on how to load a movie into standard
Psychtoolbox textures for precisely controlled presentation timing and
presentation order.
Parameters:
moviename - Filename of moviefile to use. If none is provided, then the
simple
DualDiscs collision movie is used which is part of PTB.
fromTime - Start time (in seconds) from which the movie should be read
into textures. Defaults to start of movie, if not provided.
toTime - End time (in seconds) upto which the movie should be read
into textures. Defaults to end of movie, if not provided.
indexIsFrames - If set to 1 then the fromTime and toTime parameters are
interpreted as frameindex (starting with 0 for the first frame), instead
of seconds.
benchmark - If you set this parameter to 1, the demo will compute the
time it takes to load the movie and the maximum display speed without
syncing to vertical refresh. All visual progress feedback is disabled.
This is mostly useful to benchmark different movie file formats and
codecs for their relative efficiency on a given machine.
How the demo works: Read the source code - its well documented ;-)
This demo "preloads" the movie into textures:
The whole movie gets read into PTB textures before start of trial. Then
you show the textures in quick succession like in
MovieDemoOSX. The
advantage of this approach is exact control over display timing and
display order: You can show frames in any order you like at any rate you
like (and that your hardware likes). Disadvantage: Longer trial
setup time for loading the whole movie, higher memory consumption (keep
all n frames in memory instead of only the current one) and the inability
to play sound in sync with video.
To make it a bit more interesting, you can use this demo to "browse" short
videoclips, e.g., for selection of interesting parts...
Psychtoolbox/PsychDemos/QuicktimeDemos/LoadMovieIntoTexturesDemoOSX.m