From a time in a video, can you get the frame number?

9 次查看(过去 30 天)
I want to know what frame number we have from a video at certain time stamps. For example from 1:42 to 1:45 mark. How do I obtain this?
  2 个评论
Mathieu NOE
Mathieu NOE 2025-4-1
hello
I suppose that you know the total number of frames and the start / end time stamps
then it's just a matter of linear interpolation
Walter Roberson
Walter Roberson 2025-4-1
Knowing the total number of frames and the total video length and the start and end time stamps... assumes constant video frame timing.
If you do assume constant frame rate, then converting timestamp to frame number becomes possible by using the FrameRate property. However, if the frame rate is nominally 30 frames per second then the true frame rate might only be 29.97 frames per second, and it is questionable as to whether the header video frame rate will be 30/1 or 2997/100 or 30000/1001

请先登录,再进行评论。

回答(1 个)

SACHIN KHANDELWAL
SACHIN KHANDELWAL 2025-4-23
Assuming that you want to get the number of frames in a video file using MATLAB, the following MATLAB Answers posts might be helpful for you:
Also, check out the official documentation for: https://www.mathworks.com/help/matlab/ref/videoreader.html
If this does not resolve the issue, could you please include your files and a more detailed problem statement? This will help in providing a more specific solution.

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by