git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@579
d19143bc-622f-0410-bfdd-
b5b2a6649095
13 files changed:
-track \
clip1.dv \
-transition \
-track \
clip1.dv \
-transition \
-region \
-composite.start=10%,10%:20%x20% \
-composite.key[33]=30%,70%:25%x25% \
-composite.key[66]=70%,30%:15%x15% \
-composite.end=70%,70%:20%x20% \
+region:circle \
+composite.geometry="10%,10%:20%x20%;33=30%,70%:25%x25%;66=70%,30%:15%x15%;-1=70%,70%:20%x20%" \
+composite.softness=0.1 \
a_track=0 \
b_track=1 \
in=0 \
a_track=0 \
b_track=1 \
in=0 \
"+My name is Inigo Montoya.txt" out=99 -blank 49 "+Prepare to die!.txt" out=99 \
-track \
-blank 74 "+You killed my father.txt" out=74 \
"+My name is Inigo Montoya.txt" out=99 -blank 49 "+Prepare to die!.txt" out=99 \
-track \
-blank 74 "+You killed my father.txt" out=74 \
--transition composite:50%,20%:5%x4% end=10%,20%:80%x12% fill=true halign=centre valign=centre in=0 out=99 a_track=0 b_track=1 \
+-transition composite:50%,20%:5%x4% end=10%,20%:80%x12% distort=1 halign=centre valign=centre in=0 out=99 a_track=0 b_track=1 \
-transition composite:0%,70%:100%x10% end=100%,70%:100%x10% in=75 out=149 a_track=0 b_track=2 \
-transition composite:25%,25%:50%x50%! in=150 out=249 a_track=0 b_track=1 \
$*
-transition composite:0%,70%:100%x10% end=100%,70%:100%x10% in=75 out=149 a_track=0 b_track=2 \
-transition composite:25%,25%:50%x50%! in=150 out=249 a_track=0 b_track=1 \
$*
out=199 \
a_track=1 \
b_track=2 \
out=199 \
a_track=1 \
b_track=2 \
-transition \
composite:0%,75%:100%x20%:0 \
in=50 \
-transition \
composite:0%,75%:100%x20%:0 \
in=50 \
mlt_properties_set_int( frame_properties, "width", mlt_properties_get_int( properties, "width" ) );
mlt_properties_set_int( frame_properties, "height", mlt_properties_get_int( properties, "height" ) );
mlt_properties_set( frame_properties, "rescale.interp", mlt_properties_get( properties, "rescale.interp" ) );
mlt_properties_set_int( frame_properties, "width", mlt_properties_get_int( properties, "width" ) );
mlt_properties_set_int( frame_properties, "height", mlt_properties_get_int( properties, "height" ) );
mlt_properties_set( frame_properties, "rescale.interp", mlt_properties_get( properties, "rescale.interp" ) );
- if ( mlt_properties_get( properties, "distort" ) )
- mlt_properties_set( frame_properties, "distort", mlt_properties_get( properties, "distort" ) );
+ if ( mlt_properties_get_int( properties, "distort" ) )
+ mlt_properties_set_int( frame_properties, "distort", mlt_properties_get_int( properties, "distort" ) );
mlt_properties_set_double( frame_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) );
mlt_properties_set_int( frame_properties, "consumer_deinterlace", mlt_properties_get_double( properties, "consumer_deinterlace" ) );
mlt_properties_set_int( frame_properties, "normalised_width", mlt_properties_get_double( properties, "normalised_width" ) );
mlt_properties_set_double( frame_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "consumer_aspect_ratio" ) );
mlt_properties_set_int( frame_properties, "consumer_deinterlace", mlt_properties_get_double( properties, "consumer_deinterlace" ) );
mlt_properties_set_int( frame_properties, "normalised_width", mlt_properties_get_double( properties, "normalised_width" ) );
mlt_properties_set_int( properties, "height", *height );
mlt_properties_set_double( properties, "aspect_ratio", mlt_frame_get_aspect_ratio( frame ) );
mlt_properties_set_int( properties, "progressive", mlt_properties_get_int( frame_properties, "progressive" ) );
mlt_properties_set_int( properties, "height", *height );
mlt_properties_set_double( properties, "aspect_ratio", mlt_frame_get_aspect_ratio( frame ) );
mlt_properties_set_int( properties, "progressive", mlt_properties_get_int( frame_properties, "progressive" ) );
- if ( mlt_properties_get( frame_properties, "distort" ) )
- mlt_properties_set( properties, "distort", mlt_properties_get( frame_properties, "distort" ) );
+ if ( mlt_properties_get_int( frame_properties, "distort" ) )
+ mlt_properties_set_int( properties, "distort", mlt_properties_get_int( frame_properties, "distort" ) );
data = mlt_frame_get_alpha_mask( frame );
mlt_properties_set_data( properties, "alpha", data, 0, NULL, NULL );
return 0;
data = mlt_frame_get_alpha_mask( frame );
mlt_properties_set_data( properties, "alpha", data, 0, NULL, NULL );
return 0;
static void scale_alpha( mlt_frame this, int iwidth, int iheight, int owidth, int oheight )
{
static void scale_alpha( mlt_frame this, int iwidth, int iheight, int owidth, int oheight )
{
- uint8_t *input = mlt_frame_get_alpha_mask( this );
+ int size = 0;
+ uint8_t *input = mlt_properties_get_data( MLT_FRAME_PROPERTIES( this ), "alpha", &size );
+ if ( input != NULL && ( size == iwidth * iheight ) || size == ( iwidth * ( iheight + 1 ) ) )
{
uint8_t *output = mlt_pool_alloc( owidth * oheight );
{
uint8_t *output = mlt_pool_alloc( owidth * oheight );
if ( rescale != NULL && !strcmp( rescale, "none" ) )
return mlt_frame_get_image( this, image, format, width, height, writable );
if ( rescale != NULL && !strcmp( rescale, "none" ) )
return mlt_frame_get_image( this, image, format, width, height, writable );
- if ( mlt_properties_get( properties, "distort" ) == NULL )
+ if ( mlt_properties_get_int( properties, "distort" ) == 0 )
{
// Normalise the input and out display aspect
int normalised_width = mlt_properties_get_int( properties, "normalised_width" );
{
// Normalise the input and out display aspect
int normalised_width = mlt_properties_get_int( properties, "normalised_width" );
if ( mlt_properties_get_int( properties, "distort" ) )
{
if ( mlt_properties_get_int( properties, "distort" ) )
{
- mlt_properties_set( MLT_TRANSITION_PROPERTIES( composite ), "distort", "true" );
- mlt_properties_set( a_props, "distort", "true" );
- mlt_properties_set( b_props, "distort", "true" );
+ mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( composite ), "distort", 1 );
+ mlt_properties_set_int( a_props, "distort", 1 );
+ mlt_properties_set_int( b_props, "distort", 1 );
}
if ( mlt_properties_get_int( properties, "reverse" ) == 0 )
}
if ( mlt_properties_get_int( properties, "reverse" ) == 0 )
scaled_height = normalised_height;
}
scaled_height = normalised_height;
}
- // Now apply the fill
- // TODO: Should combine fill/distort in one property
- if ( mlt_properties_get( properties, "fill" ) != NULL )
+ if ( mlt_properties_get_int( properties, "fill" ) )
- scaled_width = ( geometry->item.w / scaled_width ) * scaled_width;
- scaled_height = ( geometry->item.h / scaled_height ) * scaled_height;
+ if ( scaled_height < normalised_height && scaled_width * normalised_height / scaled_height < normalised_width )
+ {
+ scaled_width = scaled_width * normalised_height / scaled_height;
+ scaled_height = normalised_height;
+ }
+ else if ( scaled_width < normalised_width && scaled_height * normalised_width / scaled_width < normalised_height )
+ {
+ scaled_height = scaled_height * normalised_width / scaled_width;
+ scaled_width = normalised_width;
+ }
}
// Save the new scaled dimensions
}
// Save the new scaled dimensions
}
// We want to ensure that we bypass resize now...
}
// We want to ensure that we bypass resize now...
- mlt_properties_set( b_props, "distort", "true" );
+ mlt_properties_set_int( b_props, "distort", 1 );
// Take into consideration alignment for optimisation
if ( !mlt_properties_get_int( properties, "titles" ) )
// Take into consideration alignment for optimisation
if ( !mlt_properties_get_int( properties, "titles" ) )
// Assign this position to the b frame
mlt_frame_set_position( b_frame, frame_position );
// Assign this position to the b frame
mlt_frame_set_position( b_frame, frame_position );
- mlt_properties_set( b_props, "distort", "true" );
+ mlt_properties_set_int( b_props, "distort", 1 );
// Return the frame
return b_frame;
// Return the frame
return b_frame;
{
if ( mlt_properties_get( b_props, "rescale.interp" ) == NULL )
mlt_properties_set( b_props, "rescale.interp", "hyper" );
{
if ( mlt_properties_get( b_props, "rescale.interp" ) == NULL )
mlt_properties_set( b_props, "rescale.interp", "hyper" );
- mlt_properties_set( properties, "fill", NULL );
width_b = mlt_properties_get_int( a_props, "dest_width" );
height_b = mlt_properties_get_int( a_props, "dest_height" );
}
width_b = mlt_properties_get_int( a_props, "dest_width" );
height_b = mlt_properties_get_int( a_props, "dest_height" );
}
sprintf( key, "%s.", name );
// Just in case, let's assume that the filter here has a composite
sprintf( key, "%s.", name );
// Just in case, let's assume that the filter here has a composite
- mlt_properties_set( MLT_FILTER_PROPERTIES( filter ), "composite.start", "0%,0%:100%x100%" );
- mlt_properties_set( MLT_FILTER_PROPERTIES( filter ), "composite.fill", "true" );
+ //mlt_properties_set( MLT_FILTER_PROPERTIES( filter ), "composite.geometry", "0%,0%:100%x100%" );
+ //mlt_properties_set_int( MLT_FILTER_PROPERTIES( filter ), "composite.fill", 1 );
// Pass all the key properties on the filter down
mlt_properties_pass( MLT_FILTER_PROPERTIES( filter ), properties, key );
// Pass all the key properties on the filter down
mlt_properties_pass( MLT_FILTER_PROPERTIES( filter ), properties, key );
mlt_image_format format = mlt_image_yuv422;
// Get the shape image to trigger alpha creation
mlt_image_format format = mlt_image_yuv422;
// Get the shape image to trigger alpha creation
- mlt_properties_set( MLT_FRAME_PROPERTIES( shape_frame ), "distort", "true" );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( shape_frame ), "distort", 1 );
mlt_frame_get_image( shape_frame, &image, &format, ®ion_width, ®ion_height, 0 );
alpha = mlt_frame_get_alpha_mask( shape_frame );
mlt_frame_get_image( shape_frame, &image, &format, ®ion_width, ®ion_height, 0 );
alpha = mlt_frame_get_alpha_mask( shape_frame );
*p ++ = *image ++;
image ++;
}
*p ++ = *image ++;
image ++;
}
- mlt_properties_set_data( MLT_FRAME_PROPERTIES( shape_frame ), "alpha", alpha,
- region_width * region_height, mlt_pool_release, NULL );
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "alpha", alpha, region_width * region_height, mlt_pool_release, NULL );
+ else
+ {
+ mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "alpha", alpha, region_width * region_height, NULL, NULL );
+ }
+
+ this->get_alpha_mask = NULL;
mlt_properties composite_properties = MLT_TRANSITION_PROPERTIES( composite );
// We want to ensure that we don't get a wobble...
mlt_properties composite_properties = MLT_TRANSITION_PROPERTIES( composite );
// We want to ensure that we don't get a wobble...
- mlt_properties_set( composite_properties, "distort", "true" );
- mlt_properties_set( composite_properties, "progressive", "1" );
+ mlt_properties_set_int( composite_properties, "distort", 1 );
+ mlt_properties_set_int( composite_properties, "progressive", 1 );
// Pass all the composite. properties on the transition down
mlt_properties_pass( composite_properties, properties, "composite." );
// Pass all the composite. properties on the transition down
mlt_properties_pass( composite_properties, properties, "composite." );
.filter[1]=watermark
.filter[1].resource=pango:
.filter[1].producer.markup=File Shot
.filter[1]=watermark
.filter[1].resource=pango:
.filter[1].producer.markup=File Shot
-.filter[1].producer.font=San 20
-.filter[1].composite.geometry=1%,1%:99%x99%:15;25=1%,1%:99%x99%:100
+.filter[1].producer.font=San 18
+.filter[1].composite.geometry=0%,0%:100%x100%:15;25=0%,0%:100%x100%:100
.filter[1].composite.titles=0
.filter[1].composite.halign=centre
.filter[1].composite.valign=centre
.filter[1].composite.titles=0
.filter[1].composite.halign=centre
.filter[1].composite.valign=centre
.filter[1].resource=pango:
.filter[1].producer.markup=File Shot
.filter[1].producer.font=San 20
.filter[1].resource=pango:
.filter[1].producer.markup=File Shot
.filter[1].producer.font=San 20
-.filter[1].composite.geometry=1%,1%:99%x99%:15;25=1%,1%:99%x99%:100
-.filter[1].composite.titles=0
+.filter[1].composite.geometry=0%,0%:100%x100%:15;25=0%,0%:100%x100%:100
+.filter[1].composite.titles=1
.filter[1].composite.halign=centre
.filter[1].composite.valign=centre
.filter[1].composite.halign=centre
.filter[1].composite.valign=centre
mlt_properties_pass( MLT_TRANSITION_PROPERTIES( transition ), properties, "transition." );
mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &a_frame, 0 );
mlt_properties_set( MLT_FRAME_PROPERTIES( a_frame ), "rescale.interp", "nearest" );
mlt_properties_pass( MLT_TRANSITION_PROPERTIES( transition ), properties, "transition." );
mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &a_frame, 0 );
mlt_properties_set( MLT_FRAME_PROPERTIES( a_frame ), "rescale.interp", "nearest" );
- mlt_properties_set( MLT_FRAME_PROPERTIES( a_frame ), "distort", "true" );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( a_frame ), "distort", 1 );
mlt_properties_set_double( MLT_FRAME_PROPERTIES( a_frame ), "consumer_aspect_ratio",
mlt_properties_get_double( frame_properties, "consumer_aspect_ratio" ) );
mlt_transition_process( transition, a_frame, this );
mlt_properties_set_double( MLT_FRAME_PROPERTIES( a_frame ), "consumer_aspect_ratio",
mlt_properties_get_double( frame_properties, "consumer_aspect_ratio" ) );
mlt_transition_process( transition, a_frame, this );
mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
}
mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
}
- mlt_properties_set( b_props, "distort", mlt_properties_get( properties, "distort" ) );
+ mlt_properties_set_int( b_props, "distort", mlt_properties_get_int( properties, "distort" ) );
mlt_frame_get_image( b_frame, &b_image, &b_format, &b_width, &b_height, 0 );
result.w = b_width;
result.h = b_height;
mlt_frame_get_image( b_frame, &b_image, &b_format, &b_width, &b_height, 0 );
result.w = b_width;
result.h = b_height;
{
mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "sx", 1 );
mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "sy", 1 );
{
mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "sx", 1 );
mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "sy", 1 );
- mlt_properties_set( MLT_TRANSITION_PROPERTIES( transition ), "distort", NULL );
+ mlt_properties_set_int( MLT_TRANSITION_PROPERTIES( transition ), "distort", 0 );
mlt_properties_set( MLT_TRANSITION_PROPERTIES( transition ), "start", "0,0:100%x100%" );
transition->process = transition_process;
}
mlt_properties_set( MLT_TRANSITION_PROPERTIES( transition ), "start", "0,0:100%x100%" );
transition->process = transition_process;
}