<p>Use</p>

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

<p>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..). <s>Use the fps filter to change that - the fps filter may also drop or duplicate frames, but not in this case.</s> There's a bug in the fps filter which makes it ineffectual for this purpose. Use output <code>-r</code>.</p>

<p>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. </p>

CC BY-SA 4.0
2018-10-15T01:29:21.013Z
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
CC BY-SA 4.0
2018-10-15T04:29:02.240Z
Does this have audio?
Gyan
CC BY-SA 4.0
2018-10-15T18:58:39.080Z
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](https://www.dropbox.com/s/w9c3vykgfwnhn82/oldvideo.mp4?dl=0)

Here is the new video:
[link](https://www.dropbox.com/s/tiio2jkhzvwpmpk/newvideo.mp4?dl=0)

This was using this command:
`ffmpeg - i inputfile -vf "setpts=(PTS-STARTPTS)/10" -crf 18 outputfile`
OstinatoFreak
CC BY-SA 4.0
2018-10-15T19:04:14.340Z
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
CC BY-SA 4.0
2018-10-15T19:10:57.127Z
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
CC BY-SA 4.0
2018-10-14T04:35:06.517Z
2018-10-15T19:04:02.820Z
2018-10-15T19:04:02.820Z
Gyan
<p>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.</p>

<p>I got the following command:</p>

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

<p>...from another stackexchange question.</p>

<p>I was able to use this successfully, but I have 3 questions:</p>

<p>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.</p>

<p>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.</p>

<p>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!</p>

<ffmpeg><framerate>
How do I speed up slower video framerates with ffmpeg and get full 240fps and no truncated videos?
OstinatoFreak
# How do I speed up slower video framerates with ffmpeg and get full 240fps and no truncated videos?

(Asked by: username_0 on 2018-10-13)

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!

**Tags:** ffmpeg, framerate


---

## 1 answers

### Answer by username_1 on 2018-10-14. Score: 1 | Accepted answer

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.

> **Comments:**
> **username_0**: Thanks so much username_1! 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.  
> **username_1**: Does this have audio?  
> **username_0**: 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](https://www.dropbox.com/s/w9c3vykgfwnhn82/oldvideo.mp4?dl=0)  Here is the new video: [link](https://www.dropbox.com/s/tiio2jkhzvwpmpk/newvideo.mp4?dl=0)  This was using this command: `ffmpeg - i inputfile -vf "setpts=(PTS-STARTPTS)/10" -crf 18 outputfile`  
> **username_0**: 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...  
> **username_0**: username_1 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.  

---

