Live data from Hacker News

Making GIFs From Video Files With Python

zulko.github.io

31–40 of 44 posts

Re: Making GIFs From Video Files With Python

#31
post #14
post #9

Earlier quoted context omitted.

The same scripts will output videos for HTML5 if you replace the `to_gif` method by `to_videofile`: clip.to_videofile('animation.mp4') clip.to_videofile('animation.webm', codec='libvpx') clip.to_videofile('animation.ogv',codec='libtheora')

Can I make video/gif from multiple photos?

I haven't used this, but it looks like this might be what you're looking for [1]. Construct with a folder name and framerate and then use the to_videofile method.

https://github.com/Zulko/moviepy/blob/master/moviepy/video/i...

Re: Making GIFs From Video Files With Python

#32
post #16
post #14

Earlier quoted context omitted.

Can I make video/gif from multiple photos?

You can do that with ffmpeg or ImageMagick. Something like ffmpeg -i *.png output.gif You have options like delay, loop, etc.

Yep, that's how I do my gif conversions because it allows for much finer control, and often returns better results. I built an entire app around abstracting this technique: http://gifmachine.xwl.me/

Re: Making GIFs From Video Files With Python

#33
post #30

Anyone done a benchmark of this vs AVISynth? I have software I wrote in AVISynth for doing 2d to 3d Stereoscopic upconversion based on motion and parallax. I have often wished I had it in something more "real" like Python.

Have you tried VaporSynth? It's kind of a spiritual successor to AviSynth in the form of a Python module. Can even load AviSynth plugins.

Re: Making GIFs From Video Files With Python

#36

Please use silent HTML5 videos instead of animated GIFs wherever possible. They are much more bandwidth- and CPU-efficient. This site allows you to automatically upload/convert animated GIFs into that format: http://gfycat.com/ The links allow you to see the animated GIFs as well, if viewer's device doesn't support HTML5.

The problem, for me, is that HTML5 video is a technical solution with no social advantage. There are so many places on the web where images are allowed that videos will never be allowed -- for good reason. Forums, comment threads, etc. What we need is an image container format that allows for a silent (and only silent) video stream to be embedded. A better GIF. Something that site maintainers would feel entirely comf…

Why don't the powers that be make a new image animated image format that is bandwidth conservative? I don't get why Google/Apple/Microsoft/Adobe haven't jumped on this. Or maybe I do, they don't use animated GIFs. Fuck. If only Reddit/imgur/Internet forums had any lobbying power.

Re: Making GIFs From Video Files With Python

#37
post #15

Earlier quoted context omitted.

The problem, for me, is that HTML5 video is a technical solution with no social advantage. There are so many places on the web where images are allowed that videos will never be allowed -- for good reason. Forums, comment threads, etc. What we need is an image container format that allows for a silent (and only silent) video stream to be embedded. A better GIF. Something that site maintainers would feel entirely comf…

A new format would be overkill. Websites can just set the "muted" attribute on video elements. If you also set "loop" & "autoplay" and hide the controls, you've got a video that acts just like a GIF.

One problem is iOS devices won't play any videos with hidden controls.

Re: Making GIFs From Video Files With Python

#38

Please use silent HTML5 videos instead of animated GIFs wherever possible. They are much more bandwidth- and CPU-efficient. This site allows you to automatically upload/convert animated GIFs into that format: http://gfycat.com/ The links allow you to see the animated GIFs as well, if viewer's device doesn't support HTML5.

The problem, for me, is that HTML5 video is a technical solution with no social advantage. There are so many places on the web where images are allowed that videos will never be allowed -- for good reason. Forums, comment threads, etc. What we need is an image container format that allows for a silent (and only silent) video stream to be embedded. A better GIF. Something that site maintainers would feel entirely comf…

This! (Although if the sound thing is such a problem then perhaps the muted attribute should be set to true by the hosting site?)

Here's an idea: .

Updated semantics should be the same as the video tag.

Re: Making GIFs From Video Files With Python

#39
post #34

Isn't this overkill? You can get the exact same result with FFMPEG and a single shell command. Seems like a solution in search of a problem.

Can you easily integrate django with a shell command? Or with the python imgur image hosting? Easy online creation of gifs seems kind of useful.

Re: Making GIFs From Video Files With Python

#40
post #16
post #14

Earlier quoted context omitted.

Can I make video/gif from multiple photos?

You can do that with ffmpeg or ImageMagick. Something like ffmpeg -i *.png output.gif You have options like delay, loop, etc.

Yes, I guess I could figure out such options but let me explain what problem I have. I take multiple photos (e.g. my camera can take 10 photos per second) and want to make video from that. Gif is poor option as photos are taken with hand and are shaky a little bit. Gif will get big in size because of that alone. Video (e.g. webm) is very good alternative for that. Your project (?) offers option to add text (and other nice little details) and that makes it killer alternative.
Post reply on HN