Added play.pl
[melted] / mlt++ / swig / perl / play.pl
1 #!/bin/env perl
2
3 # Import required modules
4 use mltpp;
5
6 # Not sure why the mltpp::Factory.init method fails...
7 mltpp::mlt_factory_init( undef );
8
9 # Create the producer
10 $p = new mltpp::Producer( $ARGV[0] );
11
12 if ( $p->is_valid( ) )
13 {
14 # Loop the video
15 $p->set( "eof", "loop" );
16
17 # Create the consumer
18 $c = new mltpp::Consumer( "sdl" );
19
20 # Turn of the default rescaling
21 $c->set( "rescale", "none" );
22
23 # Connect the producer to the consumer
24 $c->connect( $p );
25
26 # Start the consumer
27 $c->start;
28
29 # Wait until the user stops the consumer
30 while ( !$c->is_stopped ) {
31 sleep( 1 );
32 }
33 }
34 else
35 {
36 print "Unable to open $ARGV[0]\n";
37 }
38