Thu 29 Dec 2011 04:59:05 PM UTC, original submission:
I'm encountering a problem using aviread() to extract video frames from an h264 encoded .mp4 file. aviinfo() gives
Filename = C:\Temp\GH1.MP4
FileSize = 11853799
FileModDate = 19-Dec-2011 11:14:06
NumFrames = 32
FramesPerSecond = 59.940
Width = 1280
Height = 720
ImageType = truecolor
VideoCompression = h264
Quality = 100
NumColormapEntries = 0
AudioFormat = aac
AudioRate = 48000
NumAudioChannels = 2
This all looks correct except for the NumFrames parameter. The video is 18 seconds in length and therefore has about 18*60 = 1080 frames (file size = 11.3 MB). Is aviinfo() maybe returning the number of key frames rather than the total number of frames?
Anyway, on to the problem. When I read and display the first 5 frames with aviread(), what I see is the 1st frame repeated 4 times, followed by the 5th frame. It's as if aviread() is doing a coarse decimation rather than interpolating at the correct points in time. This happens regardless of what frame offset into the video stream I choose, not just at the start.
I should also mention that both QuickTime and VLC yield the correct results when scrolling this video frame by frame. I've heard that VLC also uses ffmpeg, so it would seem that the bug is unique to aviread() rather than a problem with ffmpeg.
If it's really necessary I could post the images which show the results I'm getting, but hopefully this description is good enough.
Octave 3.2.4 on Win7 64
video-1.0.2 package
|