Why do I receive an error when I use AVIREAD to read a MJPG compressed AVI file?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 1 Juin 2010
Modifié(e) : MathWorks Support Team
le 25 Mai 2022
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);
Réponse acceptée
MathWorks Support Team
le 20 Avr 2022
Modifié(e) : MathWorks Support Team
le 25 Mai 2022
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Audio and Video Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!