7

I have a 30 fps video with a GOP 30 (1 i-frame per second). I'd like to create a version that is '30x faster', by dropping all frames except every 30th frame. I can do that as so:

ffmpeg  -i t1.mp4 -filter:v "setpts=.033333*PTS" f6.mp4

It creates the desired output, but it runs slow, and uses a lot of CPU. I presume this is because it is stepping through all the frames and decoding each one before throwing away 29/30 of them.

Is there a way to instruct ffmpeg to create a '[GOP]x faster' video using only the key frames, so that it need only decode the i-frames?

I'd also like it to do no transcode of the iframes - same size, etc. I don't mind what the GOP of the output video is.

thanks

1 Answer 1

8

For a H264/5 stream, this can be done in two steps:

ffmpeg -discard nokey -i t1.mp4 -c copy t1.264

ffmpeg -r 30 -i t1.264 -c copy t1keys.mp4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.