Skip to content

Instantly share code, notes, and snippets.

@jimmac
jimmac / gist:96415
Created April 16, 2009 13:37
watch a directory for blender project files and render the default scene if one appears
#!/usr/bin/ruby
require 'directory_watcher'
require 'ftools'
FOLDER = './render-queue'
#THREADS = 8
#BLENDER = '/usr/bin/blender'
BLENDER = '/Applications/blender/blender.app/Contents/MacOS/blender'
def randomFileName (numberOfRandomchars)
@jimmac
jimmac / Render gpm icons for andreas
Created February 2, 2009 15:31
render gnome-power-manager icons
#!/usr/bin/env ruby
# the source svg needs to have a 'plate' layer with all the crop
# rects having a label with the output filename
require "rexml/document"
require "ftools"
include REXML
INKSCAPE = '/usr/bin/env inkscape'
SRC = "#{Dir.pwd}/svg/gpm-batteries.svg"
@jimmac
jimmac / gist:52775
Created January 26, 2009 10:19
Transcode videos to PS3
#!/usr/bin/env ruby
require 'optparse'
require 'ostruct'
def ffmpegit(infile,outfile,twopass,title)
title = title.nil? ? infile.gsub(/\.[^.]+$/,'').capitalize : title
if twopass
cmd = "ffmpeg -i #{infile} -y -an -pass 1 -vcodec libx264 -b 1024k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 1 -trellis 0 -refs 1 -bf 16 -b_strategy 1 -threads 2 -level 31 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -rc_eq blurCplx^\\(1-qComp\\) -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 #{outfile}"