Development log

Code, tricks, quick technical ideas, recipes, progress reports, bash, ffmpeg and more…

linux: auto-login

There’s couple of ways how to setup auto-login on linux. This one is geeky and not very user-friendly, but might come handy to somebody. This is on Ubuntu Linux 14.04.1/trusty with graphical login/desktop manager (lightdm) disabled.

install mingetty

edit /etc/init/tty1.conf so that it looks like this:

The most important part are the last three lines. Change username to what you have.

Edit your ~/.profile and add at the bottom:

Reboot and you should end up in your X session.


supercollider: easy beats with patterns

minor random bliss in two

Learning Patterns in SuperCollider, here’s a little lullaby:


SuperCollider Help in dark grey

In order to browse and use SuperCollider help system in inverted gray colours, there are two quick hacks:

  • modify internal Help system
  • style the help on using Stylish

To modify internal Help system find the file /usr/local/share/SuperCollider/HelpSource/scdoc.css and add at the bottom/end of the file:

If you use and a Stylish add-on in (for example) Firefox to custom-style pages, you can add a new style which is similar to the above:

Processing and Awesome WM

Processing is a Java application and has had troubles in my Awesome setup for a while now in various ways. With some early versions (2.x) the main IDE window didn’t want to redraw following a resize. Now with new IDE in 3.x series this problem is gone, but now the main output window thinks it has a window decoration and is offset in a very ugly way, showing a wide grey bar at the bottom and slighly less wide one on the right (lack of top window decoration and a scrollbar probably.

These problems can be solved with a program called wmname before starting a java application.

You can find it in the ‘suckless-tools’ package on Ubuntu/Debian.

It seems this needs to be run only once in one of the terminals and it then works accross any subsequent commands in the current session. Probably not stupid to put it in ~/.config/awesome/rc.lua?

making of Requiem for The Future: A.I. video

The biggest part of creating this video was to generate satisfactory glitched material. I researched various ways how to glitch images using SoX tool and a glitch in pre-3.0 ffmpeg’s jpeg-le codec. Below is a BASH script which worked through all .mov videos in the current folder, extracted frames, glitched it and stitched back the videos from frames. Here’s the gist of all glitches in a summary:


Here’s a full bash script:

Continue reading

jpeg-LS glitching with FFmpeg

In an older version of FFmpeg it was possible to glitch the image with JPEG-LS codec. Newer versions of FFmpeg don’t work anymore in this way, so one must download an old version and compile it (keep it local) – here 2.0.7 is used.

This script takes a video file as an argument, extracts frames, glitches them, and gathers frames back into a video file.



glitching images & movies with audio effect using sox

Some tutorial will be here soon, but for now, this script that glitches your video file.

Requires bash, ffmpeg & sox.


Processing & multitouch

I wasn’t supposed to be doing this today, but:

Multitouch support on Linux seems much simpler with a different library than SMT that I was unsuccessfully tryin last year. “Simple Touch” actually “just works” via evdev library. The only thing that was needed was to supply the right event device from /dev/input and also make it readable and writable for normal user.

Find out which event device is your touch screen:

Above you see that id of the touch-screen is 11. Which means we have to allow access to /dev/input/event11.

Alternatively (and perhaps much more reliably) one should check the contents of /dev/input/by-id/

You can see that the touch-screen reports to be device “../event5”.

Simple Touch library is available from the Tools menu in Processing, but also here:

In Processing there is couple of examples for Simple Touch library, but the essence for a successful start is

1) list devices

will output something like

Touch-screen (event11) has [3] index, so to open this device you finally use

It seems also to be possible to do just this:

and the following also works:

This opens the door for writing multitouch interfaces in Processing, which however means a lot more work. For now it seems a good way to go with writing control GUI in SuperCollider, but eventually, the Processing possibility seems like very interesting and inviting.

So a final complete working example for my machine is this:

timelapse aka speeding up with ffmpeg

These days I’m recording my work in the studio using a timelapse function in my Panasonic TM700 HD camera. So it happened that I forgot to turn on the the function (needs to be turned on everytime you start recording) which usually records one frame every 10 seconds, so I ended up with a “normal” recording and wanted to convert that to what camera usually does. Ffmpeg to the rescue! To do some frame manipulation a video filter “setpts” is what one needs. Gathering knowledge online with help of two pages: to speed up / slow down a video

So, supposedly, the right way to change video speed using ffmpeg is by adjusting the “presentation time stamp” (PTS). This adjusts frames’ metadata related to how long each is displayed—exactly what you want.

this is the crucial piece of code that needs to be passed to ffmpeg:

-filter:v "setpts=2.0*PTS"

Or a more practical example using fraction – if original framerate is 25 frames per second I only need evert 250th one:

$ ffmpeg -i INPUTFILE.mkv -filter:v "setpts=(1/250)*PTS" OUTPUTFILE.mkv

My final conversion was from full-HD .mts to 720p .webm and to mp4:

$ ffmpeg -i INPUT.mts -filter:v "setpts=(1/250)*PTS" -s 1280x720 -c:v libvpx -crf 5 -b:v 8M -an OUTPUT.webm
$ ffmpeg -i INPUT.mts -filter:v "setpts=(1/250)*PTS" -s 1280x720 -c:v libx264 -preset slow -crf 10 -an OUTPUT.mp4

switching caps-lock key into control key

There are couple of ways how to make your caps-lock key into control key. For some of use keyboard-shortcuts nerds keyboard usage optimisation is quite an important topic. One of useful things is to move (or rather add) a control (CTRL) key to the place where (rarely used) CAPS LOCK key is. This is especially usefull if one work in EMACS a lot. So, obviously emacs-wiki is a good source for various ways how to achieve that. See for more. But specificaly in my case I used the following recipe for Debian and derivatives:

To make Caps Lock another Ctrl key, edit the file /etc/default/keyboard and change the line which reads


and then run:

Changes take effect on next login and seem to perpetuate across virtual terminals and X session.