VideoReader.getFileFormats
VideoReader
支持的文件格式
说明
示例
查看在您的系统上 VideoReader
支持的文件格式列表。
fmts = VideoReader.getFileFormats()
Video File Formats: .avi - AVI File .mj2 - Motion JPEG2000 .ogg - OGG File .ogv - OGG Video
此输出适用于某特定 Linux® 系统。您的结果可能有所不同。
检查 VideoReader
是否可在当前系统上读取 AVI 文件。
fmtList = VideoReader.getFileFormats(); if any(ismember({fmtList.Extension},'avi')) disp('VideoReader can read AVI files on this system.'); else disp('VideoReader cannot read AVI files on this system.'); end
VideoReader can read AVI files on this system.
创建一个允许用户以交互方式选择视频文件的对话框。
获取受支持的文件格式。
formats = VideoReader.getFileFormats()
Video File Formats: .asf - ASF File .avi - AVI File .m4v - MPEG-4 Video .mj2 - Motion JPEG2000 .mov - QuickTime movie .mp4 - MPEG-4 .mpg - MPEG-1 .wmv - Windows Media Video
此输出适用于 Windows® 系统。您的结果可能有所不同。
将 formats
数组转换为过滤器列表。
filterSpec = getFilterSpec(formats)
filterSpec = 10×2 cell array {'*.asf;*.avi;*.m4v;*.mj2;*.mov;*.mp4;*.mpg;*.wmv;'} {'All Video Files' } {'*.asf' } {'ASF File (*.asf)' } {'*.avi' } {'AVI File (*.avi)' } {'*.m4v' } {'MPEG-4 Video (*.m4v)' } {'*.mj2' } {'Motion JPEG2000 (*.mj2)' } {'*.mov' } {'QuickTime movie (*.mov)' } {'*.mp4' } {'MPEG-4 (*.mp4)' } {'*.mpg' } {'MPEG-1 (*.mpg)' } {'*.wmv' } {'Windows Media Video (*.wmv)'} {'*.*' } {'All Files (*.*)' }
filterSpec
是一个元胞数组,其中第一行包含 'All Video Files'
,最后一行包含 'All Files (*.*)'
。
使用 uigetfile
创建对话框。
[filename,pathname] = uigetfile(filterSpec);
输出参量
支持的视频文件格式,以具有如下属性的 audiovideo.FileFormatInfo
对象数组的形式返回。
Extension | 文件扩展名。 |
Description | 文件格式的文本描述。 |
ContainsVideo | 逻辑值,指示 VideoReader 是否可读取此格式的视频。 |
ContainsAudio | 逻辑值,指示 VideoReader 是否可读取此格式的音频。 |
VideoReader
无法始终读取特定视频文件,即使 getFileFormats
列出其格式也是如此。有关详细信息,请参阅支持的视频文件格式。
在 Windows 和 UNIX® 系统上,文件格式列表并不总是包含 VideoReader
可在您的系统上读取的所有格式。getFileFormats
返回 VideoReader
可在多数系统上读取的与平台相关的静态格式列表。
版本历史记录
在 R2010b 中推出
另请参阅
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)