mismatch between calculated and reported Framerate using VideoReader
显示 更早的评论
I am trying to process video data (wmv format) recorded using a standard consumer grade camera using Matlab (R2014a, on Linux/Ubuntu) using VideoReader
vr = VideoReader('my_movie_file.wmv')
frames = read(vr); % read all frames
size(frames, 4) % gives 4025
vr.NumberOfFrames % gives 4025
vr.Duration % gives 134.7950
vr.FrameRate % gives 15
Now, this does not compute!
I.e,
round(vr.FrameRate*vr.Duration) % gives 2022,
which is half the size of vr.NumberOfFrames -- which means that the reported FrameRate is 1/2 the "calculated" value!
What am I missing?? All help will be appreciated.
5 个评论
Matthew Eicholtz
2016-3-22
I tried this with one of the built-in videos ('xylophone.mp4') and could not reproduce your error. Sorry.
KV
2016-3-22
Matthew Eicholtz
2016-3-22
I just tried it with a .wmv file I had on my machine and still had no problem.
Walter Roberson
2016-3-22
Is the file variable framerate? If so then the reported framerate might be the last one in the file (the one in effect at the time you queried)
KV
2016-3-23
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Video Formats and Interfaces 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!