Speed up video with FFmpeg with low I-frame distance

1

1

I got a video with 60 fps and h264 encoded (.mp4), audio layer is removed. Now I want to speed up the video 4x faster with FFmpeg, but I would like to have a very low I-frame distance to be able to perform very precise and fast seeking. I don't need a high compression. Does someone has an idea how I could achieve that?

Thanks in advance.

kchromik

Posted 2014-05-06T05:52:53.347

Reputation: 143

Answers

4

You can use the setpts video filter to change speed and the -g option to set your group of picture size:

ffmpeg -i input -vf setpts=PTS/4 -g 25 output.mp4

You did not specify your I-frame distance, so I used the arbitrary value of 25.

llogan

Posted 2014-05-06T05:52:53.347

Reputation: 31 929

The I-frame distance should be as short as possible, in order to perform precise seeking. Is 25 enough, or should I go with a lower distance? As I said, I don't need to care about file size. – kchromik – 2014-05-07T05:53:06.690

@kcpac Then you can set it to 1 – that should work. – slhck – 2014-05-07T06:22:46.853

@slhck Does it mean, that my video will consist only of I-frames? – kchromik – 2014-05-07T06:36:45.627

1@kcpac Exactly. – slhck – 2014-05-07T07:38:29.000