2012-07-09

Creating Timelapse Videos with a Webcam

Last week I had some fun creating timelapse videos using just an inexpensive webcam and a laptop. Timelapse videos are a nice way to visualize processes which are otherwise to slow to observe directly (eg. the movement of clouds or the growth of plants). Technically the the solution to all the world's problems seem to be little Python scripts, which can be downloaded here. ;)
For simplicity a lot of things are hardcoded in these scripts, so you most certainly have to make changes. The scripts should be easy to understand, as they are quite short and simple. However if anything is unclear, just drop me a comment.

timelapse.py, timelapse_copy.py

timelapse.py uses ffmpeg for capturing images from the webcam (support for v4l assumed). You do not need this script, if you have any other means of acquiring the individual frames. The filenames of the acquired images contain a consecutive nr. and the time and date when the image was taken. Unfortunately it turned out later that times and dates in the filename confuse ffmpeg and have to stripped away to join the individual frames to a single video file. Besides the nr. needs to have leading zeros. The timelapse_copy.py script was made to compensate for that.


timelapse_filter.py

As mentioned before, an inexpensive webcam was used for simplicity. Therefore a Gimp plugin is used to sharpen and denoise the pictures a little. The script uses Gimp and the package gimp-plugin-registry (for the wavelet denoise). You can skip this step if you have a good camera or are not willing to wait, because the filtering can take quite some time, depending on which filtering operations you want to run on the individual frames. Do not forget to copy this script to ~/.gimp-2.6/plug-ins and to make it executable.

timelapse_ffmpeg.py

A third script creates a video from the filtered images again using ffmpeg.

2012-07-04

Überweisungsträger bedrucken (German)

Die Großmutter bedruckt nach Großmutters Art Überweisungsträger mit dem PC. Dabei nutzt sie (leider) folgende Vordrucke+Software: Avery Zweckform 2816
Die zugehörige Software hat die Qualität, die man von einem Etikettenhersteller erwarten kann (Vorlage für Microsoft Word mit Makro). Da der Firma offenbar schon bewusst ist, dass ihre Software teilweise nur "eingeschränkt" funktioniert, (kleiner Tipp: Die Schrift ist auf dem Formular verschoben, wenn man die Schriftgröße bei Windows auf 125% stellt.) gibt es noch eine Webapplikation. Diese unterstützt allerdings nicht das Formular 2816.

Hier ein kleines Python Skript, dass die gleiche Funktionalität für das 2816 Formular erfüllt. Ich hoffe, dass ich damit auch anderen weiter helfen kann, die sonst auf die Avery Software angewiesen wären.


Das Programm füllt eine HTML Vorlage aus und konvertiert diese mittels wkhtmltopdf (muss installiert sein, z.B unter Ubuntu mit sudo apt-get install wkhtmltopdf) in ein Pdf, dass man leicht ausdrucken kann. Für die Justierung kann man leicht in der Konfigurationsdatei die beiden Offset-Parameter umstellen und evt. auch die Ausrichtung für die einzelnen Textfelder verbessern bzw. das Programm für eine andere Vorlage umschreiben. Wer die Justierung ganz perfekt machen will, sollte mit der justierten Avery Software einen Überweisungsträger bedrucken und dann nochmal mit diesem Programm auf die gleiche Seite. Danach kann man mit dem Lineal die Abweichungen ausmessen und in der Konfigurationsdatei entsprechend korrigieren. Nach der Installation und Justierung sind aber zur reinen Benutzung der Software keine tiefergehenden technischen Kenntnisse erforderlich.

Das Programm wurde unter Ubuntu getestet. Falls notwendig, sollte eine Portierung auf andere Platformen aber nicht zu schwierig sein. Im Gegensatz zur Originalsoftware von Avery kommt man ohne den Kauf von Microsoft Office aus. Die kleine Tkinter-GUI zeigt nur die Elemente, die für die reine Nutzanwendung notwendig sind und sollen so weniger erfahrene Computernutzer nicht überfordern.

Das erzeugte Pdf wird jeweils unter ~/Dokumente/btof/ mit Datum im Dateinamen abgelegt. Dadurch werden die Überweisungen leicht nachvollziehbar archiviert, ohne dass sich der Nutzer über ein besonderes Ordnungsprinzip bzw. Dateien und Dateinamen überhaupt Gedanken machen muss.

Hier nochmal der Link zum Download