dyne / frei0r

A large collection of free and portable video plugins
https://frei0r.dyne.org/
GNU General Public License v2.0
419 stars 90 forks source link

Avoid destructing alpha channel. #119

Closed andre-caldas closed 2 years ago

andre-caldas commented 2 years ago

Currently, the f0r_update2 method destructs the alpha channel. The result is an opaque image.

I do not really know if this is the intended behaviour. But it causes some trouble in Shotcut, because transparency is lost.

The current Shotcut solution was to not use clips with more then 1 track. When the clip has only one track, it does not call cairoblend's f0r_update2, because there is no transition.

This patch fixes the issue.

ddennedy commented 2 years ago

Here is why it is the way it is (something bad and ugly happens in some use cases): https://github.com/dyne/frei0r/commit/63808414a36882b8bdd397aa24d5f61450151c4c

Please create a test that replicates the issue explained in the MLT bug report in that commit's message and see what is the result. Maybe some other things changed in the meantime that the old bug no longer reproduces after your change.

andre-caldas commented 2 years ago

LOL!!!

I knew there was a reason hidden somewhere...

Anyway, this is what forbids MLT clips with transparency and more then one visible track on it. Maybe, there could be a way to turn it on and off.

It seems to me that https://github.com/dyne/frei0r/commit/63808414a36882b8bdd397aa24d5f61450151c4c does not really fix the problem. The fix hides the problem, because the background is opaque. The problem lives somewhere else: garbage is being displayed.

Another way to "hide" the issue would be to make the background in Shotcut non-transparent. I think that the black producer is actually a transparent producer. Maybe, people could be able to choose the background color... including transparency.

ddennedy commented 2 years ago

I located my old test files for the MLT bug from 2015, and I no longer reproduce the issue reported after applying the change from this branch. So, something else that was the root cause was likely fixed in the meantime. I will merge this and see if anything is reported as a result.. cairoaffineblend.c should be changed too, but I will do that as well as update versions.