On Monday, April 18, 2016 12:02:51 AM CEST, Dan Dennedy wrote: > For some reason, this did not appear in the mailman management > interface to allow me to approve it.
Hi Dan, Thinking more about it, I found a workaround for Kdenlive. I was finally not sure that my message was really relevant. As it was held back for approval, I discarded the message to think more about it.. The described problem (mlt_filter_get_length2 returning incorrect length) is still here but does not cause so much trouble so not a top priority thing. Thanks, jb > ---------- Forwarded message --------- > From: <mlt-devel-ow...@lists.sourceforge.net> > Date: Sat, Apr 16, 2016 at 12:16 PM > Subject: Mlt-devel post from j...@kdenlive.org requires approval > To: <mlt-devel-ow...@lists.sourceforge.net> > > > As list administrator, your authorization is requested for the > following mailing list posting: > > List: Mlt-devel@lists.sourceforge.net > From: j...@kdenlive.org > Subject: Problem with mlt_filter_get_length2 > Reason: The message headers matched a filter rule > > At your convenience, visit: > > https://lists.sourceforge.net/lists/admindb/mlt-devel > > to approve or deny the request. > > > > ---------- Forwarded message ---------- > From: Jean-Baptiste Mardelle <j...@kdenlive.org> > To: <mlt-devel@lists.sourceforge.net> > Cc: > Date: Sat, 16 Apr 2016 21:15:46 +0200 > Subject: Problem with mlt_filter_get_length2 > Hi, > > While working on filters with 2 pass analyse feature, I ran into a problem > with mlt_filter_get_length2. > Looking at the code, mlt_filter_get_length2 returns the length not from the > producer it is attached but from the parent of the producer it is attached > to: > > mlt_filter.c, line 256 > > if ( producer ) > { > producer = mlt_producer_cut_parent( producer ); <---- > gets parent of the > cut > in = mlt_producer_get_in( producer ); > out = mlt_producer_get_out( producer ); > } > > But in Kdenlive the length of a clip in a playlist may not be the same at > the one of its parent. > For example we can have this xml: > > <producer id="producer0" out="2000" in="0"> > (...) > <playlist> > <entry producer="producer0" in="200" out="1000"> > </playlist> > > So if we apply an effect to the clip in playlist, the filter length is 800, > but mlt_filter_get_length2 will return 2000 (length of parent clip). > > In mlt_filter_get_length2, removing the above line > "mlt_producer_cut_parent" fixes the issue and returns a correct length of > 800. However, seeing how it is used in MLT, this fix is not really wanted, > but maybe the documentation should be updated... > > Now my problem is that some filters, like loudness and vidstab perform > analysis on the frames, and save data when processing the last frame of the > filter. > > Currently, last frame is checked like this: > > if ( mlt_filter_get_position( filter, frame ) + 1 == > mlt_filter_get_length2( filter, frame ) ) {} > > This does not work in Kdenlive, and these filters never produce a result > because with my above example, last frame of the filter is 1000 and filter > length is 2000. > My proposal would be to introduce a new function, mlt_filter_get_out2 that > retturns the real last frame of the filter, like this: > > mlt_position mlt_filter_get_out2( mlt_filter self, mlt_frame frame ) > { > mlt_properties properties = MLT_SERVICE_PROPERTIES( &self->parent ); > mlt_position out = mlt_properties_get_position( properties, "out" ); > if ( out == 0 && frame ) > { > // If always active, use the frame's producer > mlt_producer producer = > mlt_frame_get_original_producer( frame ); > if ( producer ) > { > out = mlt_producer_get_out( producer ); > } > } > return out; > } > > We can then compare this value to mlt_filter_get_position to know if the > filter reached last frame. > What do you think about it ? Do you have another idea / proposal on how to > solve this issue ? > > Thanks > jb > > > > ------------------------------------------------------------------------------ > Find and fix application performance issues faster with Applications Manager > Applications Manager provides deep performance insights into > multiple tiers of > your business applications. It resolves application problems quickly and > reduces your MTTR. Get your free trial! > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z > ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Mlt-devel mailing list Mlt-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mlt-devel