Take a Gif!

Paint programs, vector editors, 3d modelers, animation editors, etc.
Message
Author
User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

Take a Gif!

#1 Post by fredx181 »

Take a Gif! (TKAGIF) a screencast/screenshot utility.

Edit 2020-05-17 attached v2.0, that has options for High, Medium and Low quality, more info here:
http://murga-linux.com/puppy/viewtopic. ... 41#1058241

Can be used to directly create a "visual how-to" animated .gif of the Desktop (or part), as seen sometimes on this forum (e.g. by Mike Walsh and myself)

This is a very much modified Take a Shot! by SFR (TAS) (as the name may suspect already).
The main difference is that this is much more focused on making an animated .gif screencast.
TAS can also make a GIF screencast, but not in a very advanced and/or easy way IMHO.

With 'Take a Gif' I tried to accomplish that the resulting .gif filesize is as small as possible but with reasonable quality.

Features:
- A checkbox for low quality .gif, depending on duration and scaling the resulting filesize can be less than 256K (so small enough to attach at this forum).
- Set duration
- When duration is set to 0, you can stop capturing manually by clicking a tiny X button at the far top-left of the screen
- With option "Region" you can draw a retangle, and will "show region" during the capture.
(this using "scrox" by William McEwan, it's included in the .pet attached).
- Included all the other options that TAS has (e.g. jpg, png format screenshot, include mouse pointer, etc..)
Note: After capturing to .gif, it may take some time to process (first captures to a temp. .mkv video, which will be converted to .gif, this is the best way to get small filesize .gif)

Requirements: ffmpeg (and scrox, as said, it's included).
I'm not sure if it works well with an old ffmpeg version
Tested on BusterPup and BionicPup

Many thanks to the author and contributers of TAS !!

Demo gif:
Image

Fred
Attachments
tkagif-2.0.pet
Take a Gif .pet package v2.0, added options for High, Medium and Low quality
(70.21 KiB) Downloaded 170 times
tkagif-v2.0.jpg
Take Gif v2.0 added options for High, Medium and Low quality
(45.42 KiB) Downloaded 174 times
tkagif-1.0.pet
Take a Gif .pet package v1.0
(69.94 KiB) Downloaded 180 times
Last edited by fredx181 on Sun 17 May 2020, 10:56, edited 3 times in total.

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#2 Post by puppyluvr »

:D Hello,
Great idea!
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...

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

#3 Post by Mike Walsh »

Hey, nice one, Fred..!

Works very sweetly in jrb's 'Quirky64-lite'. Mine's even more of a Frankenstein than the original; I've had to swap the Tahr64 ( k3.14.79 ) kernel for the Xenial64 one ( k4.9.58 ), in order for the audio in this modern HP Pavilion tower to be recognised.

I'm also running one of the 'standalone', statically-compiled ffmpeg packages from John van Sickle.....which perhaps helps. (Does GIF creation make use of ffmpeg? I suspect it does....)

Anyways; very nice too. I'll experiment a bit with it during the course of the day.

Cheers!


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#4 Post by fredx181 »

Hey Mike, glad it works for you. :)
I'm also running one of the 'standalone', statically-compiled ffmpeg packages from John van Sickle.....which perhaps helps. (Does GIF creation make use of ffmpeg? I suspect it does....)
Yes, it uses ffmpeg, and (as I wrote above), I'm not sure which version is required.
(the ffmpeg in Stretchpup, Busterpup and Bionicpup is new enough, that's all I know)

EDIT: Any suggestions for improval ?

Fred

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

#5 Post by Mike Walsh »

@ Fred:-

Quirky64-lite's "infocenter", just as a demo, like.....

[Click to enlarge:-]


Image


(You'll see there's a couple of screen-recorder apps here. Including Will's brilliant WeX, and RecordMyDesktop. That was only added last night; I had no end of fun getting this to run, 'cos I needed to import most of Tahr64's Python set-up to get this one working.....and track down some of the 'pyglib' items from /old-releases/ubuntu/pool, too!)

DogRadio works very sweetly here, too; DeaDBeeF is a 'no-go' in Quirky, for some reason. Segfaults like crazy....

And I prefer a single CPU readout in gKrellM. I don't need one for each of four cores, that's just overkill.....a general indication is all that's required.

Can't think of any 'improvements' ATM. But I may find some.... :lol:

(EDIT:- Hmm; not showing properly, for some reason. Now why is that? )

(EDIT2:- Seems to just be Firefox, for some reason. It's displaying fine in Opera... Ah, well.)


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#6 Post by fredx181 »

Mike Walsh wrote:(EDIT:- Hmm; not showing properly, for some reason. Now why is that? )

(EDIT2:- Seems to just be Firefox, for some reason. It's displaying fine in Opera... Ah, well.)
For me showing fine in Firefox, looks great!.
Well... now it's so super easy to make, we expect much more GIF visual how-to's from you in the future :lol: :wink:

Fred

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#7 Post by fredx181 »

Just see now this topic has been moved from Desktop to Graphics section, fine too, but can't see the reason why though.

Fred

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#8 Post by Flash »

Fred, I think most screen capture programs are in Graphics. It seems to me that's the first place anyone who's looking for a screen capture program would look. If you agree, I'll move Take a Shot to Graphics too. If you think I'm wrong, I'll move it back.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#9 Post by fredx181 »

Flash wrote:Fred, I think most screen capture programs are in Graphics. It seems to me that's the first place anyone who's looking for a screen capture program would look. If you agree, I'll move Take a Shot to Graphics too. If you think I'm wrong, I'll move it back.
Hi Flash, yes, ok it's fine for me that this topic is in Graphics now (in Desktop also fine, btw), about moving Take a Shot I'm not the one to agree or not, better ask SFR the author, I'd say.

Fred

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

#10 Post by Mike Walsh »

fredx181 wrote:Hey Mike, glad it works for you. :)
I'm also running one of the 'standalone', statically-compiled ffmpeg packages from John van Sickle.....which perhaps helps. (Does GIF creation make use of ffmpeg? I suspect it does....)
Yes, it uses ffmpeg, and (as I wrote above), I'm not sure which version is required.
(the ffmpeg in Stretchpup, Busterpup and Bionicpup is new enough, that's all I know)
Just as an aside, 'ffmpeg --version' in terminal returns v3.3.4 © 2017, so.....reasonably new, methinks. (Certainly new enough to run this A-OK, and definitely more up-to-date than Quirky's original. Puppy's ffmpeg has always been a 'stripped to the bones' minimal version; like, er, 209kb for the original, as against over 46 MB for this one. And that is 'stripped'.....)

Code: Select all

# ffmpeg --version
ffmpeg version 3.3.4-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.4.0 (Debian 6.4.0-4) 20170820
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
#




Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#11 Post by fredx181 »

Mike Walsh wrote:Puppy's ffmpeg has always been a 'stripped to the bones' minimal version; like, er, 209kb for the original, as against over 46 MB for this one. And that is 'stripped'.....
You can only make a fair comparison when you'd count also the size of all dependencies of the 209kb ffmpeg (dynamically linked), e.g. libavcodec, libavformat, etc.. which the static ffmpeg has builtin.

EDIT: to add: in fact using the static ffmpeg is a waste of space, because other programs (multimedia) depend on the ffmpeg libraries, so then these will be "double" installed.

Fred

User avatar
Makoto
Posts: 1665
Joined: Fri 04 Sep 2009, 01:30
Location: Out wandering... maybe.

#12 Post by Makoto »

Fred:

I know that's not optimal/ideal, but isn't it only really an issue if you're low on hard drive/pupsave space?

Just for fun, I took the latest static build from here, identifying as...

Code: Select all

ffmpeg version N-52056-ge5d25d1147-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2020 the FFmpeg developers
...and ran it through UPX.

Code: Select all

upx -9 ffmpeg
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2020
UPX 3.96        Markus Oberhumer, Laszlo Molnar & John Reiser   Jan 23rd 2020

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
  48154236 ->  17975176   37.33%   linux/i386    ffmpeg                        

Packed 1 file.
The result is an ~18MB binary that can still be executed. :D
[ Puppy 4.3.1 JP, Frugal install ] * [ XenialPup 7.5, Frugal install ] * [XenialPup 64 7.5, Frugal install] * [ 4GB RAM | 512MB swap ]
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).

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

#13 Post by Mike Walsh »

@ Makoto:-

Well; thanks very much for putting me onto that one, mate! It appears to work extremely well indeed.

I've just used it to compress the 46MB ffmpeg 3.3.4 I'm using in Quirky 64.....all the way down to just 15MB. And that's pretty impressive! I'd heard a lot about how good lzma compression is, but that's the first time I've experienced it for myself.....

Code: Select all

# /mnt/sdb2/WORK-1/upx /mnt/sdb2/WORK-1/ffmpeg
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2020
UPX 3.96        Markus Oberhumer, Laszlo Molnar & John Reiser   Jan 23rd 2020

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
  47388192 ->  14769500   31.17%   linux/amd64   ffmpeg                        

Packed 1 file.
#
-----------------------------------------------

I have to agree about the 'waste of space' mentioned by Fred NOT being such an issue for Puppians, however, compared to years ago. As we all replace our hardware over the years, invariably our resources become more plentiful. Witness my own case; the old Compaq tower had a very early 64-bit dual-core CPU, along with only 3 GB of DDR1 RAM. This new HP Pavilion 'mini-tower', conversely, has a modern quad-core processor, running at almost twice the speed, with far more advanced instruction sets; 8 GB of DDR4 RAM, and nearly 5 TB of storage. And by today's standards, that's considered distinctly average....really only a 'cooking' box. I may yet bump this up to 16 GB RAM.....prices are not so 'out-of-the-way' now, and where the old Athlon64 dual-core would have cost around GBP £750-800 when new, this Pentium 'Gold' currently retails for around £55-60.

That's progress, I guess. Anyway....

.....thanks again!

[EDIT:-] I'm going to post about this one. This is too good to pass up, given that many Puppians still are running some pretty elderly hardware.

"Utilities", I think...


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#14 Post by fredx181 »

Makoto wrote:The result is an ~18MB binary that can still be executed
Wow, that's indeed a big difference compared to 46 MB, thanks.
Yeah, disk space isn't much of an issue nowadays, however for some it may be one of the reasons to choose a small distro like Puppy.

Fred

User avatar
Makoto
Posts: 1665
Joined: Fri 04 Sep 2009, 01:30
Location: Out wandering... maybe.

#15 Post by Makoto »

Glad to be of some small help. :)

I've been using UPX since... I think the mid-90s (gah, has it really been THAT long? :shock: ), when hard drive space really was at a premium. Hadn't thought about how useful it might be for someone else, these days. :oops:
[ Puppy 4.3.1 JP, Frugal install ] * [ XenialPup 7.5, Frugal install ] * [XenialPup 64 7.5, Frugal install] * [ 4GB RAM | 512MB swap ]
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).

User avatar
icosahedron
Posts: 119
Joined: Mon 28 Nov 2011, 11:58
Location: UK

#16 Post by icosahedron »

Hi Fred,
Recently, I successfully converted a short MP4 video clip to a GIF using MT Paint. Fortunately, the clip was only two seconds long, because the process was very tedious and laborious, since I had to perform the whole process frame by frame, stepping the MP4 with frame-step and then using Take a Shot to capture the window each time, then I had to layer all the images up in MT Paint and create a composite animation.

Then I came here to see if there was an easier way to do this next time, and I found your Take a Gif. Maybe I should have come here first.

Anyhow, you were asking about improvements, so here's my user feedback:

The process with your app was much quicker, even though it took me fifteen to twenty 'takes' to get anything like a decent GIF, but it was still less accurate than the frame-by frame approach.

On Bionic 64 8.0 and your own portable Firefox (thankee kindly) Take a Gif worked a treat and gave me a quickie animation that would suffice for the purposes you state - a brief instructional snippet amongst friends - but doing the job frame by frame gave me a much slicker final product if finesse is a requisite.

The one difficulty I had with your app was trying to synchronize the start and stop times of both the video and the recording app at the same time, with a single mouse. Attempting two start commands and two stop commands in two seconds was interesting to say the least.

I felt like a rookie juggler, and even after umpteen takes I still had a glitch in it as a result of starting and stopping the process too early or too late. Trying to judge exactly when to hit the start and stop buttons to get a smooth loop is a nightmare. The discard feature is a real boon!

Unless, of course, I'm missing something. It wouldn't be the first time. After I poked about with your app, I noticed it had some form of timer on it. Maybe I could use that to synchronize the play and record? Maybe I'll poke about some more if I need another GIF.

Other than that, Take a Gif works very well, and it works in seconds. Great app, thanks.

Anybody know of an app to rip an MP4 into individual frames without taking screenshots?
Computers: - I just ride 'em, I dunno what makes 'em work.
Console/Terminal? What's that?
I visit the Internet to OBTAIN information, not to PROVIDE it! (Increase Internet Privacy)

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

#17 Post by Mike Walsh »

@ icosahedron:-

Fussy or not, I wouldn't worry too much about seamless, glitch-free operation of the final product. Witness the number of 'final cuts', published daily on t'web by supposed 'professionals' that still have noticeable glitches in them. If they don't care, there's very little point in concerning yourself too much with such nit-picking..!

Regardless of that; no, I don't know of an app that would literally break a video down into individual frames. However; you might be interested in taking a look at LosslessCut, a video-trimmer that is based around ffmpeg, and has, amongst other things, a very neat feature that will allow you to 'step' through a video frame-by-frame to find a specific point at which to 'cut' it.

This release is the newest - mi-fi is releasing new versions literally every 4-5 days - and 3.22.3, released just a couple of days ago, works a treat in Bionicpup64. This is an AppImage; you just download it, make it executable:-

Code: Select all

chmod +x
.....and simply click on it to run. The humungous size is due to its being an Electron-based app; these are written using the Electron framework, which in its turn is based around a stripped-down version of the Chromium browser.....

There are two types of AppImage; what I term the 'good' ones, and the 'lazy' ones. An AppImage is supposed to contain absolutely everything required for it to run (think Windows PortableApps. This is the Linux equivalent).

The 'lazy' ones are simply re-packed .debs or .rpms, and are still expecting to find a bunch of dependencies installed in the system. The 'good' ones are those that have been constructed correctly, and a click will run them almost anywhere.

LosslessCut is one of the 'good' ones..! This requires the

Code: Select all

--no-sandbox


.....'switch' appending before it will run, so I find it easiest just to put a wee script in /root/my-applications bin, then drag that to the desktop as a launcher.

/path/to/LosslessCut --no-sandbox

Entirely up to you, of course.


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#18 Post by fredx181 »

Hi icosahedron, thanks for your detailed reply, for now a quick response about how to get all frames from a video (I'll reply later about the other subjects you wrote, too late here now)
Simply use ffmpeg for to get all frames as images, from terminal e.g.:

Code: Select all

ffmpeg -i myvideo.mp4 out-%03d.jpg
And you get .jpg files starting with out-001.jpg, out-002.jpg, out-003.jpg etc...
I just tried that with a 3 min video and got almost 5000 .jpg images. :roll: :wink:

EDIT: Here' s discussion about more options:
https://stackoverflow.com/questions/109 ... ing-ffmpeg

Fred

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#19 Post by fredx181 »

icosahedron wrote:Anyhow, you were asking about improvements, so here's my user feedback:

The process with your app was much quicker, even though it took me fifteen to twenty 'takes' to get anything like a decent GIF, but it was still less accurate than the frame-by frame approach.


Hello again icosahedron, I'm not sure if it would help for you to get more accuracy, but anyway I made v2.0 with added quality options, radiobuttons High, Medium and Low.
High is 30 frames per second (with v1.0 it was 10 frames per second, so that's a big difference, I guess 30 would give a more accurate Start/Stop if duration .gif is set to 0 (manual stop))

tkagif-2.0.pet attached at first post.

EDIT: I think to get the most accurate start point is setting the Delay to 0, then it should start immediately after clicking the window or, in case of Region, after having drawed the rectangle.

Fred
Attachments
tkagif-v2.0.jpg
Take a Gif v2.0
(45.42 KiB) Downloaded 162 times

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

#20 Post by Mike Walsh »

@ Fred:-

Thanks for v2.0, mate. Nice one. Image


Mike. :wink:

Post Reply