Ruby-MythTV
Description
A pure Ruby implementation of the MythTV Backend protocol to allow interaction with a MythTV server. Features include browsing and streaming of recordings, and thumbnail generation. See http://github.com/nickludlam/ruby-mythtv for more details.
Requirements
This gem does not yet support multiple protocol versions, so it requires an up-to-date installation of MythTV v0.21, and specifically implements protocol version 40. For more information on the history of the MythTV protocol, see http://www.mythtv.org/wiki/index.php/Protocol
Install
There are two ways to get this gem. One is to use the standard gem command, and pull it from RubyForge. This will be the method where releases are infrequent, but stable.
$ gem install ruby-mythtv
The other is to get the code from GitHub, which is where I’ll likely be making code tweaks, and it can be considered the edge branch.
$ gem sources -a http://gems.github.com/ (only required once)
$ gem install nickludlam-ruby-mythtv
Source
The ruby-mythtv source is available on GitHub at
http://github.com/nickludlam/ruby-mythtv
and can be cloned from
git://github.com/nickludlam/ruby-mythtv.git
Basic usage
1 2 3 4 5 6 7 8 9 10 11 12 |
require 'ruby-mythtv' # Connect to the server backend = MythTV::Backend.new(:host => 'mythtv.localdomain') # Get an array of recordings recordings = backend.query_recordings # Generate a thumbnail of the most recent recording, at 60 seconds in from the start preview_thumbnail = @backend.preview_image(recordings[0], :secs_in => 60) File.open('preview_thumbnail.png', 'w') { |f| f.write(preview_thumbnail) } |