Why do I receive an error when I use AVIREAD to read a MJPG compressed AVI file?
4 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2010-6-1
编辑: MathWorks Support Team
2022-5-25
When I try to read a MJPG compressed AVI file using AVIREAD, I receive the following error:
ERROR: ??? Unable to locate decompressor to decompress video stream
Error in ==> C:\Apps\matlab6p1\toolbox\matlab\iofun\private\readavi.dll
Error in ==> C:\Apps\matlab6p1\toolbox\matlab\iofun\aviread.m
On line 61 ==> X = readavi(filename,-1);
采纳的回答
MathWorks Support Team
2022-4-20
编辑:MathWorks Support Team
2022-5-25
The following documentation describes how a vision.VideoFileReader object can be used to read MJPG compressed AVI files.
Read video frames and audio samples from video file -
For previous product releases, read below for any possible workarounds:
MATLAB is not able to read MJPG compressed AVI files using the AVIREAD function.
The file cannot be decompressed since it is compressed using MJPG. Since the codecs used to compress the video are DirectShow compatible, AVIREAD will not be able to decompress this video, since AVIREAD uses Video For Windows (VFW), which is an earlier technology than DirectShow.
Some customers have reported limited success with the following possible workarounds:
1. There is a commercially available version of an MJPG decompressor that works with the older VFW technology used by AVIREAD. A free trial version of this codec can be downloaded here:
The full version of the decompressor requires purchasing it from Pegasus.
In some instances the colors may appear incorrect when using this decompressor. If you have run into this issue, then try swapping the R and B color plane using the following code:
m = aviread(filename);
for ii = 1:length(m)
m(ii).cdata = m(ii).cdata(:,:,[2 3 1]);
end
2. Another workaround is to convert the MJPG-file to an AVI-file using a conversion tool such as HandyAVI. The output movie is uncompressed, and MATLAB was able to read it. More information regarding this converter can be found at the following web address:
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!