I've tried to connect multiple consumers to one producer (see code below
for the extended simple sample from framework.txt).
Unfortunately, I get artefacts in the display and quickly a segmentation
fault. I'd guess both consumers are reading from the producer, removing
data needed by each other. Therefore I assume it's simply not possible
So, is there any possibility to attach two consumers to a producer (i.e.
using some class in the middle, which duplicates the 'streams')?
---- Not working code:
int main( int argc, char *argv )
// Initialise the factory
if ( mlt_factory_init( NULL ) == 0 )
// Create the default consumer
mlt_consumer hello = mlt_factory_consumer( NULL, NULL );
// Create a "save" consumer
mlt_consumer saver = mlt_factory_consumer( "avformat", "test.mpeg" );
// Create via the default producer
mlt_producer world = mlt_factory_producer( NULL, argv[ 1 ] );
// Connect the producer to the consumer
mlt_consumer_connect( hello, mlt_producer_service( world ) );
mlt_consumer_connect( saver, mlt_producer_service( world ) );
// Start the consumer
mlt_consumer_start( hello );
mlt_consumer_start( saver );
// Wait for the consumer to terminate
while( !mlt_consumer_is_stopped( hello ) )
sleep( 1 );
// Close the consumer
mlt_consumer_close( hello );
mlt_consumer_close( saver );
// Close the producer
mlt_producer_close( world );
// Close the factory
// Report an error during initialisation
fprintf( stderr, "Unable to locate factory modules\n" );
// End of program
From: Dan Dennedy <dan@de...> - 2007-09-23 05:08:12
On Sunday 16 September 2007, Bj=F6rn Schneider wrote:
> I've tried to connect multiple consumers to one producer (see code below
> for the extended simple sample from framework.txt).
This is not possible today. You would need to make a special consumer that=
encapsulates other consumers to do this.