[英]Corruption when reading an H264 encoded video file in Matlab on MacOSX
I am attempting to read an H264 AVI file on OSX with Matlab, but it appears that the video is corrupted. 我正在尝试使用Matlab在OSX上读取H264 AVI文件,但似乎视频已损坏。 When I display the frame it appears that the image is segmented by vertical grey lines and I can see a segmented and faded version of the actual image data repeated 3 times within the same frame.
当我显示框架时,图像似乎被垂直的灰线分割,并且我可以看到在同一帧中重复了3次的实际图像数据的分割和褪色版本。 On my windows box I am able to read in the frame successfully without any issue using the same code/avi.
在我的Windows框上,我可以使用相同的代码/ avi成功读取框架,而不会出现任何问题。 Here are my specs:
这是我的规格:
Mac OSX 10.6.4
Matlab 7.8.0.347 (R2009a) Student Version
Quicktime 10.0 with Perian_1.2.1 codec plugin
AVI File:
H264
RGB24
640x480
60 Frames per second
Quicktime is able to successfully play the file with the Perian plugin. Quicktime可以使用Perian插件成功播放文件。
Here is the example code I am using to display the file: 这是我用来显示文件的示例代码:
o=mmreader(avi_file_name);
figure(1);
imshow(read ( vid_obj, k ));
Any ideas? 有任何想法吗?
Found a solution: 找到了解决方案:
Turned out it wasn't only H264 codecs that didn't work, I found a variety of formats that gave me the same output. 事实证明,不仅只有H264编解码器无法正常工作,我发现各种格式可以提供相同的输出。 However, downloading mmread instead of using mmreader fixed all of my issues:
但是,下载mmread而不是使用mmreader修复了我的所有问题:
http://www.mathworks.com/matlabcentral/fileexchange/8028 http://www.mathworks.com/matlabcentral/fileexchange/8028
Although, the mmread bug should probably still be addressed by MathWorks. 尽管mmread错误可能仍应由MathWorks解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.