VideoReader problem - Xvid video compression
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a video which is compressed using the xvid video compressor. I am using the VideoReader function to open the file and am processing video frame by frame. Unfortunately, I have found that with the xvid compressed video every second frame is green. On doing some testing, I found that it isn't the actual frame in the file that is incorrect and it is something to do with reading the movie object. For instance, if I read the same frame consecutively, the first time I read it the image comes out as expected and the second time I read the same frame, the image comes out with all pixels green. Is this a bug in VideoReader? I am using a Mac operating system, but have tested this and found the same problem in both Windows 32 and 64 bit.
Details on the file are as follows -
General Settings:
Duration = 11.6117
Name = test.avi
Path = /Users/GL/Documents/Data
Tag =
Type = VideoReader
UserData = []
Video Settings:
BitsPerPixel = 24
FrameRate = 81.5559
Height = 544
NumberOfFrames = 947
VideoFormat = RGB24
Width = 768
0 Kommentare
Antworten (1)
Shawn Fernandes
am 27 Mär. 2018
Hi,
You would have to make use of the while loop with the 'hasFrame' and 'readFrame' option.
movie = VideoReader('test.avi');
i=1;
while hasFrame(movie)
video_data(i).cdata = readFrame(movie);
i=i+1;
end
Reference : https://www.mathworks.com/help/matlab/ref/videoreader.readframe.html
Tested on Matlab 2018a Windows 10.
Note: Installed ffdshow and x264 codecs separetely
https://sourceforge.net/projects/ffdshow-tryout/
https://sourceforge.net/projects/x264vfw/
2 Kommentare
Walter Roberson
am 27 Mär. 2018
Did you test with an xvid video specifically?
Note: back when the question was asked in 2012, readFrame() did not exist; it was added in R2014b.
Shawn Fernandes
am 28 Mär. 2018
Hi Walter,
This is the screenshot of the video file player when played on VLC player.
Thanks,
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!