Skip to content

Openfx v3#1204

Open
bmatherly wants to merge 50 commits intomasterfrom
openfx
Open

Openfx v3#1204
bmatherly wants to merge 50 commits intomasterfrom
openfx

Conversation

@bmatherly
Copy link
Copy Markdown
Member

Work on openfx module continued from this PR: #1186

mr.fantastic and others added 30 commits February 22, 2026 15:13
- handle the Microsoft Visual C++ compiler in module CMakeLists.txt
- Change every copyright to the year 2025
- Use C99 variables in the for loop initializer declare style
- Clang format and include <stdbool.h> explicitly
- specify which versions of OpenFX supported
- mention OpenFX header files URL in mlt_openfx.c
- using mlt_image and its functions in src/modules/openfx/filter_openfx.c
…escribe in context action required by some plugins such as net.sf.openfx.Mirror to function
@bmatherly
Copy link
Copy Markdown
Member Author

@joinlaw , I have not fixed the flip crash yet. But in the meantime, can you test this branch with your working copy? Thanks!

@joinlaw
Copy link
Copy Markdown
Contributor

joinlaw commented Mar 3, 2026

@joinlaw , I have not fixed the flip crash yet. But in the meantime, can you test this branch with your working copy? Thanks!

Nice. I will try it once I have free time an I will debug the mirror plugin also to see if I can find anything to deal with this crashes.

@luzpaz
Copy link
Copy Markdown
Contributor

luzpaz commented Mar 18, 2026

An aside, just x-refing downstream tracker tickets that are tracking the progress of this implementation:

@joinlaw
Copy link
Copy Markdown
Contributor

joinlaw commented Mar 28, 2026

@joinlaw I think I have resolved our comments. Feel free to give it another try.

My only remaining issue is that I still get crashes when I run:

melt test.mp4 -filter openfx.net.sf.openfx.Mirror flop=1

If I can figure that out, this branch should be ready to merge.

The input/output clip pixel aspect ratio might be the cause of that because I see when image flopped it get cut outside of rendering area then repeat which might mean that we are accessing x coord that is bigger than image width or less than 0

Try this it might fix the issue by setting pixel aspect ratio of the input/output clip to 1.0

diff --git a/src/modules/openfx/mlt_openfx.c b/src/modules/openfx/mlt_openfx.c
index 40cd6b73..7fbaf8ac 100644
--- a/src/modules/openfx/mlt_openfx.c
+++ b/src/modules/openfx/mlt_openfx.c
@@ -1662,7 +1662,8 @@ void mltofx_set_source_clip_data(OfxPlugin *plugin,
     propSetDouble((OfxPropertySetHandle) clip_prop,
                   kOfxImagePropPixelAspectRatio,
                   0,
-                  (double) width / (double) height);
+                  //(double) width / (double) height);
+                 1.0);
 
     propSetString((OfxPropertySetHandle) clip_prop,
                   kOfxImageEffectPropPreMultiplication,
@@ -1798,7 +1799,8 @@ void mltofx_set_output_clip_data(OfxPlugin *plugin,
     propSetDouble((OfxPropertySetHandle) clip_prop,
                   kOfxImagePropPixelAspectRatio,
                   0,
-                  (double) width / (double) height);
+                  //(double) width / (double) height);
+                 1.0);
 }
 
 int mltofx_detect_plugin(OfxPlugin *plugin)

This fixes a crash with the Mirror plugin
@bmatherly bmatherly marked this pull request as ready for review March 28, 2026 23:30
@bmatherly bmatherly requested a review from ddennedy March 28, 2026 23:31
@bmatherly
Copy link
Copy Markdown
Member Author

@joinlaw, thanks for the aspect ratio hint. I implemented your idea in a different way and it is not crashing for me.

@ddennedy I think this is ready to be merged. I wanted to give you one last chance to review before we merge it.

Is there a way that we could mark this as "experimental" or "beta" for a couple of months until it has more testing behind it?

@joinlaw
Copy link
Copy Markdown
Contributor

joinlaw commented Mar 31, 2026

@joinlaw, thanks for the aspect ratio hint. I implemented your idea in a different way and it is not crashing for me.

@ddennedy I think this is ready to be merged. I wanted to give you one last chance to review before we merge it.

Is there a way that we could mark this as "experimental" or "beta" for a couple of months until it has more testing behind it?

do you mean by "experimental" making it disabled by default in CMake build files? if so we will have less tester than having it enabled. If not then I think we can put this in the filter_openfx.yml file maybe in tags attribute or description.

@ddennedy
Copy link
Copy Markdown
Member

Re: experimental, normally I would say to add (*EXPERIMENTAL*) to the title metadata (this is what we have done for deprecated). However, it looks like these titles might be rather long because of the namespace. I like the idea to use tags

@bmatherly
Copy link
Copy Markdown
Member Author

Re: experimental, normally I would say to add (EXPERIMENTAL) to the title metadata (this is what we have done for deprecated). However, it looks like these titles might be rather long because of the namespace. I like the idea to use tags

I like that idea. Done. Let's remember to remove it after the module gets some maturity.

Copy link
Copy Markdown
Member

@ddennedy ddennedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of minor things upon high level review and test. I am not going to get into too much of the details since I trust the two of you. I tested successfully on Windows with the ntsc-rs plugin. I just tested the free GoPro 360 video reframe plugin, and its presence is crashing melt.
https://community.gopro.com/s/article/GoPro-Reframe-For-DaVinci-Resolve

#0  0x00007ffeed5f73fa in RaiseException () from C:\WINDOWS\System32\KernelBase.dll
#1  0x00007ffed05a52c7 in _CxxThrowException () from C:\WINDOWS\SYSTEM32\vcruntime140.dll
#2  0x00007ffdc089efcd in gopro-reframe!OfxSetHost () from C:\Program Files\Common Files\OFX\Plugins\gopro-reframe.ofx.bundle\Contents\Win64\gopro-reframe.ofx
#3  0x00007ffdc0898795 in gopro-reframe!OfxSetHost () from C:\Program Files\Common Files\OFX\Plugins\gopro-reframe.ofx.bundle\Contents\Win64\gopro-reframe.ofx
#4  0x00007ffdc0dc5629 in mltofx_detect_plugin (plugin=plugin@entry=0x7ffdc0aec0e0) at C:/Projects/Shotcut/src/mlt/src/modules/openfx/mlt_openfx.c:1825
#5  0x00007ffdc0dc1654 in scan_ofx_dir (repository=repository@entry=0x1b9ce0, dir=dir@entry=0x5ff670 "C:\\Program Files\\Common Files\\OFX\\Plugins", dli=dli@entry=0x5ff55c)
    at C:/Projects/Shotcut/src/mlt/src/modules/openfx/factory.c:195
#6  0x00007ffdc0dc1aa1 in mlt_register (repository=0x1b9ce0) at C:/Projects/Shotcut/src/mlt/src/modules/openfx/factory.c:266
#7  0x00007ffdf2d69fc5 in mlt_repository_init (directory=<optimized out>) at C:/Projects/Shotcut/src/mlt/src/framework/mlt_repository.c:157
#8  0x00007ffdf2d4bae5 in mlt_factory_init (directory=<optimized out>) at C:/Projects/Shotcut/src/mlt/src/framework/mlt_factory.c:213
#9  0x00007ff75cce1dce in setup_factory (repo_path=<optimized out>, set_locale=0) at C:/Projects/Shotcut/src/mlt/src/melt/melt.c:741
#10 0x00007ff75cce3240 in SDL_main (argc=4, argv=0x6a22f0) at C:/Projects/Shotcut/src/mlt/src/melt/melt.c:813
#11 0x00007ff75cce561c in main_getcmdline ()
#12 0x00007ff75cce10d9 in __tmainCRTStartup () at D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:260
#13 0x00007ff75cce1456 in mainCRTStartup () at D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:129

thoughts?

ddennedy added 3 commits April 1, 2026 10:08
I found this with the GoPro Reframe plugin, which throws C++ exception
when the host does not set all of its properties.
@ddennedy
Copy link
Copy Markdown
Member

ddennedy commented Apr 1, 2026

I just tested the free GoPro 360 video reframe plugin, and its presence is crashing melt.

I found a fix for this (some missing host properties).

@ddennedy ddennedy added this to the v7.38.0 milestone Apr 3, 2026
@ddennedy
Copy link
Copy Markdown
Member

ddennedy commented Apr 3, 2026

I am done with making changes on this branch. @bmatherly please review my recent changes, probably easiest by commit before I merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants