2 #include <framework/mlt.h>
6 int main( int argc
, char **argv
)
12 mlt_factory_init( "../modules" );
19 // Start the consumer...
20 int vstd
= mlt_video_standard_ntsc
;
21 //mlt_consumer consumer = mlt_factory_consumer( "bluefish", &vstd );
22 mlt_consumer consumer
= mlt_factory_consumer( "westley", NULL
);
24 // Create the producer(s)
25 mlt_producer dv1
= mlt_factory_producer( "westley", file1
);
26 //mlt_producer_set_in_and_out( dv1, 0, 5 );
28 mlt_producer dv2
= mlt_factory_producer( "libdv", file2
);
29 //mlt_producer_set_in_and_out( dv2, 10.0, 30.0 );
32 // Connect the consumer to the producer
33 mlt_consumer_connect( consumer
, mlt_producer_service( dv1
) );
35 // Do stuff until we're told otherwise...
36 mlt_consumer_start( consumer
);
37 // fprintf( stderr, "Press return to continue\n" );
38 // fgets( temp, 132, stdin );
39 mlt_consumer_stop( consumer
);
40 mlt_consumer_close( consumer
);
44 //mlt_producer dv1 = producer_pixbuf_init( file1 );
45 //mlt_producer dv2 = producer_libdv_init( file2 );
46 //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
48 mlt_producer title
= mlt_factory_producer( "pango", NULL
); //"<span font_desc=\"Sans Bold 36\">Mutton <span font_desc=\"Luxi Serif Bold Oblique 36\">Lettuce</span> Tomato</span>" );
49 mlt_properties_set_int( mlt_producer_properties( title
), "video_standard", mlt_video_standard_ntsc
);
50 mlt_properties_set( mlt_producer_properties( title
), "font", "Sans Bold 36" );
51 mlt_properties_set( mlt_producer_properties( title
), "text", "Mutton Lettuce\nTomato" );
52 mlt_properties_set_int( mlt_producer_properties( title
), "bgcolor", 0x0000007f );
53 mlt_properties_set_int( mlt_producer_properties( title
), "pad", 8 );
54 mlt_properties_set_int( mlt_producer_properties( title
), "align", 1 );
55 mlt_properties_set_int( mlt_producer_properties( title
), "x", 20 );
56 mlt_properties_set_int( mlt_producer_properties( title
), "y", 40 );
59 mlt_playlist playlist1
= mlt_playlist_init();
60 mlt_playlist_append( playlist1
, dv1
);
61 mlt_playlist_blank( playlist1
, 1.0 );
63 mlt_playlist playlist2
= mlt_playlist_init();
64 mlt_playlist_blank( playlist2
, 3.0 );
65 mlt_playlist_append( playlist2
, dv2
);
67 // Register producers(s) with a multitrack object
68 mlt_multitrack multitrack
= mlt_multitrack_init( );
69 mlt_multitrack_connect( multitrack
, mlt_playlist_producer( playlist1
), 0 );
70 mlt_multitrack_connect( multitrack
, mlt_playlist_producer( playlist2
), 1 );
72 // Create a filter and associate it to track 0
73 //mlt_filter filter = mlt_factory_filter( "deinterlace", NULL );
74 //mlt_filter_connect( filter, mlt_multitrack_service( multitrack ), 0 );
75 //mlt_filter_set_in_and_out( filter, 0, 1000 );
77 // Define a transition
78 mlt_transition transition
= mlt_factory_transition( "luma", NULL
);
79 mlt_transition_connect( transition
, mlt_multitrack_service( multitrack
), 0, 1 );
80 mlt_transition_set_in_and_out( transition
, 3.0, 5.0 );
81 //mlt_properties_set( mlt_transition_properties( transition ), "filename", "clock.pgm" );
82 mlt_properties_set_double( mlt_transition_properties( transition
), "softness", 0.1 );
84 // Buy a tractor and connect it to the filter
85 mlt_tractor tractor
= mlt_tractor_init( );
86 mlt_tractor_connect( tractor
, mlt_transition_service( transition
) );
88 // Connect the tractor to the consumer
89 mlt_consumer_connect( consumer
, mlt_tractor_service( tractor
) );
91 // Do stuff until we're told otherwise...
92 fprintf( stderr
, "Press return to continue\n" );
93 fgets( temp
, 132, stdin
);
95 // Close everything...
96 mlt_consumer_close( consumer
);
97 mlt_tractor_close( tractor
);
98 mlt_transition_close( transition
);
99 mlt_multitrack_close( multitrack
);
100 mlt_producer_close( dv1
);
101 mlt_producer_close( dv2
);