How to make an animated gif from an video in Linux

First you will want to trip your video to the length you need, best to do this in openshot or something. More than a few seconds of video will end up being much larger gif than most will watch 🙂

 

# Make sure the right tools are installed
apt-get install ffmpeg imagemagick gifsicle # or the equivalent yum/etc
# make a temp directory/folder
mkdir /tmp/gifconvert
# dump 10 frames a second to a temp folder (you can change the size output here too)
ffmpeg -i toycars.mp4  -r 10  /tmp/gifconvert/out%04d.gif 
# Recombine them into a gif
gifsicle --delay=10 --loop /tmp/gifconvert/*.gif > animation.gif

animated gif
If you want to have it go forwards, then reverse, so it appears to be continuous you can change the gifsicle line to go like this (ignore the black border, exported the video wrong from openshot :))

ls -v /tmp/gifconvert/*.gif >/tmp/gif-list
ls -vr /tmp/gifconvert/*.gif >>/tmp/gif-list
gifsicle --delay=10 --loop `cat /tmp/gif-list` >testani.gif

shortanirev gif
 

All images and the original video come from this amazingly awesome vine video https://vine.co/v/blrW6wMzEpa

Trying to start a female robotics team, and upgrade the guys parts

Recently I have been helping out my sons Robotics team at the local high school, and its been great fun. They use a product called Vex, mostly because other schools do, and it means we are able to enter competitions and compete against other schools. Having a goal in mind for creating a robot is always an excellent motivator, especially when you can compete against others, take it back, adjust and modify, then go back every couple weeks and do it again.

The games they play in these scrimmages are changed every year as well which keeps the fun in it, and you find everyone finds their role that they are good at (driving, assembly, logistics, planning, etc).

Currently though, the team lacks enough gear to cater to the people wanting to join, in particular we would love to encourage more female members and perhaps setup a female team as well as give the guys team more parts since its larger.

Since the school as a set budget, I have taken it on myself to fund raise for this myself. I know I have a bit of tech following, so i figure why not see if other females in tech and people interested in robotics or tech will help?

So i set up a page on givealittle which charges 0% fees (unlike others) and have already raised a bit of money, In fact, i am quiet looking forward to being able to recruit more people! If you think you can help out at all, please donate, even if its a small amount!

My costs are as follows

  • $1300 for a beginner competition kit for the girls team
  • $700 + to get more parts for the guys team (they already have a beginner comp kit)
  • Any spare can either get more parts in general, or go into a wearable tech class i plan to start (to encourage more girls into technology!)

You can measure your work hours with a time card calculator and generate a time card for your payroll purposes.

 


New Camera – Canon EOS 650D (aka Kiss X6i) – Linux and pink ufraw fun!

I was super happy to recently upgrade to the new Canon 650D. Waited for them to arrive in the country, and the right deal before the purchase.
I happily snapped pics and video all the way home, boy was i impressed. The shutter speed was almost twice the speed of my old 450D, and the video spectacular.
I got home, plugged in the SD card to my laptop, and …..AHHHHHHHHHHHHHHHHHHHHHHHHHH PINK!

A Quick google shoes that the pink overlay created by dcraw and ufraw . I the latest version of dcraw easily compiled and had the problems fixed, no major deal. It was a single dcraw.cc and easily compiled.

However, in saying that, i generally use ufraw due to ufraw-batch due to more options and previously posted HDR script, so i was a bit disappointed that there was no patch.
So i downloaded the code for ufraw-0.18 , grepped for strings, found some entries for similar cameras, duplicated the settings. I then checked images for unique identifiers and updated with the correct values. A Couple of compiles later and i have a working ufraw !

Anyway, after all that, i found the cvs version of ufraw now has it patched already, so bit of wasted time, but in case anyone else wants a working copy here is my one http://lizquilty.com/uploads/ufraw-0.18-650D.tar.gz
This is compiled on/for 64bit machine, so if you are using otherwise you will need to recompile. If you are running debian you will need to run this to compile

apt-get install libgtk2.0-dev liblcms-dev libgimp2.0-dev libtiff-dev libjpeg62-dev libpng12-dev libexiv2-dev zlib1g-dev libbz2-dev libgtkimageview-dev

Untar, cd ufraw-18-650D/ ; ./configure && make ; ./ufraw file.CR2 . Once that is going just replace the system copy (or make install?)

More instructions at http://ufraw.sourceforge.net/Install.html

Update:

In case you have a Canon camera and need to add support, its fairly easy. Basically it needs to be told to decode it as a CR2 and what default settings.
Grab a copy of the source, and edit dcraw.cc . Search for a string for a camera similar to your own, i used the Canon 550D, so searched for 550D. You will find code that looks like this

{ "Canon EOS 550D", 0, 0x3dd7,
{ 6941,-1164,-857,-3825,11597,2534,-416,1540,6039 } },

This is the default make/model/and a few other settings shown from above it. Copy/paste the lines changing the model (you can tweak them later if you think they are vastly wrong)

Further down you will see

} else if (is_canon && raw_width == 5344) {
top_margin = 51;
left_margin = 142;
if (unique_id == 0x80000270)
adobe_coeff ("Canon","EOS 550D");
goto canon_cr2;
} else if ....

Again, copy/paste a new else if statement, change the model number. The raw_width/margins/unique_id are in a photo you can get off your camera. Use exiftool to grab the exif data from an image and replace it with the correct items. The main thing to get right is the unique_id .

Save and exit that file now and open up wb_presets.c . Again search for the model similar to your own and you will find something similar to this
{ "Canon", "EOS 550D", Daylight, 0, { 2.1426, 1, 1.5488, 0 } },
{ "Canon", "EOS 550D", Shade, 0, { 2.4619, 1, 1.3193, 0 } },
{ "Canon", "EOS 550D", Cloudy, 0, { 2.3066, 1, 1.4258, 0 } },
{ "Canon", "EOS 550D", Tungsten, 0, { 1.5264, 1, 2.3428, 0 } },
{ "Canon", "EOS 550D", WhiteFluorescent, 0, { 1.9072, 1, 2.1973, 0 } },
{ "Canon", "EOS 550D", Flash, 0, { 2.3701, 1, 1.4141, 0 } },

These are just the white balance for different settings based on the camera, feel free to adjust or use them however you want, it may take a recompile or two to get it right. Make sure you change the model name!
Once that is done, compile! that was all there was too it.