2012-09-28

Encode image sequence to MPEG4 video

Today something very simple: use ffmpeg to encode an image sequence as a MPEG4 video:

ffmpeg -f image2 -i filename-%04d.png -vcodec mpeg4 -b 6000k output.mp4

I often use blender or custom software to render out a bunch of images. Blender usually names output files filename-0000.png, where 0000 is the frame number.  So ffmpeg can generate those filenames with the usual printf style format. You can of course tweak ffmpeg's output via a myriad of options. But this here will simply generate a 25fps mpeg4 file, which is easily embedded for example into your Keynote presentation. On OS X you can get ffmpeg for example via MacPorts: sudo port install ffmpeg, and Linux distros usually have a package for ffmpeg as well.

2012-09-08

Using Ctrl+Arrow keys in the OS X terminal

The key combination Ctrl + left or right arrow key can be used to go a word left or right in many programs such as GNU Emacs or the bash. In the default configuration of the OS X terminal, this is not the case. That's because Terminal.app sends the wrong key codes for bash's default configuration. So you just need to got to the preferences (cmd+,) and set the key codes for Ctrl+left and right to \033b and \033f respectively: