2 #include <framework/mlt.h>
3 #include "../modules/dv/producer_libdv.h"
4 #include "../modules/dv/consumer_libdv.h"
5 //#include "../modules/sdl/consumer_sdl.h"
9 int main( int argc
, char **argv
)
15 // mlt_factory_init( "../modules" );
23 // Start the consumer...
24 int vstd
= mlt_video_standard_ntsc
;
25 //mlt_consumer consumer = mlt_factory_consumer( "bluefish", &vstd );
26 //mlt_consumer consumer = mlt_factory_consumer( "sdl", NULL );
27 mlt_consumer consumer
= consumer_libdv_init( NULL
);
29 // Create the producer(s)
30 //mlt_producer dv1 = mlt_factory_producer( "libdv", file1 );
31 mlt_producer dv1
= producer_libdv_init( file1
);
32 //mlt_producer_set_in_and_out( dv1, 0, 5 );
34 mlt_producer dv2
;// = mlt_factory_producer( "libdv", file2 );
35 //mlt_producer_set_in_and_out( dv2, 10.0, 30.0 );
38 // Connect the consumer to the producer
39 mlt_consumer_connect( consumer
, mlt_producer_service( dv1
) );
41 // Do stuff until we're told otherwise...
42 mlt_consumer_start( consumer
);
43 fprintf( stderr
, "Press return to continue\n" );
44 fgets( temp
, 132, stdin
);
45 mlt_consumer_stop( consumer
);
46 mlt_consumer_close( consumer
);
51 //mlt_producer dv1 = producer_pixbuf_init( file1 );
52 //mlt_producer dv2 = producer_libdv_init( file2 );
53 //mlt_producer dv2 = mlt_factory_producer( "pixbuf", file2 );
55 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>" );
56 mlt_properties_set_int( mlt_producer_properties( title
), "video_standard", mlt_video_standard_ntsc
);
57 mlt_properties_set( mlt_producer_properties( title
), "font", "Sans Bold 36" );
58 mlt_properties_set( mlt_producer_properties( title
), "text", "Mutton Lettuce\nTomato" );
59 mlt_properties_set_int( mlt_producer_properties( title
), "bgcolor", 0x0000007f );
60 mlt_properties_set_int( mlt_producer_properties( title
), "pad", 8 );
61 mlt_properties_set_int( mlt_producer_properties( title
), "align", 1 );
62 mlt_properties_set_int( mlt_producer_properties( title
), "x", 20 );
63 mlt_properties_set_int( mlt_producer_properties( title
), "y", 40 );
66 mlt_playlist playlist1
= mlt_playlist_init();
67 mlt_playlist_append( playlist1
, dv1
);
68 mlt_playlist_blank( playlist1
, 1.0 );
70 mlt_playlist playlist2
= mlt_playlist_init();
71 mlt_playlist_blank( playlist2
, 3.0 );
72 mlt_playlist_append( playlist2
, dv2
);
74 // Register producers(s) with a multitrack object
75 mlt_multitrack multitrack
= mlt_multitrack_init( );
76 mlt_multitrack_connect( multitrack
, mlt_playlist_producer( playlist1
), 0 );
77 mlt_multitrack_connect( multitrack
, mlt_playlist_producer( playlist2
), 1 );
79 // Create a filter and associate it to track 0
80 //mlt_filter filter = mlt_factory_filter( "deinterlace", NULL );
81 //mlt_filter_connect( filter, mlt_multitrack_service( multitrack ), 0 );
82 //mlt_filter_set_in_and_out( filter, 0, 1000 );
84 // Define a transition
85 mlt_transition transition
= mlt_factory_transition( "luma", NULL
);
86 mlt_transition_connect( transition
, mlt_multitrack_service( multitrack
), 0, 1 );
87 mlt_transition_set_in_and_out( transition
, 3.0, 5.0 );
88 //mlt_properties_set( mlt_transition_properties( transition ), "filename", "clock.pgm" );
89 mlt_properties_set_double( mlt_transition_properties( transition
), "softness", 0.1 );
91 // Buy a tractor and connect it to the filter
92 mlt_tractor tractor
= mlt_tractor_init( );
93 mlt_tractor_connect( tractor
, mlt_transition_service( transition
) );
95 // Connect the tractor to the consumer
96 mlt_consumer_connect( consumer
, mlt_tractor_service( tractor
) );
98 // Do stuff until we're told otherwise...
99 fprintf( stderr
, "Press return to continue\n" );
100 fgets( temp
, 132, stdin
);
102 // Close everything...
103 mlt_consumer_close( consumer
);
104 mlt_tractor_close( tractor
);
105 mlt_transition_close( transition
);
106 mlt_multitrack_close( multitrack
);
107 mlt_producer_close( dv1
);
108 mlt_producer_close( dv2
);