video – ffmpeg produces extra frames after halving the framerate

I have a question about halving the framerate of a video using ffmpeg.
I have an input video with a framerate of 50fps and 6410 frames, ffprobe output:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : M4V 
    minor_version   : 1
    compatible_brands: isomavc1mp42
    creation_time   : 2022-06-24T14:27:43.000000Z
  Duration: 00:02:08.20, start: 0.000000, bitrate: 12595 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 12202 kb/s, 50 fps, 50 tbr, 50k tbn, 100 tbc (default)
    Metadata:
      creation_time   : 2022-06-24T14:27:43.000000Z
      handler_name    : ETI ISO Video Media Handler
      vendor_id       : [0][0][0][0]
      encoder         : Elemental H.264
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 384 kb/s (default)
    Metadata:
      creation_time   : 2022-06-24T14:27:43.000000Z
      handler_name    : ETI ISO Audio Media Handler
      vendor_id       : [0][0][0][0]

I want to change this to 25fps using the following ffmpeg command:

ffmpeg -i input.mp4 -filter:v fps=25 25fps.mp4 

One would expect the amount of frames in the output to be half the frames of the input file, 3205. But this transcode results in 3206 frames.

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '25fps.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.76.100
  Duration: 00:02:08.24, start: 0.000000, bitrate: 3053 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 2917 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : ETI ISO Video Media Handler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : ETI ISO Audio Media Handler
      vendor_id       : [0][0][0][0]

How does this happen and why is there a frame extra?

Read more here: Source link