10bit frei0r plugin format?

Hello

Thanks for this wonderful software. I have a frei0r plugin I wrote to do some image correction for underwater footage (colours, add zing, etc.) and I know it works by having void f0r_update(f0r_instance_t instance, double time, const uint32_t* inframe, uint32_t* outframe) called on each frame.

I am currently putting my custom underwater.dll into C:\Program Files\Shotcut\lib\frei0r-1, and the equivalent files under C:\Program Files\Shotcut\share\shotcut\qml\filters\underwater. It all works very well (many thanks).
I was wondering what I need to do to make this support 10 bit pixel data? Frei0r works on 8 bit, eg. void f0r_update(f0r_instance_t instance, double time, const uint32_t* inframe, uint32_t* outframe) means inframe is an array of uint32_t, where each uint32_t represents a single pixel. This is usually packed as 0xAARRGGBB (alpha, red, green, blue), with each channel being 8 bits.

Is there some sort of “frei0r” 10 bit where the inframe is uint64_t or something? How does Shotcut differentiate between 8 bit and 10 bit plugins? Is there some DLL export I need to expose?

Thank you

That is not available for frei0r. We are planning to add OpenFX whose API that allows for a lot more capabilities as well as commercial plugins. There is a MLT pull request for OpenFX that is merging any day now, but that will not be available in Shotcut until the release after next.

Another thing you can do is to make a MLT plugin and that works today. You’ll need to study these options on your own.

OK that’s fine. Thank you for the information. I will take a look at MLT and OpenFX and port the code to that.

Thank you

May I enquire where in the Shotcut source tree the existing MLT plugins sit? I will look through them

I do not understand the question. MLT is one of the two main libraries Shotcut directly uses. It is the engine and the parent project of Shotcut. There are no plugins directly in Shotcut, only plugin UIs. All plugin UIs are in src/qml/filters, and they all go through MLT since it is the engine. MLT provides a bridge to various plugins and libraries including frei0r, LADSPA, FFmpeg, Qt, etc.

I had found the src/qml/filters directory and assumed there were matching source CPP files for the actual filters themselves, rather than them being just UI files.

Since Shotcut is distributed in a binary format with filters included, it must grab them from somewhere for a build to occur such that the UI presented for a filter actually points to a binary “thing” that does the filter work? eg. the blur plugin has a UI and must have a corresponding binary object that does the processing.

So I was trying to find where the source was for the MLT filters in CPP terms so that I could look at how they are constructed and migrate my frei0r plugin to MLT.

Hopefully that is clearer?

All the filters in src/qml/filters map to a filter service provided by MLT. Here is the full list:

Some of those filter services are natively implemented in MLT. Many of them are wrappers around services provided by other libraries. Most of those “wrapped” filters have a namespace prefix like “avfliter” or “frei0r”.

If you want to know what service is providing the underlying functionality for a QML filter ui, look in the meta.qml file.

OK thank you both. I will see what I can deduce. Thanks for the info and links.