# making a quicktime movie

**URL:** https://psychtoolbox.discourse.group/t/making-a-quicktime-movie/1406
**Category:** Uncategorized
**Created:** [March 27, 2009, 8:46pm UTC](https://psychtoolbox.discourse.group/t/making-a-quicktime-movie/1406 "2009-03-27T20:46:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)
#### Post date: [March 27, 2009, 8:46pm UTC](https://psychtoolbox.discourse.group/t/making-a-quicktime-movie/1406/1 "2009-03-27T20:46:00Z")

</div>

Hi,  
  
I have an experiment that shows colored objects moving around on a black screen.  
It draws the objects using Screen. After the positions are updated, the screen  
is flipped, and the objects are redrawn. I want to make a quicktime video of  
what appears on the screen. How do I do this?  
  
Thanks

---

<div class="post-metadata">

### Author: ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)
#### Post date: [April 16, 2009, 3:01am UTC](https://psychtoolbox.discourse.group/t/making-a-quicktime-movie/1406/2 "2009-04-16T03:01:08Z")

</div>

Hi Peter,  
  
This should about do the trick:  
  
%----  
% record movie of trial - don't forget to save it to avi by hand  
% afterwards with  
% movie2avi(ims,'filename.avi','COMPRESSION','None','FPS',60) -- set FPS to  
% screen's framerate, e.g. VLC seems to be able to play right about any  
% framerate  
  
ims.cdata = []; ims.colormap = []; end; % struct for  
movie frames -\> for avi output -- trick here is that for movie2avi()  
to work, the struct must have the fields cdata and colormap, even if  
colormap is not used.  
  
for q=1:nframes % display all your frames, notice that q is the  
current frame number  
 %...  
 ims(q).cdata = Screen('GetImage', ....);  
 %...  
end  
  
% as noted above, now just use movie2avi() to save the file. Check the  
help of that function to see which formats are avaiable for your  
platform (on windows, I think MATLAB is able to use any properly  
installed codec of your choice).  
%----  
  
Best,  
Diederick  
  
  

> On Wed, Apr 1, 2009 at 8:38 PM, peter.scarfe \<[peterscarfe@...](mailto:peterscarfe@...)\> wrote:  
> \>  
> \>  
> \> Hi,  
> \>  
> \> I want to make a quicktime movie from stimuli presented in PTB for use in  
> \> presentations, is there a simple way to do this?  
> \>  
> \> I can see that a portion of the screen window can be captured using the  
> \> Screen('GetImage', ) command. But is there a simple way to make these  
> \> captured frames into a quicktime (or other format) movie for use in  
> \> powerpoint presentations etc.  
> \>  
> \> Thanks,  
> \>  
> \> Peter
