6 ms·
I would suggest ffmpeg as an alternative -- it peels, it slices and it dices. It will definitely convert a range of a video file to gif while adding subtitles,
by btbuildem 13y ago
I would suggest ffmpeg as an alternative -- it peels, it slices and it dices. It will definitely convert a range of a video file to gif while adding subtitles, and you won't have to frankenstein things together..
- sigil 13y agoTotally agree, although the author's use of vlc definitely qualifies as a clever hack. I want more hackers to realize how insanely easy it is to programmatically generate video with ffmpeg. Just write a program that dumps raw RGB frames to stdout! You can turn that into any video format conceivable, including gif. Here's a little demo I wrote. Generates a video of the Mandelbrot set coming into focus: https://github.com/acg/generating-video-demo https://github.com/acg/generating-video-demo Example gif: http://imgur.com/RiqEHJJ http://imgur.com/RiqEHJJ
- goostavos 13y agoInteresting! At work I hacked together a video writer that compiles still frames to a movie using OpenCV. But it is slow --ungodly slow. I'll have to check out ffmpeg!
- sigil 13y agoTry this: ffmpeg -i frame%04d.png -vcodec mjpeg -sameq test.avi
- unlikelymordant 13y agoIf I wanted to strip the audio into a big wav or mp3 file, how would that be done?
- lelandbatey 13y agoIndeed, I have to vouch for ffmpeg as a the best solution. When I built GifMachine[0], it's pretty much just a web interface and automation layer to ffmpeg/imagemagick. Imagemagic and ffmpeg I found to be easy to use, fast, and delightfully scriptable. Using them together also produces the prettiest results. For example, here's a gif produced with just ffmpeg: http://i.imgur.com/DWc4OdD.gif http://i.imgur.com/DWc4OdD.gif And here is the version produced by ImageMagick: http://i.imgur.com/OdojPSo.gif http://i.imgur.com/OdojPSo.gif While the one made using ImageMagick looks better, it's also less compressed and takes up more space. So it's a tradeoff between the two. [0] http://gifmachine.xwl.me/ http://gifmachine.xwl.me/
- sixothree 13y agoI have to ask. What the heck is that gif from?
- lelandbatey 13y agoIt's rather late to be posting this, but the gif is from this music video: Duke Dumont - Need U @ 1:42 http://www.youtube.com/watch?feature=player_detailpage&v=FnJIb4A-DuY#t=102 http://www.youtube.com/watch?feature=player_detailpage&v=FnJ...
- oakwhiz 13y agoavconv seems to be more up-to-date than ffmpeg.
- chewxy 13y agogstreamer too can be used. I prefer gstreamer as it really does embody the unix philosophy (in its own weird way though)
- sejje 13y agoI'm unfamiliar with gstreamer. Can you elaborate on this weird way?
- gosub 13y agoThe arguments to the gstreamer binary are encoders,decoders,filters and i/o piped together like commands in a shell (with the ! operator). For example, this is a shell command to show a h264 network stream on a raspberry pi: gst-launch-1.0 rtspsrc location=rtsp://192.168.2.112:8080/stream.sdp ! rtph264depay ! h264parse ! omxh264dec ! autovideosink Gstreamer is more than this, but it'is a neat example.
- mtrimpe 13y agoThere's even this (awesome) guide on optimizing video to gif conversion with ffmpeg and ImageMagick: http://blog.room208.org/post/48793543478 http://blog.room208.org/post/48793543478 The file size reduction was quite impressive for our use case (roughly 10x smaller.) In the end we did decide that while putting 5 second video intros in emails is cool, a 200k image is still a bit much for mobile users.
- tene 13y ago> putting 5 second video intros in emails is cool You must have a very different experience of email than I do. That sounds absolutely terrible to me. Am I missing some reason that this would be useful, or is this just a case of wildly diverging preferences?
- mtrimpe 13y agoI meant 'cool' more as in 'hack-value'. Our product (Interactly) is virtual video interactions, so our main value prop is being able to see real people respond. In that context we figured it would be interesting to see if we could include a 5 second GIF intro right into the notification email; mostly out of curiosity just to see if it would technically be possible. I was surprised to find out it was mostly feasible, but you're right that it doesn't make sense beyond the fact that it would be a cool gimmick.
- tene 13y agoOh. That's totally reasonable. Cool, thanks.