Some new Ruby Libraries to Boot

Hot on the heels of the recent graduation project activity I’ve released a few infrastructure libraries in Ruby that I use to manage the indie pipeline here. These are Depix, EDL and Timecode.

Timecode is a value class for SMPTE timecode information. It stores the framerate and the number of frames and supports all basic calculations (like addition, subtraction, multiplication and what have you), parsing and other manipulations that you will likely want to perform with a timecode field. It also plugs easily into ActiveRecord. Here’s how to scan a range of timecodes for example:

(Timecode.parse("10:00:00:00")..Timecode.parse("10:00:10:01")).each do | frame |
   puts frame
end

Depix scans DPX file headers and makes them accessible as Ruby objects. There is some functionality for writing them back after editing but I would not recommend using it just yet. Here’s how to scan a whole directory of DPX files and sort them by time code (this relies on the Timecode gem as well):

 dpx_files = Dir.glob("/RAID/NewScans/*.DPX").map do | dpx_path |
    Depix.from_file(dpx_path)
 end.sort{|dpx1, dpx2| dpx1.time_code <=> dpx2.time_code }

Depix supports the convention of reel name assigned to device.orientation field and it’s available as flame_reel on every DPX object read into memory. If you are courageous enough to write to DPX files with it you can even spare quite some bucks on tools like this one.

EDL is still in the making but can be tried out already (look at the API) - it can be used to analyze an EDL file. It even supports speed changes and SMPTE wipe inspection.

The goodies can be installed by doing

  sudo gem install depix timecode edl

and all the tracking happens through my spankin’ new GitHub page

Come to think of it, these three can be combined to do some powerful and painless data-wrangling for file-based workflows. And you can also make your own CinemaTools-like apps.