23

I've made a mistake and I need to re-encode video from 30 fps to 24fps, while maintaining the same speed/duration.

Does anyone know how I might do this in FFMPEG?

I've tried changing the -r value and this changes the rate, but changes the video length.

Thanks

beek
  • 355
  • 1
  • 2
  • 9

2 Answers2

20

To change the frame rate without modifying the total length of the video, FFmpeg has to duplicate or drop some frames. Unfortunately this process can turn a steady smooth movemen to become clumsy and unnatural in the video.

ffmpeg -i input.mov -r 24 -y output.mov

This method is very slow so be patient. The audio will remain the same, since length does not change.

You can also check this tool if your results are not what you expected: MVTools

Here is a thread that may be helpful Change framerate in ffmpeg without re-encoding

Divij Sehgal
  • 103
  • 3
Joe
  • 663
  • 5
  • 10
  • 4
    `-sameq` has been removed from `ffmpeg` a long time ago and [never meant "same quality"](http://ffmpeg.org/faq.html#Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f). For encoding with x264 use `-crf` instead. – llogan Mar 10 '17 at 06:52
  • 1
    Also, without using a filter, ffmpeg does not interpolate frames. It either duplicates or drops them. – Gyan Mar 10 '17 at 13:17
  • @Gyan You write 'It either duplicates or drops them.'. May I ask where you get this information? Because the process is taking awfully long for just duplicating or dropping frames. – Adriaan Jul 30 '20 at 08:31
  • In case it is not 'only' dropping frames or duplicating them, how do we ensure that the quality of the original video is conserved? – Adriaan Jul 30 '20 at 08:33
2

This command won't change the video playback speed:

ffmpeg -i <input> -filter:v fps=fps=30 <output>

Worked well for reducing fps from 59.6 to 30.

kelin
  • 123
  • 6