Bug 395626

Summary: [Regression] Combining composite + position and zoom effect crops too early
Product: [Applications] kdenlive Reporter: Vincent Petry <PVince81>
Component: Video Effects & TransitionsAssignee: Jean-Baptiste Mardelle <jb>
Status: CONFIRMED ---    
Severity: major CC: cgiraud, fritzibaby, julius.kuenzel, kde-bugs, kolloom
Priority: NOR Keywords: triaged
Version First Reported In: Appimage - Refactoring   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Revert patch for bd78c208bc43f5d2e2833621fb6a4a1bcc9d54f2
can be reproduced on 18.12.1
on 19.03.70

Description Vincent Petry 2018-06-19 20:54:46 UTC
Steps to reproduce:

1. Select two pictures
2. Drag first picture to Video 3 track
3. Drag second picture to Video 2 track and make its duration longer than the first one
4. Click on first picture inside Video 3 track
5. Add effect "Position and Zoom"
6. Go to effect keyframe 0: zoom to 150%
7. Create keyframe point at the end and zoom back to 120% (can add some panning as well)
8. Right click on the same click and add "Composite and Transform"
9. Make sure composite effect is at the end of picture 1 to transition to picture 2
10. For composite effect, create keyframe point at the end and set opacity to 0 for a fade out effect
11. Click play for the project

Expected result: no cropping, picture 1 stays visible with full size until the transition ends

Actual result: as soon as the composite starts, picture 1's borders are cropped

Here's a video to demonstrate the steps and result: https://owncloud.vincentpetry.net/s/zAVKsIybc96Bkax/download

I have an older project with a lot of such effects and when opening it in kdenlive 18.04.2, all these transitions are now broken. This used to work in a former version (on openSUSE Leap 42.3). I can't confirm in what version it worked I can't downgrade the package. It stopped working since my upgrade to openSUSE Leap 15 which comes with more recent versions.

Setup:
- openSUSE Leap 15
- kdenlive-18.04.2-lp150.15.1.x86_64 (from Packman repo)
- libmlt6-6.6.0+git20180502-lp150.10.1.x86_64 (from Packman repo)


Please let me know if you need further information or whether you were not able to reproduce this.
Comment 1 Vincent Petry 2018-06-19 21:00:25 UTC
More info in case it matters:
- Plasma 5.25.5 (plasma5-workspace-5.12.5-lp150.1.1.x86_64)
- ffmpeg-3.4.2-lp150.3.1.x86_64
Comment 2 Vincent Petry 2018-06-19 21:31:46 UTC
Bug is also happening in version v17.08.3 compiled from matching git tag.

I tried going back further with git, hoping to do a bisect, but am getting compilation errors. Is this effect part actually in kdenlive or libmlt ? I suspect I might need to downgrade libmlt as well to compile older versions.

Now I also just tried the AppImage version for 18.04.1 and the bug is also happening there.
Comment 3 Vincent Petry 2018-06-21 20:01:23 UTC
Mlt got updated to 6.8.0-lp150.10.1, issue persists.

I'd appreciate some pointers:
- is this reproducible or is this only in my env ?
- are transitions done by kdenlive or libmlt ? (to know what to bisect)
Comment 4 Vincent PINON 2018-06-21 21:02:47 UTC
Bonjour Vincent :)

Sorry for late answer

The cropped edges seem to correspond to your bottom image format.
There must be a bug in Composite & Transform (I believe it tries to speedup compositions by skipping transparent pixels on top image, seems to mess and skipping void pixels in bottom image)
C&T, as all video processing, is done in MLT, Kdenlive is "just a GUI & set of tools" around. However recent Kdenlive needs recent MLT, if you build an older MLT you might break Kdenlive.
The file to track is: mlt/src/modules/qt/transition_qtblend.cpp
(maybe commit from 2017-01-03: "Fix transparency of pixbuf images", precedes mlt 6.6.0...)

However, as a workaround:
for just an opacity transition, you should rather use "dissolve", that is made for this purpose. I hope you wouldn't have your bug.
(and you could use "Transform" instead of "Pan & Zoom", but it doesn't really matter)

Hope this helps!
Comment 5 Vincent Petry 2018-06-23 21:26:11 UTC
Thanks for the info.

While I could settle on the workaround, I think the issue should be addressed in general for other people who might be using Composite for other purposes.

Here is my action plan:

0) Solve crash issues with kdenlive from git v18.04.2 and mlt from git v6.8.0, likely related to environment and/or compilation options
1) Attempt to revert bd78c208bc43f5d2e2833621fb6a4a1bcc9d54f2 on top of v6.8.0 (with conflict resolution) and see if issue is fixed
2) If not fixed, bisect mlt to find when it stopped working (needs compiling matching kdenlive version when crossing mlt version boundaries)
3) Try out dissolve workaround (not sure why I used composite and never saw this one)

Currently at step 0 and have some alternative things to try out before asking for help.
Comment 6 Vincent Petry 2018-06-23 21:53:21 UTC
Hmph...

Whatever I do, when using the manually compiled mlt from git with proper dirs, kdenlive shows green vertical bars in the preview panel and crashes when I open my test project.

I took the compilation option from the RPM build log to make sure it has the right paths:

% ./configure --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-sdl --enable-sdl2 --enable-debug --enable-gpl --enable-gpl3 --enable-extra-versioning --swig-languages=python
% make -j4
% sudo make install

This gives me the green bars and crashes. Maybe I've hit upon another bug or env issue.

I'll need to get this working to be able to properly bisect later on.

For now, I've used a barbaric approach and copied the modules manually on top of the RPM files:
% sudo cp lib*.so /usr/lib64/mlt-6/

At least now kdenlive works as before.

And using this approach, reverting bd78c208bc43f5d2e2833621fb6a4a1bcc9d54f2 did  NOT solve the transition issue. So I'll likely need to bisect.

I've attached the reverted commit in case I did something wrong during conflict resolution.
Comment 7 Vincent Petry 2018-06-23 21:55:00 UTC
Created attachment 113527 [details]
Revert patch for bd78c208bc43f5d2e2833621fb6a4a1bcc9d54f2

Revert of bd78c208bc43f5d2e2833621fb6a4a1bcc9d54f2.

Does NOT solve the transition issue.
Unless I didn't overwrite the correct so files...
Comment 8 emohr 2018-11-05 17:28:40 UTC
Please try with the actual Kdenlive AppImage version 18.08.2.
Run the Appimage from the terminal (press CTRL + ALT + T). Move to the AppImage folder and run the .AppImage: ./Kdenlive*.AppImage

This version has an updated MLT part.
Comment 9 thompson 2019-03-05 01:38:06 UTC
Created attachment 118551 [details]
can be reproduced on 18.12.1

issue persists on 18.12.1b appimage build on ubuntu
Comment 10 thompson 2019-03-05 01:50:45 UTC
Created attachment 118552 [details]
on 19.03.70

Also reproducible on refactoring_timeline (commit 76bca9ab6) 

This is definitely a long standing bug

kdenlive 19.03.70
mlt 6.13
ffmpeg 4.0.2-2
git repo branch origin/refactoring_timeline 76bca9ab6
KDE Frameworks Version: 5.55
Qt Version: 5.11.1
Comment 11 thompson 2019-03-05 01:52:14 UTC
I will go ahead and make it confirmed
Comment 12 emohr 2019-03-05 19:00:32 UTC
Thanks thompson. I change it Refactoring.
Comment 13 Julius Künzel 2021-02-25 17:11:22 UTC
This is still confirmed for 21.03.70 (rev. a8b094679)
Comment 14 Cyril Giraud 2021-08-30 21:26:49 UTC
Still confirmed with kdenlive-21.08.0a-x86_64.appimage