Bug 474802 - All rotation effects cause black borders
Summary: All rotation effects cause black borders
Status: RESOLVED NOT A BUG
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Effects & Transitions (show other bugs)
Version: 23.08.1
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2023-09-23 10:08 UTC by Karol
Modified: 2025-01-02 18:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karol 2023-09-23 10:08:05 UTC
SUMMARY
***
If you, for example, accidentally record a video in portrait mode while holding the smartphone horizontally, Kdenlive won't be able to fix it:

The "Rotate" and "Rotate and Shear" effects crop the video for some reason upon rotating, as well as leave it zoomed out with black borders.
The Transform effect rotates it properly, but still leaves it zoomed out with black borders around, forcing you to zoom in by about 178% to make the video fit the project. I suspect this zooming could be lossy. There needs to be a proper way to rotate videos.
***


STEPS TO REPRODUCE
1. Import a portrait video to the timeline (for example 720x1280)
2. Make sure your project has the right resolution (1280x720 in this case)
3. Try to use "Rotate", "Rotate and Shear" and "Transform" to rotate the video 90 degrees.

OBSERVED RESULT
"Rotate" and "Rotate and Shear" result in the video being cropped AND having black borders.
"Transform" results in just black borders.

EXPECTED RESULT
No black borders, no cropped sides.

SOFTWARE/OS VERSIONS
Windows: 10 22H2 19045

ADDITIONAL INFORMATION
Some of the Rotate and Shear tool's options seems to be redundant on top of the Rotate tool.
Example video: https://drive.google.com/file/d/17rKsYaoTZKAguU1Bc80zRCJGG6M3fhon/view?usp=sharing
Comment 1 Bernd 2023-09-28 00:33:49 UTC
(In reply to Karol from comment #0)
> The "Rotate" and "Rotate and Shear" effects crop the video for some reason
> upon rotating, as well as leave it zoomed out with black borders.
> The Transform effect rotates it properly, but still leaves it zoomed out
> with black borders around, forcing you to zoom in by about 178% to make the
> video fit the project. I suspect this zooming could be lossy. There needs to
> be a proper way to rotate videos.

I can see your confusion but I am sure Kdenlive behaves like designed. However, the way Kdenlive handles source clips with a different resolution than the project settings is a contentious topic and AFAIK some changes are being made as we speak.

That said, I checked your report about Rotate and Rotate and Shear effects cropping the video, and could not verify that. Please provide screenshots of the timeline, effect stack and the project monitor so that I can see your environment.

On the topic of having to zoom a large amount when rotating into horizontal aspect I found that if you use the Transform effect to rotate the video and then use the icons "Adjust to original size" and "Center horizontally" and "Center vertically" you get a perfectly centered (i.e. without black borders) and sized at 100% horizontal video.

Let me know whether this works for you, and close the bug report. BTW, issues like this can be discussed first in the official Kdenlive forum (https://discuss.kde.org/tag/kdenlive) or on /reddit (https://www.reddit.com/r/kdenlive/) or on Telegram (https://matrix.to/#/!hgAJhWtjQoaLXYKecA:kde.org?via=kde.org&via=matrix.org&via=forgedtheir.phd) before logging a bug.

Cheers!
Comment 2 Karol 2023-10-02 19:45:57 UTC
(In reply to Bernd from comment #1)
> (In reply to Karol from comment #0)
> > The "Rotate" and "Rotate and Shear" effects crop the video for some reason
> > upon rotating, as well as leave it zoomed out with black borders.
> > The Transform effect rotates it properly, but still leaves it zoomed out
> > with black borders around, forcing you to zoom in by about 178% to make the
> > video fit the project. I suspect this zooming could be lossy. There needs to
> > be a proper way to rotate videos.
> 
> I can see your confusion but I am sure Kdenlive behaves like designed.
> However, the way Kdenlive handles source clips with a different resolution
> than the project settings is a contentious topic and AFAIK some changes are
> being made as we speak.
> 
> That said, I checked your report about Rotate and Rotate and Shear effects
> cropping the video, and could not verify that. Please provide screenshots of
> the timeline, effect stack and the project monitor so that I can see your
> environment.
> 
> On the topic of having to zoom a large amount when rotating into horizontal
> aspect I found that if you use the Transform effect to rotate the video and
> then use the icons "Adjust to original size" and "Center horizontally" and
> "Center vertically" you get a perfectly centered (i.e. without black
> borders) and sized at 100% horizontal video.
> 
> Let me know whether this works for you, and close the bug report. BTW,
> issues like this can be discussed first in the official Kdenlive forum
> (https://discuss.kde.org/tag/kdenlive) or on /reddit
> (https://www.reddit.com/r/kdenlive/) or on Telegram
> (https://matrix.to/#/!hgAJhWtjQoaLXYKecA:kde.org?via=kde.org&via=matrix.
> org&via=forgedtheir.phd) before logging a bug.
> 
> Cheers!

I can't repro the issue with cropping. I think it was caused by the project being 1080x1920 instead of 1920x1080. Nevermind that.

The "Adjust to original size" button solves the issue EVEN with Rotate & Shear, and Transform works exactly the same (as long as you manually center horizontally and vertically, which is a problem on its own, but not really worth spending time fixing, in my opinion).

If you say it's not a bug that none of the crop/transform effects scale automatically, feel free to resolve this bug as Intentional/Not a Bug/Closed/etc., whatever seems appropriate.
Comment 3 emohr 2025-01-02 18:05:02 UTC
Thank you for your feedback. Glad to here it works somehow.

I close this bug. If it still appears in the latest version, please feel free to re-open it and update the affected version number.