Handbake-ruby is a project mainly written in ..., it's free.
Ruby wrapper around the Handbrake encoder