Path: news.mathworks.com!not-for-mail
From: "Kevin Christie" <kwchrist@uiuc.edu>
Newsgroups: comp.soft-sys.matlab
Subject: mmreader reaching premature EOF on Quicktime files
Date: Fri, 9 May 2008 22:56:03 +0000 (UTC)
Organization: University of Illinois
Lines: 34
Message-ID: <g02kq3$nov$1@fred.mathworks.com>
Reply-To: "Kevin Christie" <kwchrist@uiuc.edu>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210373763 24351 172.30.248.37 (9 May 2008 22:56:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 9 May 2008 22:56:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1381865
Xref: news.mathworks.com comp.soft-sys.matlab:467656


I'm currently using mmreader to open video files of animal
movements to perform tracking and analysis. I'm using the
latest version of MATLAB R2008a on a Power Mac with OSX. My
video files are 640x480 encoded in QT with H.265 using the
Compressor program with a framerate of 29.97. 

The problem I'm having is that sporadically when I attempt
to grab a frame with the statement:

image = read(movie_obj, frame_index);

sometimes I get an error claiming that mmreader attempted to
read a frame beyond the end of the movie, which isn't true.
Incrementing the index to frame_index + 1 or frame_index -1
works perfectly. 

For a given movie file, it seems 1 or 2 frames per every
1000 or so will not work. I've loaded the movie file into
multiple video editing programs, including Adobe Premiere
and Final Cut Pro, and these have no problems reading the
'problem' frames - the data exists, but for some reason,
mmreader cannot read it. 

Has anyone else had problems like this? I'm not familiar
with the internals of how video data and frames are
represented in .mov files. I'm not sure of the 29.97 fps
value may have something to do with it - but I don't see why
the framerate would be necessary to the read() function. It
is important that I can solve this issue - conversion to
another file format is not an option, I have GBs of video
and QT has the best file size/video clarity ratio of any of
the formats I've tested.

Kevin Christie