The movie Detour (1945) was downloaded from archive.org and split up frame-by-frame. For each frame an average brightness was calculated, and from that the average brightness second-by-second. The movie was stitched back together, with seconds sorted from bright to dark.
mplayer was used to split the video and audio, and divide the video into png-files. Custom written software calculated the brightness of each frame. This was stored in an Sqlite3 database. Sound and video was later organized and put back together by a mix of perl-scripts, python-scripts and mencoder