[FFmpeg-trac] #10954(ffmpeg:new): ffmpeg should not round the frame rate from 23.976 fps to 23.98 fps

FFmpeg trac at avcodec.org
Fri Apr 12 18:19:18 EEST 2024


#10954: ffmpeg should not round the frame rate from 23.976 fps to 23.98 fps
-------------------------------------+-------------------------------------
             Reporter:  milahu       |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  minor        |                Component:  ffmpeg
              Version:  6.1.1        |               Resolution:
             Keywords:  framerate    |               Blocked By:
  rounding formatting                |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by milahu):

 > Why does this matter?

 i assume that "23.98 fps" is used for brevity,
 but it can be misleading for noobs like me...

 so either "~23.98 fps" or "24000/1001 fps" would be nice

 > 23.976 is not exact either

 aah, good to know.
 (sorry, i should have done my research.)

 > you should be using the output of ffprobe

 yepp, this works:

 {{{
 $ ffprobe -select_streams v -show_entries stream=avg_frame_rate -of csv
 src.mkv 2>/dev/null
 stream,24000/1001
 }}}

 > the real frame rate is 24000/1001

 {{{
 $ echo 'scale=24; 24000/1001' | bc
 23.976023976023976023976023
 }}}

 i have used the fps value for the atempo filter
 to convert audiotracks between movies with different framerates.

 example: convert tempo from 25fps to 23.976fps:

 {{{
 ffmpeg -i src.m4a -af atempo=23.976/25 dst.m4a
 }}}

 so the correct version would be

 {{{
 ffmpeg -i src.m4a -af atempo=24000/1001/25 dst.m4a
 }}}

 error versus 23.976 fps is 0.004 seconds per hour

 {{{
 $ echo 'scale=20; (((24000/1001)/23.976)-1)*3600' | bc
 .00360000360000356400
 }}}

 error versus 23.98 fps is 0.6 seconds per hour

 {{{
 $ echo 'scale=20; (((24000/1001)/23.98)-1)*3600' | bc
 -.59690101391519241600
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10954#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list