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( "sdl", "NTSC" );
24 // Create the producer(s)
25 mlt_producer dv1
= mlt_factory_producer( "mcmpeg", file1
);
28 // Connect the tractor to the consumer
29 mlt_consumer_connect( consumer
, mlt_producer_service( dv1
) );
31 // Do stuff until we're told otherwise...
32 fprintf( stderr
, "Press return to continue\n" );
33 fgets( temp
, 132, stdin
);
34 mlt_consumer_close( consumer
);
38 //mlt_producer dv1 = producer_pixbuf_init( file1 );
39 //mlt_producer dv2 = producer_libdv_init( file2 );
40 //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
41 mlt_producer dv2
= mlt_factory_producer( "pango", NULL
); //"<span font_desc=\"Sans Bold 36\">Mutton <span font_desc=\"Luxi Serif Bold Oblique 36\">Lettuce</span> Tomato</span>" );
42 mlt_properties_set( mlt_producer_properties( dv2
), "font", "Sans Bold 36" );
43 mlt_properties_set( mlt_producer_properties( dv2
), "text", "Mutton Lettuce\nTomato" );
44 mlt_properties_set_int( mlt_producer_properties( dv2
), "video_standard", mlt_video_standard_ntsc
);
45 mlt_properties_set_int( mlt_producer_properties( dv2
), "bgcolor", 0x0000007f );
46 mlt_properties_set_int( mlt_producer_properties( dv2
), "pad", 8 );
47 mlt_properties_set_int( mlt_producer_properties( dv2
), "align", 1 );
48 mlt_properties_set_int( mlt_producer_properties( dv2
), "x", -20 );
49 mlt_properties_set_int( mlt_producer_properties( dv2
), "y", 40 );
51 // Register producers(s) with a multitrack object
52 mlt_multitrack multitrack
= mlt_multitrack_init( );
53 mlt_multitrack_connect( multitrack
, dv1
, 0 );
54 mlt_multitrack_connect( multitrack
, dv2
, 1 );
56 // Create a filter and associate it to track 0
57 mlt_filter filter
= mlt_factory_filter( "deinterlace", NULL
);
58 mlt_filter_connect( filter
, mlt_multitrack_service( multitrack
), 0 );
59 mlt_filter_set_in_and_out( filter
, 0, 1000 );
61 // Define a transition
62 mlt_transition transition
= mlt_factory_transition( "composite", NULL
);
63 mlt_transition_connect( transition
, mlt_filter_service( filter
), 0, 1 );
64 mlt_transition_set_in_and_out( transition
, 0, 5.0 );
66 // Buy a tractor and connect it to the filter
67 mlt_tractor tractor
= mlt_tractor_init( );
68 mlt_tractor_connect( tractor
, mlt_transition_service( transition
) );
70 // Connect the tractor to the consumer
71 mlt_consumer_connect( consumer
, mlt_tractor_service( tractor
) );
73 // Do stuff until we're told otherwise...
74 fprintf( stderr
, "Press return to continue\n" );
75 fgets( temp
, 132, stdin
);
77 mlt_properties_set( mlt_producer_properties( dv2
), "font", "Sans Oblique 36" );
78 mlt_properties_set( mlt_producer_properties( dv2
), "text", "Mutton\nLettuce Tomato" );
80 // Do stuff until we're told otherwise...
81 fprintf( stderr
, "Press return to continue\n" );
82 fgets( temp
, 132, stdin
);
84 // Close everything...
85 mlt_consumer_close( consumer
);
86 mlt_tractor_close( tractor
);
87 //mlt_filter_close( filter );
88 mlt_multitrack_close( multitrack
);
89 mlt_producer_close( dv1
);
90 mlt_producer_close( dv2
);