7

I've found any number of commercial apps that can convert, e.g., 120fps "slow motion" videos to 30 fps by writing every n-th frame to a new video file. I was hoping that the usual freeware tools such as VLC or handbrake or ffmpeg could do this for me, but I admit to being unable to track down the commands to do so. I found any number of ways to export every n-th frame to a collection of image files, but I'd sure rather not have to do that and follow by merging hundreds or thousands of jpgs into a new video file.

I did find thistime-lapse answer which uses setpts so if that's all I need to do, please tell me (with or without the "you dope" part :-) ).

9

If you want to keep real-time i.e. 1 second of live action is played out in 1 second of video then

ffmpeg -i input.mp4 -r 30 output.mp4

This will drop 3 out of every 4 frames.

If you want to preserve all frames but cycle through them slowly then

ffmpeg -i input.mp4 -vf setpts=4*PTS -r 30 output.mp4
  • Thanks. Is this preferable to the long expression in superuser.com/questions/573747/… which uses a filter with select="mod(n-1\,2)" ? – Carl Witthoft Jan 11 '16 at 12:22
  • Unless the source video is variable frame rate, I would prefer my commands. – Gyan Jan 11 '16 at 12:32
  • 1
    Sadly, that first command line did not work - the output file was still in slo-motion - as you warned, it seems the input was considered to be variable frame rate, so the answer in your second line, but using setpts = PTS/4 converted my 120fps input to 30fps real-time output. – Carl Witthoft Jan 17 '16 at 16:06
  • For me, the second command doesn't preserve frames. I am trying to slowdown a 960fps video by encoding at 60fps, but I am getting a slow jerky video that clearly indicates that the frames are being dropped. – haridsv Oct 31 '16 at 14:33
  • Try ffmpeg -r 60 -i input.mp4 output.mp4 – Gyan Oct 31 '16 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.