Skip to content

Conversation

balooii
Copy link

@balooii balooii commented Aug 6, 2025

Hi!

I think it would be a nice addition for the qtblend filter to be able to set the rotation anchor point so you can rotate around any point you want.

I (mis)used a rect type parameter for this as I didn't find a point-equivalent parameter type and just used x and y component out of it.

If you're interested in this change I'd be happy to change it to something more appropriate if you can guide me 🙂

Here are some examples how it could be used:

Rotate around bottom-right corner (1,1)

melt -profile hdv_720_25p color:red length=100 -filter qtblend rect="100 100 200 200 1" rotation=90 rotate_anchor="1 1 0 0 0" -consumer avformat:test_bottomright.mp4

Rotate around some point outside the rectangle (-0.5, 0.5)

melt -profile hdv_720_25p color:red length=100 -filter qtblend rect="100 100 200 200 1" rotation=45 rotate_anchor="-0.5 0.5 0 0 0" -consumer avformat:test_outside.mp4

Rotate around center (0.5, 0.5), equivalent to rotate_center set to 1

melt -profile hdv_720_25p color:red length=100 -filter qtblend rect="100 100 200 200 1" rotation=45 rotate_anchor="0.5 0.5 0 0 0" -consumer avformat:test_center.mp4

Rotate around top-left corner (0, 0), equivalent to rotate_center set to 0

melt -profile hdv_720_25p color:red length=100 -filter qtblend rect="100 100 200 200 1" rotation=45 rotate_anchor="0.5 0.5 0 0 0" -consumer avformat:test_topleft.mp4

In Inkscape this could be done like so:

inkscape_rotation_anchor.webm

@ddennedy
Copy link
Member

ddennedy commented Aug 6, 2025

I (mis)used a rect type parameter

That is fine. A lot of rect properties in MLT do not utilize the opacity field, and that is OK. However, an alternative is anchor_x and anchor_y. I do not have a preference. I want you to explore which is more convenient for Kdenlive and reply with your decision. Thank you

@balooii
Copy link
Author

balooii commented Aug 6, 2025

Thank you, I have reached out to JBM for another opinion.

Aesthetically I think I would prefer the two double params than using a rect for a point but don't really have a opinion.

I haven't looked at the Kdenlive keyframe/param model too deeply and don't know the one from Shotcut at all so maybe there is a preference based on how it will be used there at some point.

@ddennedy
Copy link
Member

ddennedy commented Aug 6, 2025

Shotcut is not using qtblend.

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.

2 participants