What causes the difference between HTML5 video metadata reading and commercial products?

389 Views Asked by At

When using Premiere Pro I have a file that is 2:45:23 seconds, 4973 frames at a 29.97fps rate.

When loading the same file using JavaScript and video.duration I get rounded 166 seconds using Math.round (3 min 16seconds) which using simple logic here (I'm not good at math to begin with) gives me (166seconds * 29.97fps) = 4975 frames.

Part of me wants to say this is due to some header frames storing the metadata that Premiere strips out, but I'm actually curious as to the loss of precision.

Any accurate idea?

1

There are 1 best solutions below

3
On

The problem is a rounding error -- since the 166 second time is not precise, the number of frames you compute from it is not, either.