Skip to content

Instantly share code, notes, and snippets.

@trickkiste
Created September 30, 2012 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trickkiste/3805493 to your computer and use it in GitHub Desktop.
Save trickkiste/3805493 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Import required modules
require 'pry'
require 'mlt'
# Create the mlt system
Mlt::Factory::init
# Establish the mlt profile
profile_hd = Mlt::Profile.new("atsc_1080i_50")
profile_sd = Mlt::Profile.new("dv_pal_wide")
# Create the producer
producer = Mlt::Factory::producer( profile_hd, "decklink:3" )
raise "Unable to open decklink:3 producer" if !producer.is_valid
# Create the consumer
consumer = Mlt::Consumer.new( profile_sd, "decklink:0" )
raise "Unable to open decklink:0 consumer" if !consumer.is_valid
consumer.set( "realtime", 4 )
# Start the consumer
consumer.start
# Connect the producer to the consumer
consumer.connect( producer )
binding.pry
# Clean up consumer
consumer.stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment