question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

write_gif() output file size is large

See original GitHub issue

converted a first 10 seconds of a clip(50 mb) with write_gif() gave me a 46 mb gif

clip = VideoFileClip("input.mp4").subclip('2:09:05', '2:09:17')
video = CompositeVideoClip([clip])
video.write_gif("output.gif", program='ffmpeg', fps=clip.fps)

i also test imageio but that is worse, gave me 76 mb

  • Python Version: 3.6
  • Moviepy Version: 0.2.3.2
  • Platform Name: windows 10

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dheerajmpaicommented, Dec 12, 2019

Using ffmpeg instead of imageio can significantly reduce the file size For a seven second gif I got the following results.

ffmpeg : 19MB imageio : 39MB

Code used

gif_clip.write_gif('gif_clip.gif',fps=25,program= 'ffmpeg')

gif_clip.write_gif('gif_clip_imageio.gif',fps=25,program= 'imageio')
0reactions
keikorocommented, Oct 11, 2022

Closing this issue as it’s old and hasn’t seen any response from OP in several years, and people have responded to other commenters in the thread with potential solutions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WriteGif.java - Project Nayuki
GIF image file writer * * * Converts an input image file to an output GIF file, ... LZW encoding is used, which...
Read more >
Output files are too large - Movavi Support
Output files are too large · Please note, that file size depends on many factors like resolution, duration, bitrate, compression ratio, and codec ......
Read more >
GIF Output - LibGD
gdImageGifPtr stores the image in a large array of bytes. Parameters. im, The image to write. outFile, The FILE pointer to write the...
Read more >
https://www.digiater.nl/openvms/freeware/v20/xv310...
xvgifwr.c - handles writing of GIF files. based on flgife.c and * flgifc.c ... FatalError("Unable to malloc in WriteGIF()"); rmap = rtemp; gmap...
Read more >
Programmatically generate video or animated GIF in Python?
GIF" writeGif(filename, images, duration=0.2) #54 frames written # #Process ... im is your original image frames = [frame.copy() for frame in ImageSequence.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found