1

I have a whole bunch of sports video clips that range from 6 to 25 seconds each, all recorded at 240fps but slowed down to 23.97, 25, 29.97 and 30fps (so they're in super slow motion). I need to speed them back up.

I got the following command:

ffmpeg -i input.mov -vf "setpts=(PTS-STARTPTS)/10" -crf 18 output.mov

...from another stackexchange question.

I was able to use this successfully, but I have 3 questions:

1) How do I preserve all of the frames? The resulting video is only 30fps, which means the conversion process dropped the vast majority of frames - I'd like it to actually be a full 240fps.

2) Some of the videos were truncated at the end. For example, an 11 second video that originally showed an entire tennis forehand swing ends up stopping before the swing is completed.

3) I read the documentation for probably a good 30 minutes trying to figure out what "-crf 18" does and for the life of me couldn't - would love if someone could explain this!

1

Use

ffmpeg -i input.mov -vf "setpts=N/240/TB" -r 240 -crf 18 output.mov

The only thing the setpts filter does is retime frames, but the designated frame rate of the stream is still its original framerate, whatever that is (25,30..). Use the fps filter to change that - the fps filter may also drop or duplicate frames, but not in this case. There's a bug in the fps filter which makes it ineffectual for this purpose. Use output -r.

The default encoder for MOV in FFmpeg is libx264. Its default ratecontrol mode is CRF. Lower values retain more of the original quality but produce larger files - 18 to 28 is a decent range. This has no effect on which frames are included in your output.

  • Thanks so much Gyan! This works, except the resulting video is the same length as the original video. You see the 1-second tennis swing, and then 13 more seconds of the last frame frozen. – OstinatoFreak Oct 15 '18 at 1:29
  • Does this have audio? – Gyan Oct 15 '18 at 4:29
  • If someone could give just a little more help, I'd be so grateful. I went through the documentation for a half hour looking for things related to target video length, but I still have no idea how to tell ffmpeg to shorten the video length by the same proportion that it is sped up. Here is the old video: link Here is the new video: link This was using this command: ffmpeg - i inputfile -vf "setpts=(PTS-STARTPTS)/10" -crf 18 outputfile – OstinatoFreak Oct 15 '18 at 18:58
  • OMG I just now noticed you asked a question! No, I purposefully removed audio from the clips because it just isn't needed. I am hoping that simplifies things even more. So sorry for my newbieness here... I thought the "Does this have audio?" question was something generated by the StackExchange website asking me if I wanted to verbalize my comment or something. Sorry, very stupid on my part... – OstinatoFreak Oct 15 '18 at 19:04
  • Gyan you are my savior. <Kissing feet> I aspire to learn more about ffmpeg, but there appears to be a pretty high learning curve... wasn't possible to get this done any time soon without your help. – OstinatoFreak Oct 15 '18 at 19:10

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.