convert high -speed video to normal by subsampling frames

6,852

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
Share:
6,852

Related videos on Youtube

Carl Witthoft
Author by

Carl Witthoft

Resume at http://witthoft.com/resume Physicist, Photonics and Radar Engineer, cellist, R-evangelist, pinball fanatic, xkcd follower. And owner of "Hells Doggies," one wonderful Papillon and two incredibly sweet motley mutts. https://github.com/cellocgw for various R- code tools and toys.

Updated on September 18, 2022

Comments

  • Carl Witthoft
    Carl Witthoft almost 2 years

    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 :-) ).

  • Carl Witthoft
    Carl Witthoft over 8 years
    Thanks. Is this preferable to the long expression in superuser.com/questions/573747/… which uses a filter with select="mod(n-1\,2)" ?
  • Gyan
    Gyan over 8 years
    Unless the source video is variable frame rate, I would prefer my commands.
  • Carl Witthoft
    Carl Witthoft over 8 years
    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.
  • haridsv
    haridsv over 7 years
    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.
  • Gyan
    Gyan over 7 years
    Try ffmpeg -r 60 -i input.mp4 output.mp4