How to get 1 frame per second in ffmpeg video to images? Getting more images than expected

  ffmpeg, image, python, video

I am trying to extract images from a video 1 frame per second but i am getting more images than i expect.

for eg.:

When i run below command:

ffmpeg -i filename.mp4 -r 1 img%d.jpg

It is a 20 second video but creating 22 images.

it should create 21 images.

Why it is creating one extra image?

Source: Python Questions