VideoReader framerate is not matching total number of frames

11 Ansichten (letzte 30 Tage)
Hazem
Hazem am 7 Nov. 2014
Kommentiert: Walter Roberson am 31 Jan. 2018
I use VideoReader command to find the frames per second (FPS) for a recorded video
Obj=VideoReader('Movie1');
Here are some of the data of interest I get
Obj.Duration=120.9370 % total video duration
Obj.FrameRate=29.4492 % Frame rate Meta data
Obj.NumberOfFrames=3552 % Total frames
The problem is that the
Obj.FrameRate=29.4492 is not equal to
Obj.NumberOfFrames/Obj.Duration=29.3707.
This difference is very significant for my problem,so
1- Which value is more reliable?
2- What is the reason behind this inconsistency?
Many Thanks,

Antworten (2)

Tommaso Lucarelli
Tommaso Lucarelli am 19 Dez. 2016
Hello Hazem,
I'm working on a project and I have found exactly the same issue, I'm facing this problem and I don't know how to find a solution.
Did you find a way to fix it at the end? This difference is very significant for my problem.
Thanks a lot, have a nice evening,
Tommaso

Kris Fedorenko
Kris Fedorenko am 31 Jan. 2018
I believe "FrameRate" is not guaranteed to be constant throughout the playback. This should give you a more accurate value:
vobj = VideoReader('mymovie.avi');
numFrames =vobj.NumberOfFrames
vobj = VideoReader('mymovie.avi'); % need to re-instantiate after computing NumberOfFrames
  1 Kommentar
Walter Roberson
Walter Roberson am 31 Jan. 2018
NumberOfFrames is estimated from the known duration and initial frame rate, and is known to have round-off problems even for fixed framerate images.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by