Unable to determine the codec required.

I am using 2013a version of matlab and windows xp.When i run the code of videoreader i get this error.So what type of codec needs to be installed.
obj.reader = vision.VideoFileReader('atrium.avi');
obj.videoPlayer = vision.VideoPlayer();
obj.maskPlayer = vision.VideoPlayer();
obj.detector = vision.ForegroundDetector('NumGaussians', 3, 'NumTrainingFrames', 40, 'MinimumBackgroundRatio', 0.7);
obj.blobAnalyser = vision.BlobAnalysis('BoundingBoxOutputPort', true,'AreaOutputPort', true, 'CentroidOutputPort', true,'MinimumBlobArea', 400);

Antworten (2)

Mrutyunjaya Hiremath
Mrutyunjaya Hiremath am 23 Apr. 2020
Bearbeitet: Mrutyunjaya Hiremath am 24 Apr. 2020

1 Stimme

Hello,
To solve the problem, I installed 'Media Player Codec Pack' and use the following code.
vidObj = VideoReader('VideoFile.mp4');
read(vidObj);
get(vidObj)
currFrame = read(vidObj, 10);
vidFrames = read(vidObj,[100 Inf]);
vidFrames = read(vidObj,[18 27]);
The above problem solved in 2014b with 'readFrame' and 'hasFrame' functions.
currAxes = axes;
while hasFrame(vidObj)
vidFrame = readFrame(vidObj);
image(vidFrame, 'Parent', currAxes);
currAxes.Visible = 'off';
pause(1/vidObj.FrameRate);
end
Thank you.

3 Kommentare

Kai Hillers
Kai Hillers am 29 Jul. 2021
where did you find this 'Media Player Codec Pack'? I can't find it on the AddOn section of MatLab.
Kind regards,
Kai
Walter Roberson
Walter Roberson am 29 Jul. 2021
https://www.mediaplayercodecpack.com/ for Media Player Codec Pack
xingxingcui
xingxingcui am 29 Jan. 2023
Bearbeitet: xingxingcui am 29 Jan. 2023

Melden Sie sich an, um zu kommentieren.

Walter Roberson
Walter Roberson am 23 Mai 2015
Bearbeitet: Walter Roberson am 23 Mai 2015

0 Stimmen

info = mmfileinfo('atrium.avi');
and examine
info.video.Format
Also, try
aviinfo('atrium.avi')
and if the command is found in your version of MATLAB (it was scheduled to be removed) then look at the VideoCompression field of the output of it.
Let us know what the results are.
See also https://www.raymond.cc/blog/determine-audio-video-codec-required-to-play-downloaded-movies/ and find a tool for your computer that will tell you which codec was used.
Note: if the codec shows up as Indeo5 then it is not readable with any 64 bit version of MATLAB (which is due to decisions made by the manufacturers of the Indeo5 codec)

3 Kommentare

B.k Sumedha
B.k Sumedha am 23 Mai 2015
Error using mmfileinfo (line 71) Could not get file information.
Got this when i tried info = mmfileinfo('atrium.avi');
Walter Roberson
Walter Roberson am 23 Mai 2015
Were you able to use aviinfo()? Were you able to find a program for your system such as one of the ones suggested by the blog link I included?
Image Analyst
Image Analyst am 23 Mai 2015
Can you even play this file with Window Media Player? If you can't even do that, then it's not really a MATLAB question yet.

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 23 Mai 2015

Bearbeitet:

am 29 Jan. 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by