Hi!

Currently, there is a bug in the region filter which prevents it from working

in multi track playlists.


For example, when issuing the following command:


melt -profile dv_pal colour:red -track colour:blue -attach region:circle

filter0=brightness:2


You expect to get a blue background with a light blue circle. But currently, the

region filter behaves exactly like the region transition, meaning that you will

end with a red background with a light blue circle.


My attached patch fixes that behavior when setting the "filter_only" property.

It means that doing:


melt -profile dv_pal colour:red -track colour:blue -attach region:circle

filter0=brightness:2 filter_only=1


Will give you the expected light blue circle on blue background.

This can bring some really exciting features to Kdenlive, combined with the

rotoscoping filter. You can for example create an animated mask using the

rotoscoping filter, like my attached spline.mlt


Then, feeding this mask to the region filter, you can apply effects on the mask

zone only, test it with:


melt -profile dv_pal colour:blue -attach region:spline.mlt filter0=brightness:2

filter_only=1


I am not sure my patch is the best way to fix the issue, but at least it seems

to work.


Ok, now I should probably concentrate on the Kdenlive release...


regards

jb

________________________________________________________________

Region filter patch:

diff --git a/src/modules/core/transition_region.c

b/src/modules/core/transition_region.c

index afab7f6..9672162 100644

--- a/src/modules/core/transition_region.c

+++ b/src/modules/core/transition_region.c

@@ -292,6 +292,13 @@ static int transition_get_image( mlt_frame frame, uint8_t

**image, mlt_image_for

char *name = mlt_properties_get( properties,

"_unique_id" );

mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame

), name, b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );

}

+

+ if ( mlt_properties_get_int( properties, "filter_only" ) )

+ {

+ frame = composite_copy_region( composite, b_frame,

position );

+ }

+

+

// Make sure the filter is in the correct position

while ( filter != NULL )

<?xml version="1.0" encoding="utf-8"?>
<mlt LC_NUMERIC="en_US.UTF-8" root="/home/two" title="colour:black">
  <profile description="DV/DVD PAL" width="720" height="576" progressive="0" sample_aspect_num="16" sample_aspect_den="15" display_aspect_num="4" display_aspect_den="3" frame_rate_num="25" frame_rate_den="1" colorspace="601"/>
  <producer id="producer0" in="0" out="14999">
    <property name="mlt_type">producer</property>
    <property name="length">15000</property>
    <property name="eof">pause</property>
    <property name="resource">black</property>
    <property name="aspect_ratio">1.066667</property>
    <property name="mlt_service">colour</property>
    <filter id="filter0">
      <property name="track">0</property>
      <property name="mode">alpha</property>
      <property name="alpha_operation">clear</property>
      <property name="invert">0</property>
      <property name="feather">3</property>
      <property name="feather_passes">1</property>
      <property name="mlt_type">filter</property>
      <property name="mlt_service">rotoscoping</property>
      <property name="spline">{ "000" : [ [ [ 0.277343, 0.291822 ], [ 0.278211, 0.367694 ], [ 0.27913, 0.448073 ] ], [ [ 0.280053, 0.528437 ], [ 0.280842, 0.609341 ], [ 0.340302, 0.60795 ] ], [ [ 0.401227, 0.607802 ], [ 0.462121, 0.607628 ], [ 0.520456, 0.607461 ] ], [ [ 0.578762, 0.607269 ], [ 0.635723, 0.605937 ], [ 0.635464, 0.528581 ] ], [ [ 0.634943, 0.448072 ], [ 0.634425, 0.367609 ], [ 0.633921, 0.28944 ] ], [ [ 0.633422, 0.211315 ], [ 0.63317, 0.136166 ], [ 0.571314, 0.13509 ] ], [ [ 0.512999, 0.137036 ], [ 0.451884, 0.138622 ], [ 0.396963, 0.140047 ] ], [ [ 0.339781, 0.141181 ], [ 0.275735, 0.13957 ], [ 0.276479, 0.215937 ] ] ], "161" : [ [ [ 0.376992, 0.305392 ], [ 0.377859, 0.381264 ], [ 0.378779, 0.461643 ] ], [ [ 0.280053, 0.528437 ], [ 0.280842, 0.609341 ], [ 0.340302, 0.60795 ] ], [ [ 0.401218, 0.510795 ], [ 0.462112, 0.510621 ], [ 0.520447, 0.510454 ] ], [ [ 0.578762, 0.607269 ], [ 0.635723, 0.605937 ], [ 0.635464, 0.528581 ] ], [ [ 0.541776, 0.475344 ], [ 0.541258, 0.39488 ], [ 0.540755, 0.316712 ] ], [ [ 0.633422, 0.211315 ], [ 0.63317, 0.136166 ], [ 0.571314, 0.13509 ] ], [ [ 0.52578, 0.253725 ], [ 0.464665, 0.25531 ], [ 0.409744, 0.256736 ] ], [ [ 0.339781, 0.141181 ], [ 0.275735, 0.13957 ], [ 0.276479, 0.215937 ] ] ] }</property>
    </filter>
  </producer>
  <playlist id="playlist0">
    <entry producer="producer0" in="0" out="14999"/>
  </playlist>
  <tractor id="tractor0" title="colour:black" global_feed="1" in="0" out="14999">
    <track producer="playlist0"/>
  </tractor>
</mlt>
diff --git a/src/modules/core/transition_region.c b/src/modules/core/transition_region.c
index afab7f6..9672162 100644
--- a/src/modules/core/transition_region.c
+++ b/src/modules/core/transition_region.c
@@ -292,6 +292,13 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
 			char *name = mlt_properties_get( properties, "_unique_id" );
 			mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame ), name, b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL );
 		}
+		
+		if ( mlt_properties_get_int( properties, "filter_only" ) )
+		{
+			frame = composite_copy_region( composite, b_frame, position );
+		}
+		
+	
 
 		// Make sure the filter is in the correct position
 		while ( filter != NULL )
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to