]> git.sesse.net Git - mlt/blob - src/swig/python/play.py
Complete reorganization and renaming to usable state.
[mlt] / src / swig / python / play.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 # Import required modules
5 import mlt
6 import time
7 import sys
8
9 # Start the mlt system
10 mlt.Factory().init( )
11
12 # Establish a profile
13 profile = mlt.Profile( )
14
15 # Create the producer
16 p = mlt.Producer( profile, sys.argv[1] )
17
18 if p:
19         # Create the consumer
20         c = mlt.Consumer( profile, "sdl" )
21
22         # Turn off the default rescaling
23         c.set( "rescale", "none" )
24         
25         # Connect the producer to the consumer
26         c.connect( p )
27         
28         # Start the consumer
29         c.start( )
30         
31         # Wait until the user stops the consumer
32         while c.is_stopped( ) == 0:
33                 time.sleep( 1 )
34 else:
35         # Diagnostics
36         print "Unable to open ", sys.argv[ 1 ]
37