Skip to content

Fix avformat, frei0r and openfx metadata#1220

Merged
ddennedy merged 6 commits intomasterfrom
fix-metadata
Apr 17, 2026
Merged

Fix avformat, frei0r and openfx metadata#1220
ddennedy merged 6 commits intomasterfrom
fix-metadata

Conversation

@ddennedy
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts dynamically generated metadata (and its YAML serialization) for multiple modules to better conform to MLT’s metadata schema expectations.

Changes:

  • OpenFX: emit normalized_coordinates as YAML-style booleans (yes/no) instead of integers.
  • frei0r: add missing top-level metadata field language: en.
  • Framework: treat * as a reserved YAML character to ensure correct quoting during YAML serialization.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/modules/openfx/mlt_openfx.c Aligns normalized_coordinates output with schema bool expectations by using yes/no.
src/modules/frei0r/factory.c Adds required language metadata when generating frei0r YAML dynamically.
src/framework/mlt_properties.c Improves YAML output correctness by quoting strings containing *.

@ddennedy
Copy link
Copy Markdown
Member Author

ddennedy commented Apr 14, 2026

Update: Resolved

There is an issue remaining I have locally with an OpenFX filter:

CMake Error at /home/ddennedy/src/mlt/src/tests/kwalify_runtime_query.cmake:151 (message):


  [openfx.net.sf.openfx.Card3D]

      /home/ddennedy/src/mlt/build/Desktop_Qt_6_10_1-Debug/src/tests/kwalify_filters_openfx.net.sf.openfx.Card3D.yml#0: INVALID
        - [/parameters/86/minimum] '1e-08': not a number.
        - [/parameters/87/minimum] '1e-08': not a number.

The problem is that our YAML serializer in mlt_properties.c does not know the schema and that this property is numeric, combined with the fact that kwalify does not accept scientific notation even though YAML does. The pykwalify fork does, however.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/framework/mlt_properties.c:2172

  • is_numeric_identifier takes char *s even though it only reads from the string. In this file, it is called with const char *value, so this drops const and can trigger compiler warnings (or fail builds if -Werror). Make the parameter const char *s (and keep the function read-only).
static inline int is_numeric_identifier(const char *name, char *s)
{
    if (strcmp(name, "identifier"))
        return 0;

    while (*s) {
        if (!isdigit((unsigned char) *s))
            return 0;
        s++;
    }
    return 1;

Comment thread src/framework/mlt_properties.c Outdated
@ddennedy ddennedy added this to the v7.38.0 milestone Apr 14, 2026
@bmatherly
Copy link
Copy Markdown
Member

The problem is that our YAML serializer in mlt_properties.c does not know the schema and that this property is numeric

But the service that is generating the metadata knows. Maybe the service could convert the value before generating metadata with it.

combined with the fact that kwalify does not accept scientific notation even though YAML does

I think we should not put scientific notation in the metadata so that applications do not have to deal with that complication. We could write a simple function to convert scientific notation to decimal and pass decimal through. Then, the functions that generate metadata could call that.

I see you added a function to our properties yaml function to detect the "identifier" - does that mean our yaml parser is really a "MLT metadata YAML" parser?

@ddennedy
Copy link
Copy Markdown
Member Author

Maybe the service could convert the value before generating metadata with it.

The metadata should be usable via API without parsing YAML. For example, your Shotcut branch is not, right? My comment is about problems with YAML serialization and kwalify.

I think we should not put scientific notation in the metadata

But it's not. It is a double value. Or, do you mean the YAML? Well, maybe but many humans and YAML parsers DO handle it. My hack to convert "1e-08" to "0.00000001" is just a workaround to get tests passing. The problem is how to generalize. At that spot, the double property is retrieved as string, which gets printf-ed using "%g". I am reluctant to change that because I do not want every real number shown with a large number of zeroes in the decimal portion. How to generalize the below?

                } else if (!strcmp(value, "1e-08")) {
                    // Special case for numeric values not accepted by kwalify
                    strbuf_printf(output, "%.8f\n", 1e-8);

Interestingly, I see other metadata numeric values in scientific notation that it does not complain about. 🤔 It looks like kwalify only has a problem when the coefficient is an integer! But I noticed it does not have a problem with a default with the same form. So, I can change the schema to be more flexible and remove that.

detect the "identifier" - does that mean our yaml parser is really a "MLT metadata YAML" parser?

It is a serializer that is primarily concerned with our metadata, yes. But also Shotcut uses for saving presets.

@ddennedy
Copy link
Copy Markdown
Member Author

I decided after some conversation with you and Claude to keep the intent of the schema and generalize the scientific to fixed point conversion. Maybe that can improve Shotcut's UI generator too, but hmm, it seems to treat a "minimum: 0.000030" as 0 currently.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread src/framework/mlt_properties.c
Comment thread src/framework/mlt_properties.c
@ddennedy ddennedy requested a review from bmatherly April 15, 2026 00:46
@ddennedy ddennedy merged commit fc626bf into master Apr 17, 2026
25 checks passed
@ddennedy ddennedy deleted the fix-metadata branch April 17, 2026 18:21
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.

3 participants