Monday, 14 October 2013

Making an animation from a set of images in Powerpoint

If you have a set of images which shows how something changes with time, it is often useful to display them in rapid succesion in a presentation. If you're using LaTeX, I recommend looking into the Beamer class (search for "overlay" in the Beamer manual). However, this post is about PowerPoint.

Let's assume that you have three images, named im1.png, im2.png and im3.png, which are the same size. You want to start the slide by displaying im1, and then "overlay" im2 and im3 as you click the mouse or the right arrow button. One way to do this is to create a slide for im1, copy this twice, and inserting im2 and im3 in the two copies. However, this creates several nearly-identical slides, and you would probably also have to manually resize and position each image in the exact same location. If you have several images, this approach will be very time-consuming.

A better way is to add all the images to the same slide, and to display each one in turn using animations. You then want to add an animation for each image after the first one. For example, you import im1 to your slide, then import im2 and add "appear" as an animation, and repeat the same for im3. Pretty simple! The main annoyance here is that the images should be exactly the same size and in exactly the same position, to get the proper "animation" effect.

Rather than adjusting size and position for each image as you add it, you can first add all the images with animations, and then change size and position for all images simultaneously:

  • Add the images in the order in which they should be displayed. For every image after the first, add an "appear" animation
  • Select all the images by drawing a selection rectangle, right-click and choose "size and position" (or something like that, I currently have a Norwegian version of Powerpoint :)
  • Adjust the position. Since all the images are selected, they are now shifted to the same position (for example zero offset from upper left corner) and are perfectly overlapping. You can reposition the images later by selecting all and dragging them to a new position.
  • Adjust the size so that the images fit nicely on the page
With this approach you can make a 10-image animation in less than a minute. 

Wednesday, 27 February 2013

Merging two videos into a single video with side-by-side view using FFMPEG

I am currently evaluating lots of test videos, recorded at different conditions, and found myself wanting to display them both in a side-by-side view, in a single video. As always when it comes to video, I searched for a solution employing ffmpeg, and found a post on Stack Overflow describing almost exactly what I wanted to do. The post gives a demonstration example with scaling and fading of videos, so I had to simplify it to just

  • Pad the left video with extra space on the right, making space for the right video
  • Overlay the left and right videos, and output them to a single video file

This is the syntax I arrived at after some tweaking (all on a single line in the terminal):

ffmpeg.exe -i LeftInput.VOB -vf "[in] pad=2*iw:ih [left]; movie=RightInput.VOB [right]; 
[left][right] overlay=main_w/2:0 [out]" -b:v 3000k Output.mp4

Since I'm not a ffmpeg wizard, I won't claim to understand all the details of the line above. Hopefully, the syntax is (kind of) self-explanatory. However, note the "-b:v 3000k" parameter, which sets the bitrate of the output video to 3000kbits/second. This has to be adjusted in each individual case. 

Thursday, 24 January 2013

Upgrading to Subversion 1.7 in Ubuntu

Just a quick post this time. I recently had to upgrade the Subversion (SVN) software on my Ubuntu system to version 1.7. This version is (currently) not included in the regular Ubuntu distribution, but I found the solution in an Ubuntu forum thread - simply run this in a terminal:


echo "deb http://opensource.wandisco.com/ubuntu lucid svn17" | sudo tee /etc/apt/sources.list.d/svn.list
sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get dist-upgrade