}
else
{
- fprintf( stderr, "Current Position: %10d\r", (int)mlt_producer_position( producer ) );
+ fprintf( stderr, "Current Position: %10d\r", (int)mlt_consumer_position( consumer ) );
}
}
profile->progressive = mlt_properties_get_int( p, "meta.media.progressive" );
profile->frame_rate_num = mlt_properties_get_int( p, "meta.media.frame_rate_num" );
profile->frame_rate_den = mlt_properties_get_int( p, "meta.media.frame_rate_den" );
+ // AVCHD is mis-reported as double frame rate.
+ if ( profile->progressive == 0 && (
+ profile->frame_rate_num / profile->frame_rate_den == 50 ||
+ profile->frame_rate_num / profile->frame_rate_den == 59 ) )
+ profile->frame_rate_num /= 2;
profile->sample_aspect_num = mlt_properties_get_int( p, "meta.media.sample_aspect_num" );
profile->sample_aspect_den = mlt_properties_get_int( p, "meta.media.sample_aspect_den" );
+ profile->colorspace = mlt_properties_get_int( p, "meta.media.colorspace" );
profile->display_aspect_num = (int) ( (double) profile->sample_aspect_num * profile->width / profile->sample_aspect_den + 0.5 );
profile->display_aspect_den = profile->height;
free( profile->description );
mlt_profile profile = NULL;
int is_progress = 0;
int is_silent = 0;
+ mlt_profile backup_profile;
// Construct the factory
mlt_repository repo = mlt_factory_init( NULL );
profile->is_explicit = 1;
// Look for the consumer option to load profile settings from consumer properties
+ backup_profile = mlt_profile_clone( profile );
load_consumer( &consumer, profile, argc, argv );
+ // If the consumer changed the profile, then it is explicit.
+ if ( backup_profile && !profile->is_explicit && (
+ profile->width != backup_profile->width ||
+ profile->height != backup_profile->height ||
+ profile->sample_aspect_num != backup_profile->sample_aspect_num ||
+ profile->sample_aspect_den != backup_profile->sample_aspect_den ||
+ profile->frame_rate_den != backup_profile->frame_rate_den ||
+ profile->frame_rate_num != backup_profile->frame_rate_num ||
+ profile->colorspace != backup_profile->colorspace ) )
+ profile->is_explicit = 1;
+ mlt_profile_close( backup_profile );
+
// Get melt producer
if ( argc > 1 )
melt = mlt_factory_producer( profile, "melt", &argv[ 1 ] );
{
// Generate an automatic profile if needed.
if ( ! profile->is_explicit )
+ {
guess_profile( melt, profile );
-
- // Reload the consumer with the fully qualified profile
+ mlt_producer_close( melt );
+ melt = mlt_factory_producer( profile, "melt", &argv[ 1 ] );
+ }
+
+ // Reload the consumer with the fully qualified profile.
+ // The producer or guess_profile could have changed the profile.
load_consumer( &consumer, profile, argc, argv );
// If we have no consumer, default to sdl