[FFmpeg-user] Converting 25fps 'PAL'-fast to 24fps cinema

markfilipak.imdb at gmail.com markfilipak.imdb at gmail.com
Tue Nov 7 13:03:00 EET 2023

The Windows CLI script below should be easy enough for Linux users to read. It converts 'PAL'-fast 
(or PAL speedup if you like) back to cinema. It is tested and known good.

set ITSSCALE=-itsscale 1.0416666666666666666666666666667
set SETTS=-bsf:v setts=time_base=1/90000:pts=N*90000/24:dts=N*90000/24
set ATEMPO=-af atempo=24/25
set CODE=-c:v copy -c:a ac3 -c:s copy
ffmpeg %ITSSCALE% -i %SOURCE% -map 0 %SETTS% %ATEMPO% %CODE% -dn -r 24 %TARGET%

1.0416666666666666666666666666667 = 25/24.
FFmpeg reports 25fps TARGET when it's actually 24fps. FFprobe & MPV both report 24fps.
Missing %ITSSCALE% causes subtitles to be early.
Missing %SETTS% provokes bogus 'Timestamps are unset' + 'pts has no value' warnings.
'N/TS/24' (instead of 'N*90000/24') provokes 'Non-monotonous DTS in output stream'.
Missing %ATEMPO% causes MPV's clock to speed up. A 20:08 video actually ends in 19:20!
Missing '-r 24' causes the TARGET to be 25fps despite the PTS changes.

The notes contain a lot of interesting stuff that could be/should be discussed. For example: Why 
would fast audio (no atempo) cause MPV's clock to run hot? Why/how is there no pitch change? Why is 
ffmpeg reporting 24fps video as 25fps? More...

More information about the ffmpeg-user mailing list