24小时热门版块排行榜    

查看: 506  |  回复: 2

朱易理工

新虫 (初入文坛)

[求助] piotr的工具箱里的video文件夹里的 seqIo 这个函数怎么用啊???我想将avi转换成seq

如题
这个 怎么弄?

function out = seqIo( fName, action, varargin )

switch lower(action)
  case {'reader','r'}, out = reader( fName, varargin{:} );
  case {'writer','w'}, out = writer( fName, varargin{:} );
  case 'getinfo', out = getInfo( fName );
  case 'crop', crop( fName, varargin{:} ); out=1;
  case 'toimgs', out = toImgs( fName, varargin{:} );
  case 'frimgs', frImgs( fName, varargin{:} ); out=1;
  case 'convert', convert( fName, varargin{:} ); out=1;
  case 'newheader', newHeader( fName, varargin{:} ); out=1;
  case {'readerdual','rdual'}, out=readerDual(fName,varargin{:});
  otherwise, error('seqIo unknown action: ''%s''',action);
end
end
***********************************************************************

function frImgs( fName, info, varargin )
% Create seq file from an array or directory of images or from an AVI file.
%
% For info, if converting from array, only codec (e.g., 'jpg') and fps must
% be specified while width and height and determined automatically. If
% converting from AVI, fps is also determined automatically.
%
% USAGE
%  seqIo( fName, 'frImgs', info, varargin )
%
% INPUTS
%  fName      - seq file name
%  info       - defines codec, etc, see seqIo>writer
%  varargin   - additional params (struct or name/value pairs)
%   .aviName    - [] if specified create seq from avi file
%   .Is         - [] if specified create seq from image array
%   .sDir       - [] source directory
%   .skip       - [1] skip between frames
%   .name       - ['I'] base name of images
%   .nDigits    - [5] number of digits for filename index
%   .f0         - [0] first frame to read
%   .f1         - [10^6] last frame to read
%
% OUTPUTS
%
% EXAMPLE
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

朱易理工

新虫 (初入文坛)

seqIo>writer


  Create interface sw for writing seq files.

  Create interface sw to seq file with the following commands:
   sw.close();              % Close seq file (sw is useless after).
   sw.addframe(I,[ts]);     % Writes video frame (and timestamp)
   sw.addframeb(bytes);     % Writes video frame with no encoding.
   info = sw.getinfo();     % Return struct with info about video.

  The following params must be specified in struct 'info' upon opening:
   width          - frame width
   height         - frame height
   fps            - frames per second
   quality        - [80] compression quality (0 to 100)
   codec          - string representing codec, options include:
    'monoraw'/'imageFormat100'      - black/white uncompressed
    'raw'/'imageFormat200'          - color (BGR) uncompressed
    'monojpg'/'imageFormat102'      - black/white jpg compressed
    'jpg'/'imageFormat201'          - color jpg compressed
    'monopng'/'imageFormat001'      - black/white png compressed
    'png'/'imageFormat002'          - color png compressed

  USAGE
   sw = seqIo( fName, 'writer', info )

  INPUTS
   fName  - seq file name
   info   - see above

  OUTPUTS
   sw     - interface for writing seq file
2楼2015-01-20 20:29:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

朱易理工

新虫 (初入文坛)

kabaisun: 屏蔽内容 2015-01-22 15:52:22
本帖内容被屏蔽

3楼2015-01-22 15:02:31
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 朱易理工 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 不应该看fileCode +5 且听虎啸 2026-08-12 6/300 2026-08-12 16:26 by Tide man
[基金申请] FileCode能看出啥? +8 要乐观耀哥 2026-08-10 21/1050 2026-08-12 16:08 by 云上清扬
[基金申请] 长年满屏的广告,版主太不责任了。基金也等的急 +4 gltch 2026-08-12 4/200 2026-08-12 16:08 by eulota
[基金申请] filecode +13 documentary 2026-08-10 15/750 2026-08-12 15:56 by 云上清扬
[基金申请] 奇怪,两个人的filecode固定段从头到尾一模一样 +7 布布和一二 2026-08-10 10/500 2026-08-12 09:12 by 布布和一二
[基金申请] 综述论文作为代表作会不会影响评审专家的印象分? +11 yufeiwaner 2026-08-09 13/650 2026-08-12 08:17 by yufeiwaner
[基金申请] 是这周出结果还是下周出结果? +3 yuleib84 2026-08-11 3/150 2026-08-11 21:53 by jnhyjjm
[基金申请] 小木虫上这么多卖论文的,真有人买论文么?感觉没必要啊 +8 Tide man 2026-08-10 9/450 2026-08-11 20:39 by beefly
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[基金申请] 什么时候出结果,有咨询渠道??? +3 Tide man 2026-08-11 3/150 2026-08-11 17:54 by kudofaye
[基金申请] 基金中了 +15 laoda193707 2026-08-06 15/750 2026-08-11 00:11 by jiafei2190
[基金申请] 2026国自然放榜时间 +9 布布和一二 2026-08-08 9/450 2026-08-10 11:22 by xxxx2020
[基金申请] 这样的filecode谁见过 +11 布布和一二 2026-08-08 22/1100 2026-08-10 11:10 by wmfsnow
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
[基金申请] filecode与中标关系的预测 +5 布布和一二 2026-08-07 5/250 2026-08-09 16:15 by 袁向阳007
[基金申请] fileCode有新解读? +10 Tide man 2026-08-08 18/900 2026-08-09 12:55 by 仁砚薪传
[基金申请] 关于豆爷回答的JTJC与%2F数量 +5 yang182083 2026-08-06 7/350 2026-08-08 18:29 by zhanghaozhu
[基金申请] 关于filecode +4 布布和一二 2026-08-07 7/350 2026-08-07 22:55 by zhanghaozhu
[基金申请] 化学口download_prp&fileCode的固定段好像这几天一直没变,有变的大神么? +3 Tide man 2026-08-07 4/200 2026-08-07 22:39 by Tide man
[基金申请] 固定端突然变了,今天 +6 archvillain 2026-08-06 10/500 2026-08-07 16:03 by 医学老男孩
信息提示
请填处理意见