Thanks for your solution. I will try it. I think the filter should follow LGPL license, I can provide all my modifications to MLT including the filter later on. The filter works as a link to other video processing logic, the actual SR logic are from other dynamic binary, which can be proprietary.
Dan Dennedy <ddenn...@gmail.com> 于2022年5月4日周三 04:09写道: > > > On Tue, May 3, 2022 at 7:34 AM Michael Ren <renpeira...@gmail.com> wrote: > >> Thanks for your kind reply. In my scenario, a user may randomly try to >> apply a filter to an opened video. If the filter is SR, it means that the >> user needs better resolution of the video (not just linear interpolation). >> The decision is on the fly, and the SR filter should receive the original >> size of the video frame as input, rather than a resized one (produced by a >> default producer with the normalize filter). >> > > You should have seen this when viewing filter_resize.c on which you based > your filter. You can stop the automatic scaling by setting frame property > consumer.rescale = "none" before calling mlt_frame_get_image(). > > > >> And after manual job is done, the user may export the result video in >> arbitrary resolution. >> >> I have just managed to hack a temporal solution for my problem, that is >> to directly communicate between my SR filter and consumer_avformat.c so >> that my SR filter knows what resolution to export and then resizes the >> frame to the video exporting size inside the filter. This solution works, >> but the logic is ugly and requires more work to generalize. >> > > That is wrong and will not be accepted. The user requests the resolution > using the width and height properties on the consumer or MLT profile. These > values will be supplied to your filter's get_image() callback function as > arguments as brian already explained. > > Please give a link to your source code for further help. Also, what are > the dependencies and license of your filter. It requires its MLT module if > you are adding new library dependencies. > > >> >> Brian Matherly <brian.mathe...@yahoo.com> 于2022年5月3日周二 10:04写道: >> >>> I think you will need to give more information about what you are trying >>> to accomplish. I do not understand why you would make a filter to double >>> the dimensions of the image. >>> >>> In MLT, the consumer expects to receive the image size that it has >>> requested. The producer has normalize filters (like resize) to ensure that >>> happens. If you want your consumer to receive a different size image, then >>> you should configure your consumer to request that size. >>> >>> On Monday, May 2, 2022, 05:43:49 AM CDT, Michael Ren < >>> renpeira...@gmail.com> wrote: >>> >>> >>> Hey, MLT guys >>> >>> I have added a video SR filter (super-resolution) to MLT, and use it in >>> Shotcut. However, the filter does not work very well. The problem is that >>> the profile width/height from source video (e.g. iw, ih) is different from >>> the frame size after the SR filter processing (e.g. 2*iw, 2*ih), and also >>> the exported video can have another size. As a result, the exported video >>> can be part of the frame generated by my SR filter, if the exported video >>> size is set to be smaller than 2*iw, 2*ih. >>> >>> I code the SR filter, referring to the >>> mlt\src\modules\core\filter_resize.c. Should I move to another reference or >>> should I set some frame property to let the MLT know that the frame size >>> has been changed by my filter? >>> >>> Thank you very much! >>> Best regards >>> _______________________________________________ >>> 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 >> >
_______________________________________________ Mlt-devel mailing list Mlt-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mlt-devel