mercredi 10 juillet 2019

HTML5 Video's frame rate compared to the video's original one

I strive to find out the proper way to handle the following problem:

The Problem:

My app displays a video and simultaneously takes photos of the user through his/her web camera. The problem is how to map each image with the appropriate frame of the video.

My Solution:

When an image is available, the current frame number is calculated using the following formula:

frameNumber = Math.floor(videoRef.currentTime * fps);

The fps variable is the video's original frame rate.

The Question:

Obviously, my assumption is that the original frame rate of the video is the same as the frame rate of the HTML video element. Is that true though?




Aucun commentaire:

Enregistrer un commentaire