Matlab:使用VideoFileReader/setup时出错 [英] Matlab: Error using VideoFileReader/setup

查看:259
本文介绍了Matlab:使用VideoFileReader/setup时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码:

h = vision.VideoFileReader('num2.avi')

h = 
System: vision.VideoFileReader
Properties:
             Filename: '/Users/LoFe/Documents/BME/Work/Work/Work/num2.avi'
            PlayCount: Inf                                                
      ImageColorSpace: 'RGB'                                              
  VideoOutputDataType: 'single'  

它运作良好,但是当我想踩一下它时,我得到了:

It is working well, but when I want to call step on it, i get this:

while ~isDone(h)
    hFrame = step(h);
end

Error using VideoFileReader/setup
Could not open the specified file.

Error in
/Applications/MATLAB_R2013a.app/toolbox/matlab/system/+matlab/+system/+mixin   
/FiniteSource.p>FiniteSource.isDone
(line 39) 

我在OS X(小牛)上使用MATLAB 2013a,该怎么办?在Windows 7上运行正常.

I'm using MATLAB 2013a, on OS X (Mavericks), what should I do? It is working fine on Windows 7.

推荐答案

正如我们在评论中所讨论的,Mac上可能不支持用于对视频进行编码的编解码器.对于MATLAB,在Mac和Windows之间,CVST视频阅读器可以读取的受支持编解码器有所不同.

As we discussed in the comments, the codec that was used to encode the video is may not supported on your Mac. For MATLAB, the supported codecs that the CVST video reader can read in are different between Mac and Windows.

这样,请尝试将视频重新编码为Mac固有的格式,例如QuickTime电影文件或MP4文件. HandBrake 是为您执行此操作的理想工具.

As such, try re-encoding your video into a format that is native to the Mac, like a QuickTime movie file, or an MP4 file. HandBrake is a perfect tool to do this for you.

此外,也许尝试使用MATLAB的本机VideoReader类来查看是否可以读取文件并提取视频帧.请查看其文档以了解更多详细信息: http://mathworks.com/help /matlab/ref/videoreader-class.html .

Also, perhaps try using MATLAB's native VideoReader class to see if you can read the file and extract video frames. Take a look at its documentation for more details: http://mathworks.com/help/matlab/ref/videoreader-class.html.

但是,您似乎已解决了该错误,因为可以将其转换为QuickTime电影文件.

However, it looks like you have resolved the error, as converting it to a QuickTime movie file worked.

很高兴我可以帮忙!

这篇关于Matlab:使用VideoFileReader/setup时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆