Code covered by the BSD License  

Highlights from
Tools for generating and playing video realtime

image thumbnail

Tools for generating and playing video realtime

by

 

22 Mar 2012 (Updated )

Generation of video in matlab, with the means of playing it realtime in a separte thread via VLC

runMe
function runMe

% self explanatory demo
% copyright 2012, Stefan M. Karlsson. 
% stefan.karlsson@hh.se,
% stefan.karlsson987@gmail.com

% see licence.txt for licence details. Copyright 2012 Stefan Karlsson


%check that VLC player is available
playVid('--Check_VLC_system_Location');

h = msgbox('First we will generate stimulus that is time demanding to render. Hit a key, or close the figure to stop generating the sequence(but let it do at least a few seconds first). Will start after you click away this dialog');
uiwait(h);

generateMotionStimulus('stefanArt', 0, 'stefanArt.avi');

h = msgbox('Now that stimulus has been saved to "stefanArt.avi" we play it realtime, NOT with matlab built in stuff that just lags up everything, but starting a separate thread, with highest possible priority (done by function playVid)');
uiwait(h);

playVid('stefanArt.avi');

h = msgbox('Next we will generate stimulus of a inaccurately drawn disk. You can wait until VLC is finished with its old task, or you can just start this while VLC is running in the background');
uiwait(h);

generateMotionStimulus('aliasedDisk', 1,'aliasedDisk.avi');
playVid('aliasedDisk.avi');

h = msgbox('The aliased disk has problems, as we perceive the effects on the boundaries quite clearly. This can mess up experiments in various ways. The solution comes next');
uiwait(h);

generateMotionStimulus('fuzzyDisk', 1,'fuzzyDisk.avi')
playVid('fuzzyDisk.avi');

h = msgbox('Finally, some standard Gabor like patches to visualize the usefullness of this application');
uiwait(h);

generateMotionStimulus('threePatterns', 1,'threePatterns.avi')
playVid('threePatterns.avi');

Contact us