之前通过下面的代码读取,没有错误:
videoObj = VideoReader('..\..\dataset\smoke-detection\ForestSmoke\Smoke_Manavgat_Raw.avi');
numFrames = get(videoObj, 'NumberOfFrames');
后来在安装了一堆其他软件之后,特别是安装完美解码之后,就产生Warning: Unable to determine the number of frames in this file的警告,参考[1][2]给出了一种解决方法:
frame=read(obj,inf);
obj.NumberOfFrames
是通过读取最后一帧图像来确定的,但是当视频有点长的时候,确定这最后一帧就会特别慢。
在我运行程序之前
在我点击运行中断后:
这个LAV是一个什么东西?
我想大概就是这个LAV Splitter影响了Matlab,因此只需关闭它既可。找了好久发现在在完美解码的设置里面可以关掉:
这个分离器对AVI格式默认的是LAV,需要改回system既可。然后在运行matlab,就不会产生Warning: Unable to determine the number of frames in this file了,
参考:
【1】matlab VideoReader Warning: Unable to determine the&nb http://blog.sina.com.cn/s/blog_6051d8810101js31.html
【2】Thread Subject: Video info for non-AVI's http://www.mathworks.com/matlabcentral/newsreader/view_thread/139245