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", "PAL" );
24 // Create the producer(s)
25 mlt_producer dv1
= mlt_factory_producer( "libdv", 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( dv2
) );
35 // Do stuff until we're told otherwise...
36 fprintf( stderr
, "Press return to continue\n" );
37 fgets( temp
, 132, stdin
);
38 mlt_consumer_close( consumer
);
42 //mlt_producer dv1 = producer_pixbuf_init( file1 );
43 //mlt_producer dv2 = producer_libdv_init( file2 );
44 //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
46 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>" );
47 mlt_properties_set_int( mlt_producer_properties( title
), "video_standard", mlt_video_standard_ntsc
);
48 mlt_properties_set( mlt_producer_properties( title
), "font", "Sans Bold 36" );
49 mlt_properties_set( mlt_producer_properties( title
), "text", "Mutton Lettuce\nTomato" );
50 mlt_properties_set_int( mlt_producer_properties( title
), "bgcolor", 0x0000007f );
51 mlt_properties_set_int( mlt_producer_properties( title
), "pad", 8 );
52 mlt_properties_set_int( mlt_producer_properties( title
), "align", 1 );
53 mlt_properties_set_int( mlt_producer_properties( title
), "x", 20 );
54 mlt_properties_set_int( mlt_producer_properties( title
), "y", 40 );
57 mlt_playlist playlist1
= mlt_playlist_init();
58 mlt_playlist_append( playlist1
, dv1
);
59 mlt_playlist_blank( playlist1
, 1.0 );
61 mlt_playlist playlist2
= mlt_playlist_init();
62 mlt_playlist_blank( playlist2
, 3.0 );
63 mlt_playlist_append( playlist2
, dv2
);
65 // Register producers(s) with a multitrack object
66 mlt_multitrack multitrack
= mlt_multitrack_init( );
67 mlt_multitrack_connect( multitrack
, mlt_playlist_producer( playlist1
), 0 );
68 mlt_multitrack_connect( multitrack
, mlt_playlist_producer( playlist2
), 1 );
70 // Create a filter and associate it to track 0
71 //mlt_filter filter = mlt_factory_filter( "deinterlace", NULL );
72 //mlt_filter_connect( filter, mlt_multitrack_service( multitrack ), 0 );
73 //mlt_filter_set_in_and_out( filter, 0, 1000 );
75 // Define a transition
76 mlt_transition transition
= mlt_factory_transition( "luma", NULL
);
77 mlt_transition_connect( transition
, mlt_multitrack_service( multitrack
), 0, 1 );
78 mlt_transition_set_in_and_out( transition
, 3.0, 5.0 );
79 //mlt_properties_set( mlt_transition_properties( transition ), "filename", "clock.pgm" );
80 mlt_properties_set_double( mlt_transition_properties( transition
), "softness", 0.1 );
82 // Buy a tractor and connect it to the filter
83 mlt_tractor tractor
= mlt_tractor_init( );
84 mlt_tractor_connect( tractor
, mlt_transition_service( transition
) );
86 // Connect the tractor to the consumer
87 mlt_consumer_connect( consumer
, mlt_tractor_service( tractor
) );
89 // Do stuff until we're told otherwise...
90 fprintf( stderr
, "Press return to continue\n" );
91 fgets( temp
, 132, stdin
);
93 // Close everything...
94 mlt_consumer_close( consumer
);
95 mlt_tractor_close( tractor
);
96 mlt_transition_close( transition
);
97 mlt_multitrack_close( multitrack
);
98 mlt_producer_close( dv1
);
99 mlt_producer_close( dv2
);