Create a gist now

Instantly share code, notes, and snippets.

#!/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