0

I have tried to generate a simple GIF file from this video. My code is below:

from moviepy.editor import *
clip = (VideoFileClip("Mighty Kungfu Panda 'Skadoosh'.mp4").subclip((0,0.18),(0,0.21)).resize(0.3))
clip.write_gif("skadoosh2.gif")

But GIF is not generating properly. All i can see, an image of the starting scene of the clip. I have tried different parameters with subclip(). But the result has remained same.

ni8mr
  • 1,725
  • 3
  • 31
  • 58

1 Answers1

2

The problem is that 0.18 and 0.21 refer to fractions of seconds, so you are asking for a clip of duration 0.03 !!

Instead, if you want the clip between t=18s and t=21s, use subclip(18, 21)

Zulko
  • 3,540
  • 1
  • 22
  • 18
  • thanks my problem is solved. And extra thanks to answer this question personally, as you are the creator of Moviepy. :) – ni8mr Sep 06 '15 at 16:08