Speed Up Video

Questions involving a Windows version of FFmpeg.
Post Reply
mikeiz
Posts: 6
Joined: Mon Mar 04, 2013 10:26 pm

Speed Up Video

Post by mikeiz » Mon Oct 21, 2019 8:13 pm

I want to speed up a video sequence from 30 fps to 60 fps, but keep the number of frames the same. I used the command:

# ffmpeg -i infile.avi-vcodec rawvideo -filter:v "setpts=0.833*PTS" -r 60 -an -y outfile.avi

The infile.avi number of input frames is 334 and the duration is 11.13 sec. The outfile.avi number of frames is 555 and the duration is 9.25 sec. I'm not sure why this is happening. What I want is for the outfile to be 334 frames with a duration of 5.565 sec.

pandy
Posts: 255
Joined: Mon Feb 24, 2014 1:46 pm

Re: Speed Up Video

Post by pandy » Tue Oct 22, 2019 4:00 pm

perhaps? (not tested)

Code: Select all

ffmpeg -r 60 -i infile.avi -vcodec rawvideo -y outfile.avi

Reino
Posts: 91
Joined: Thu Aug 22, 2013 5:14 pm
Contact:

Re: Speed Up Video

Post by Reino » Wed Oct 23, 2019 9:48 pm

mikeiz wrote:
Mon Oct 21, 2019 8:13 pm
The outfile.avi number of frames is 555 and the duration is 9.25 sec. I'm not sure why this is happening.
It's the result of setpts=0.833*PTS. I don't understand how you came up with 0.833.

Code: Select all

ffmpeg -i input.avi -lavfi setpts=0.5*PTS -r 60 -c:v rawvideo output.avi
This should do the trick. Also see How to speed up / slow down a video.

mikeiz
Posts: 6
Joined: Mon Mar 04, 2013 10:26 pm

Re: Speed Up Video

Post by mikeiz » Thu Oct 24, 2019 12:14 am

I need to get 60 fps and the input video is 50 fps. So, 50/60 is 0.8333.

Mike

pandy
Posts: 255
Joined: Mon Feb 24, 2014 1:46 pm

Re: Speed Up Video

Post by pandy » Fri Oct 25, 2019 4:30 pm

mikeiz wrote:
Thu Oct 24, 2019 12:14 am
I need to get 60 fps and the input video is 50 fps. So, 50/60 is 0.8333.

Mike
Nope 50/60=0.833333333333333333333333333333333333333333... this is important
use 'setpts=(50.0/60.0)*PTS'

Reino
Posts: 91
Joined: Thu Aug 22, 2013 5:14 pm
Contact:

Re: Speed Up Video

Post by Reino » Sat Oct 26, 2019 1:35 pm

mikeiz wrote:
Thu Oct 24, 2019 12:14 am
I need to get 60 fps and the input video is 50 fps. So, 50/60 is 0.8333.
Well, that's very confusing, because in your first post you said: "I want to speed up a video sequence from 30 fps to 60 fps". Please make up your mind.
In that case 11.13s * 5 / 6 = 9.275s is exactly what you get with setpts=(5/6)*PTS.
mikeiz wrote:
Mon Oct 21, 2019 8:13 pm
What I want is for the outfile to be 334 frames with a duration of 5.565 sec.

Code: Select all

-lavfi setpts=0.5*PTS -r 60

Post Reply
'