How to make a GIF from a video clip in Puppy...

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

How to make a GIF from a video clip in Puppy...

#1 Post by Mike Walsh »

Evening, all.

Just a short 'How-to' for the budding artists among you, who'd like to cut a clip from a video file, and then turn it into a GIF file. This is partly done in Pup, and finished off on-line. Yes, you could use a command-line tool like Gifsicle, or ImageMagick, but since I'm absolutely rubbish at setting-up the multitude of command-line options and stanzas required, I'm focusing on what I consider to be an 'easier' method.

You'll need a video 'trimmer' (like Avidemux), or, which I think is easier to use, LosslessCut (as discovered by labbe5), and turned into Puppy packages by watchdog and myself at the end of that thread.

I prefer LosslessCut, because as greengeek pointed out, it has a very easy-to-use 'micro-stepper', which advances literally frame by frame; incredibly useful if you want to end up with a GIF which seamlessly loops round on itself, since you can use it to set the start and end points for the GIF exactly where you want them.

Once you've done that, use the location button, lower right, to specify where you want to save it; if you don't, it'll simply save the clip alongside the 'parent' video.

--------------------------------------------------------

Having done that, open your browser, and head on over to EZGif.com, and choose the 'Video to GIF' option. Out of all the GIF-making sites out there, this really is the simplest to use, with the best range of options. Just follow the simple instructions; the best option to use is Gifsicle, anyway; it's one of the tools used 'under the hood' by EZGif, and results in the smallest file size. Afterwards, you'll be prompted to 'optimize' the resulting GIF, which will reduce file size further.

If you want to crop or resize the GIF you've just created, it's best to do this in the options presented after you've created it. Again, instructions are very easy to follow. Once you've finished, save the finished GIF as soon as possible, because they only keep it on their servers for about an hour, tops.

Hope that perhaps helps some of you. Have fun!


Mike. :wink:

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#2 Post by slavvo67 »

Hi Mike:

I have a YAD script that uses ffmpeg in the background to create jpg snapshot photos. Not quite the same and I'm not sure how the quality compares but I thought I'd throw it out there....


Slavvo67

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#3 Post by wiak »

gifenc-yad script by our very own fredx181 (uses ffmpeg code from script he found on the web) has been available for a long time and works great.

You can find it here:

http://murga-linux.com/puppy/viewtopic. ... 724#948724

Actually, that link includes a nice animated gif (demo.gif), created by gifenc-yad (latest version called gifenc-sel), showing how to use it!

It's a tiny bash/yad program, which allows you to scale and also choose the animated gif quality.

gifenc-yad is a completely standalone program (and Fred also made a commandline version that doesn't even need yad) though weX bash/gtkdialog media recorder program can also use gifenc underneath for making animated gifs too:

http://www.murga-linux.com/puppy/viewto ... 694#989694

The LosslessCut info useful for any animated gif making tool of course, but LosslessCut is a rather large download (as big as an early Puppy, Mike?!) so some might prefer the tiny and simpler Start/Duration gifenc-yad method. One way of finding the Start point and Duration is to play video in mpv and watch the time axis presented. If you leave video on pause you can click through the video until you find the time start/end of the part of the video you want to create animate gif of. If the video is very small in size you might need to use the mpv --window-scale option to see things clearly enough. Not as nice as LosslessCut admittedly, but does the job for most simple needs and quite often we may not need to actually cut what we are recording before encoding to animated gif anyway. But still, at the end of the day it depends how powerful your system resources are - if you have plenty of space and want to 'best' then size really doesn't matter so the likes of LosslessCut and sophisticated video editing software would be the way to go.

wiak

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#4 Post by Mike Walsh »

Hi, wiak.
wiak wrote:But still, at the end of the day it depends how powerful your system resources are - if you have plenty of space and want to 'best' then size really doesn't matter so the likes of LosslessCut and sophisticated video editing software would be the way to go.
That, of course, is very true. I confess, I wasn't thinking about minimalist systems when I wrote the post. My own, well.....you can see the specs in my signature. Not hugely powerful, but she has a 64-bit dual-core CPU and 3GB of RAM. Not at all powerful by modern standards, but for Puppy, a nice system with resources to spare. And, er, quite a few TB of storage.

My trouble is I'm a dinosaur! I'm a hold-over from at least 20-odd years of continuous Windoze use; as such, I've always preferred GUIs, it's true. Mind you, my command-line skills are slowly improving.....but that stuff doesn't come naturally to me, unlike some guys on here..!

Fred does some marvellous work for Puppy; I've got his Google-Drive manager in all my Pups now. I guess the best (and leanest) Puppy apps tend to be written and/or compiled by those with low system resources themselves. Yes, I'm very much aware of the enormous size of LosslessCut; despite having room and to spare to work with it, even I find it hard to justify its use for the handful of functions provided. It's all that Electron 'back-end' & framework that pumps it up, as the example in my own post about it showed:-

http://www.murga-linux.com/puppy/viewto ... 835#986835

Where I do tend to be more creative about use of system resources is the old Dell lappie (which will be a grand old lady of 16 later this year). With a P4 and 1.5 GB, I'm rather more inventive about what gets used on there, and, as such, I do use a lot more Puppy-specific stuff.

I used Pup, originally, to bring the Dell back to life, and was so impressed with her, that she 'migrated' onto and took over the old Compaq desktop, too!

This was written, pretty much, for those with system resources to spare and who wanted an easy way to create GIFs from video clips (the really CPU-intensive bit, the actual conversion, is in this case using someone else's resources in the cloud). And this is the Puppy way, of course; all sorts of ways to do all kinds of things, catering for all shapes & sizes of systems.....


Mike. :wink:

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#5 Post by wiak »

Mike Walsh wrote: Where I do tend to be more creative about use of system resources is the old Dell lappie (which will be a grand old lady of 16 later this year). With a P4 and 1.5 GB, I'm rather more inventive about what gets used on there, and, as such, I do use a lot more Puppy-specific stuff.

I used Pup, originally, to bring the Dell back to life, and was so impressed with her, that she 'migrated' onto and took over the old Compaq desktop, too
Yes, but it is fair to say (I often think it too) that as time goes by even the most stubborn of us gradually retire some of our older systems. Even quite old computers have a couple of GB of RAM nowadays and storage size costs tumble constantly. Question might be why we still try to build tiny do-as-much-as-possible Linux distributions, though certainly the size of even Pups is gradually creeping up; impossible not to - the browsers get bigger and bigger, the GUI widget libraries move from GTK1 to GTK2 to GTK3 or Qt latest. One day soon 70 or 80 MB download for an app will be considered fine or even small... and it is when compared to the price/size of hard disks nowadays. Why do some of us love being so 'frugal' when it is becoming so difficult to realistically compete against the all-singing-dancing alternatives?

As for software frameworks like Electron - they are truly ingenious and amazing - make cross-platform coding much easier, and thus really important, but yes, there are always costs - otherwise I'd be suggesting "bring back assembler, or even machine-code..." - even in the embedded world things have moved on. Did I really just read that Skype is using it??? ;-)

wiak

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#6 Post by greengeek »

Just found this possible method using command line:

Code: Select all

ffmpeg -i video.avi -t 10 out%02d.gif

then

gifsicle --delay=10 --loop *.gif > anim.gif
Seems to work for me.
(Think I got gifenc from one of fredx posts a while ago)

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#7 Post by Mike Walsh »

Hi, wiak.
wiak wrote:As for software frameworks like Electron - they are truly ingenious and amazing - make cross-platform coding much easier, and thus really important, but yes, there are always costs - otherwise I'd be suggesting "bring back assembler, or even machine-code..." - even in the embedded world things have moved on. Did I really just read that Skype is using it??? :wink:
Hah! Yep, I'm pretty sure you did. It's the main reason why the web interface, and that of the current 64-bit only 'Skype 4 Linux' are identical. The new client is essentially the web-page on your desktop..!!

Of course, if you regularly use Chromium-based browsers, like me, you can achieve the same thing by turning the 'Skype4Web' page into an app, and running it on your desktop like that. To all intents & puposes, it would be the same thing, since they both use the same identical 'back-end' nowadays.

This is the way more and more apps are heading.....and, as you say, it does ensure cross-platform compatibility. Really, all you need these days is a good, up-to-date modern browser...

D'you know, wiak, you've just given me an idea. That's what I will do. I've written a number of small scripts and desktop entries for running various Chrome/Chromium web-pages as desktop apps. I shall do the same thing with 'Skype4Web'. As I said, the web-app is identical to the current Linux client in appearance and functionality. I know it's not as good as the old 4.3 Qt client, which, lacking in development though it was, most of us had gotten rather used to.....but it's still way better than that abomination they've now foisted on Windows users. Have you seen it? It's like a cross between Whatsapp & Kik.....and it is horrible.

Watch this space..!


Mike. :wink:


Mike.

Post Reply