I have a video that is initially 19 frames long and lasts for about 0.5 seconds, it's 432kB.

I've looped it over three minutes and the resulting file is quite large (200MB).

Using FFMPEG is there a parameter of libx264 I can change to efficiently compress these 19 frames being looped rather than it being 3 minutes of unique frames?

So far I've tried increasing the keyframe interval to 1000 but it didn't help too much.

ffmpeg -i input.mp4 -c:v libx264 -g 1000 output.mp4

  • The encoder analyzes input one frame at a time, also taking into account its close neighbours. It doesn't see the looping at the macro level.
    – Gyan
    Sep 17, 2019 at 20:26


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.

Browse other questions tagged or ask your own question.