用matlab 将图片序列导出视频
2015-11-11 16:25
441 查看
code:
以下是help matlab 对于avifile的解释:
AVIFILE Create a new AVI file
AVIOBJ = AVIFILE(FILENAME) creates an AVIFILE object AVIOBJ with the
default parameter values. If FILENAME does not include an extension,
then ‘.avi’ will be used.//可以只写文件名,省略后缀
Use AVIFILE/CLOSE to close the file opened by
AVIFILE. Use “clear mex” to close all open AVI files.
aviobj = avifile('video1(6).avi');%名字 aviobj.Quality = 100; aviobj.Fps = 6;%帧速率 aviobj.compression='None'; for i=1:29 ;%此处修改成自己的范围,起始位置 x=int2str(i);% fname=strcat('E:\d4-19-basic-0.0001\d4-19-basic-0.0001\',x,'.jpg') adata=imread(fname); aviobj = addframe(aviobj,uint8(adata)); end aviobj=close(aviobj);
以下是help matlab 对于avifile的解释:
AVIFILE Create a new AVI file
AVIOBJ = AVIFILE(FILENAME) creates an AVIFILE object AVIOBJ with the
default parameter values. If FILENAME does not include an extension,
then ‘.avi’ will be used.//可以只写文件名,省略后缀
Use AVIFILE/CLOSE to close the file opened by
AVIFILE. Use “clear mex” to close all open AVI files.
AVIOBJ = AVIFILE(FILENAME,'PropertyName',VALUE,'PropertyName',VALUE,...) returns an AVIFILE object with the specified property values. AVIFILE parameters **FPS** - The frames per second for the AVI movie. This parameter must be set before using ADDFRAME. The default is 15 fps. **COMPRESSION** - A string indicating the compressor to use. On UNIX, this value must be 'None'. Valid values for this parameter on Windows are 'Indeo3', 'Indeo5', 'Cinepak', 'MSVC', 'RLE' or 'None'. To use a custom compressor, the value can be the four character code as specified by the codec documentation. An error will result during the call to ADDFRAME if it can not find the specified custom compressor. This parameter must be set before using ADDFRAME. The default is 'Indeo5' on Windows and 'None' on UNIX. Note: Indeo5 may not be available in some versions of Windows. **QUALITY** - A number between 0 and 100. This parameter has no effect on uncompressed movies. This parameter must be set before using ADDFRAME. Higher quality numbers result in higher video quality and larger file sizes, where lower quality numbers result in lower video quality and smaller file sizes. The default is 75. **KEYFRAME** - For compressors that support temporal compression, this is the number of key frames per second. This parameter must be set before using ADDFRAME. The default is 2 key frames per second. **COLORMAP** - An M-by-3 matrix defining the colormap to be used for indexed AVI movies. M must be no greater than 256 (236 if using Indeo compression). This parameter must be set before calling ADDFRAME, unless you are using ADDFRAME with the MATLAB movie syntax. There is no default colormap. **VIDEONAME** - A descriptive name for the video stream. This parameter must be no greater than 64 characters long and must be set before using ADDFRAME. The default is the filename. AVIFILE properties may also be set using MATLAB structure syntax. For example, to set the Quality property to 100 use the following syntax: aviobj = avifile(filename); aviobj.Quality = 100; Example: t = linspace(0,2.5*pi,40); fact = 10*sin(t); fig=figure; aviobj = avifile('example.avi') [x,y,z] = peaks; for k=1:length(fact) h = surf(x,y,fact(k)*z); axis([-3 3 -3 3 -80 80]) axis off caxis([-90 90]) F = getframe(fig); aviobj = addframe(aviobj,F); end close(fig) aviobj = close(aviobj);
相关文章推荐
- matlab学习笔记(三)---图像的代数运算
- Sublime 中对 matlab 文件语法高亮(Highlighting)
- matlab使用
- matlab中save函数使用
- 探索MATLAB循环语句内部的变量
- matlab slider和edit控件
- 多项式拟合——用Matlab实现并分析
- Matlab中image、imagesc和imshow函数用法解析
- VLFeat和Piotr’s Image & Video Matlab Toolbox
- matlab连通域处理函数们
- matlab学习笔记(二)---三维图形的绘制
- Matlab 读取文件夹中所有的bmp文件
- matlab—元胞数组cell
- Eigen与Matlab函数对应
- Matlab 出现Undefined function '' for input arguments of type 'double'.解决方案
- matlab产生随机数列
- 安装Matlab小结
- MATLAB中cell array的全面介绍
- MATLAB 中 Wafo toolbox 移植
- 安装Matlab 7.0 步骤和常见问题