joeycato
joeycato

Reputation: 128

Why doesn't extracting one second from a video at least result in a multiple of the frame time?

Trying to get a better understanding on why I'm unable to extract a segment from a movie clip with exact timing, even if I account for clip's frame rate.

For example, if I run the following command on a 29.97 fps video clip in an attempt to extract 1 second of video:

ffmpeg -i input.avi -ss 0 -t 1 -c:v huffyuv -an output.avi

the duration results in 1.001 seconds.

Now this would make more sense to me if the result was actually a multiple of 0.02997 seconds (29.97 fps / 1000 ms) but doing the math to check the multiples (0.02997, 0.05994, ..., 0.98901, 1.01898, 1.04895), I see that the closest multiple is actually be 1.01898 or 1.04895

What am I missing here?

Upvotes: 0

Views: 89

Answers (1)

Gyan
Gyan

Reputation: 93008

The exact framerate isn't 29.97, it's 30000/1001. So each frame has duration of 1001/30000s, so 30 frames at that rate take up 1001*30/30000 = 1.001 seconds.

Upvotes: 2

Related Questions