| Home Introduction User's Guide Download

| AviWriteFrame: |  |

| NAME AviWriteFrame ¨C write one image into the specific AVI file. SYNOPSIS AviWriteFrame(AviWriteMessage, image) PARAMETERS AviWriteMessage ¡¡The writing message, it's obtained initially after
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡the CreateAviFile function, and it should be modified
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡after the execution of the function, that is
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡AviWriteMessage(6)=AviWriteMessage(6)+1
pos¡¡¡¡¡¡The position of the video frame.
image¡¡¡¡M¡ÁN¡Á3 matrix for ture color image, while a M¡ÁN matrix for both
¡¡¡¡¡¡¡¡¡¡gray-scale and binary image.
DESCRIPTION
Function AviWriteFrame writes one image into the specific video file. But one should keep to his previous settings during the process of inserting frames into the file, such as the width and height of one frame. And furthermore, it's ok to insert N (N <= totalframes) frames into the AVI file, but inserting M (M >totalframes) frames is forbidden. If the writing failed, then an error hint - ¡®Writing error' would occur.

EXAMPLE
// example for writing a new AVI file
stacksize(3e7);
initial_dir = PWD;
chdir (VIPDIR + 'videos\pictures');
dirs = ['1.gif','2.gif','3.gif','4.gif'];
im= imread(dirs(1));
dims=size(im);
newFile='flips.avi';
new_ppavi = CreateAviFile(newFile,80 ,dims(2) ,dims(1));
each = 20;
disp("waiting for writing.....");
if new_ppavi <> []
¡¡¡¡for i=1:4
¡¡¡¡¡¡¡¡[im,map] = imread(dirs(i));

¡¡¡¡¡¡¡¡im = ind2rgb(im,map);
¡¡¡¡¡¡¡¡for j= 1:each
¡¡¡¡¡¡¡¡AviWriteFrame(new_ppavi,im);
¡¡¡¡¡¡¡¡end
¡¡¡¡end
¡¡¡¡AviWriteEnd(new_ppavi);
end
chdir(initial_dir);

See also
CreateAviFile , AviWriteEnd, OpenAviFile, AviReadFrame

back

Entry
Home Introduction User's Guide
Function Reference
SIP Functions New Image Func Video Functions
Developer's Guide
Graphical Display Video Processing Modified Functions GUI
Demo
Image Processing Video Processing
Support
Future Work Known Bugs FAQ Acknowledgement About Us

|  |  | About Us | Contact Us | Our University Copyright © 2004-2005 Scilab group of Xiamen University, China |  |