On Fri, Dec 7, 2018 at 11:27 AM jb <j...@kdenlive.org> wrote:

> Hi,
>
> In shotcut, the <consumer> tag is used in the playlist's xml to pass
> consumer
> arguments, allowing to render a playlist file with melt whitout passing
> extra
> arguments.
>
> I am considering using the same approach for Kdenlive, but there is one
> small
> missing feature for us:
>
> it would be useful to allow rendering only part of the playlist using this
> method. My idea was to allow in/out attributes on the consumer that would
> then
> be passed on the producer to allow rendering only a part of the project.
>
> A simple patch to melt, like mine below, implements the feature.
>
> Would you be ok to include such feature ?
>
>
Yes, go ahead and commit it directly.


> Thanks
> Jean-Baptiste
>
> ---------------------------------------------------------------
> diff --git a/src/melt/melt.c b/src/melt/melt.c
> index ab3a0ab4..300f9c88 100644
> --- a/src/melt/melt.c
> +++ b/src/melt/melt.c
> @@ -972,11 +972,18 @@ query_all:
>
>                         // Get the last group
>                         mlt_properties group = mlt_properties_get_data(
> melt_props,
> "group", 0 );
> -
> +
>                         // Apply group settings
>                         mlt_properties properties =
> MLT_CONSUMER_PROPERTIES( consumer
> );
>                         mlt_properties_inherit( properties, group );
> -
> +                       int in = mlt_properties_get_int( properties, "in"
> );
> +                       int out = mlt_properties_get_int( properties,
> "out" );
> +                       if ( in > 0 || out > 0 ) {
> +                               if ( out == 0 ) {
> +                                       out = mlt_producer_get_length(
> melt ) - 1;
> +                               }
> +                               mlt_producer_set_in_and_out(melt, in, out);
> +                       }
>                         // Connect consumer to melt
>                         mlt_consumer_connect( consumer,
> MLT_PRODUCER_SERVICE( melt )
> );
>
>
>
>
> _______________________________________________
> Mlt-devel mailing list
> Mlt-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mlt-devel
>
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to