5.0

5.0 | 5 ratings Rate this file 18 Downloads (last 30 days) File Size: 18.6 KB File ID: #3133

avilib: a pedestrian AVI creator wrapper

by

 

14 Mar 2003 (Updated )

creates avi files using syntax akin to fopen / fwrite / fclose

| Watch this File

File Information
Description

AVILIB is a simple wrapper for ML's basic AVI engine to easily create AVI movies using the more
familiar low-level file-i/o syntax of the form:

- aopen : open an AVI file
- awrite : write to an AVI file
- aclose : close an AVI file

takes image(s) of the form
- RGB (x/y/3)
- INDEXED (x/y)
- getframe(...)

performs extensive error checking on subsequent input(s)
- size
- bit-depth

for further explanations see:
     help aopen
     help awrite
     help aclose
     help avilib

EXAMPLES
     aid=aopen('-f','foo');
for i=1:10
     aid=awrite(aid,rand(128,128,3));
     aid=awrite(aid,{rand(128,128,3);rand(128,128,3)});
end
     aid=aclose(aid);
% if used in a wintel (2k/xp) env
% with <windows player> installed,
% this will show the movie right away:
     !foo.avi

     set(gcf,'position',[100 100 200 200]);
     cm=summer(10);
     lh=plot(0:20,rand(1,21),'linewidth',5);
     aid=aopen('-f','goo');
for i=1:10
     set(lh,'color',cm(i,:));
     f=getframe(gca);
     r=uint8(255*rand(size(f.cdata)));
     aid=awrite(aid,f,r,{f r;f r});
end
     aid=aclose(aid);
% !goo.avi

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
19 Sep 2012 Mr Smart

For me aopen command does not work.Why?
>>Undefined function or method 'aopen' for input arguments of type 'char'.<<

21 Mar 2010 Harry Commin

This is absolutely excellent! I'll never use Windows Movie Maker again!

Just one thing to note is that a few more usage examples might be useful. For example, framerate is set using: "aid=aopen('-f','foo','-d',32);" ... not "aid=aopen('-f','foo','-d','32');" or "aid=aopen('-f','foo','-d 32');" etc.

This may be obvious, but it could save some people a little time.

19 May 2007 Kambiz Bahaadini

In my Experinece, it is excellent

17 Aug 2005 Kourosh Abdolmaleki  
11 May 2004 Krishna Venkat

good tool and easy to incorporate in one's own routine. I was stuck trying to write frames into avi files after processing them. This is fast and efficient. Thanx a ton

Updates
19 Mar 2003

enhanced example section

20 Mar 2003

enhanced example section once more

14 Apr 2003

enhanced error message section

21 May 2003

extended help

22 May 2003

extended description

16 Aug 2006

small change in structure assignment due to new warning message in R14+ (thanks to user gabrielle); version tag 14-Aug-2006 16:34:49

Contact us