Experimental swig bindings
[melted] / mlt++ / swig / python / play.py
1 #!/usr/bin/env python
2
3 # Import required modules
4 import mltpp
5 import time
6 import sys
7
8 # Start the mlt system
9 mltpp.Factory.init( )
10
11 # Create the producer
12 p = mltpp.Producer( sys.argv[1] )
13
14 if p:
15 # Create the consumer
16 c = mltpp.Consumer( "sdl" )
17
18 # Turn off the default rescaling
19 c.set( "rescale", "none" )
20
21 # Connect the producer to the consumer
22 c.connect( p )
23
24 # Start the consumer
25 c.start( )
26
27 # Wait until the user stops the consumer
28 while c.is_stopped( ) == 0:
29 time.sleep( 1 )
30 else:
31 # Diagnostics
32 print "Unable to open ", sys.argv[ 1 ]
33