View Issue Details

IDProjectCategoryView StatusLast Update
0000559Cinelerra-GG[All Projects] Bugpublic2021-10-19 01:06
ReporterPhyllisSmith Assigned ToPhyllisSmith  
PriorityhighSeverityminorReproducibilityhave not tried
Status feedbackResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000559: Fade In/Fade out flash bug
Description"Fade black flash" bug reported in the Mailing List around March 7/8, 2021. More information follows from IgorB:

    I confirm the bug reported by Camille.
    Here two videos about Title effect and Image with Dissolve Transition:
    https://streamable.com/86y59m
    https://streamable.com/ywcaee

    This is my trick to solve it:
    https://streamable.com/vkp9ou
TagsNo tags attached.

Activities

PhyllisSmith

PhyllisSmith

2021-10-19 01:06

manager   ~0005093

@IgorBeg
I do not think it is better as it breaks things.
Anyway, a fix for the Title plugin for RGBA-FLOAT when using the X11 Video Driver has been checked into GIT. Good thing Igor checked this for Dissolve because it led me to do more testing in the Titler and find this bug (worked correctly with X11-OpenGL driver BUT more importantly, it rendered incorrectly because like X11 that uses software.
IgorBeg

IgorBeg

2021-10-18 07:24

reporter   ~0005092

@Andrea_Paz
Thanks for your confirm and the videos.

@PhyllisSmith
I am sorry for all those differences. I think that it will be hard to fix that, I hope I am wrong.
If other users think that it is better to have an "usable" Dissolve transition (for PNGs, pictures) in Normal Mode we could keep the Freelancer version. I don't know how many users use the Overlay Mode in their Projects,... I do.
PhyllisSmith

PhyllisSmith

2021-10-17 15:18

manager   ~0005091

@IgorBeg
Worse than I thought. Yes, the test project will help tremendously. Thank you
IgorBeg

IgorBeg

2021-10-17 12:16

reporter   ~0005090

Test with cin-20211013_pluginsLoad_fade-older_distros.AppImage

A PNG with Dissolve transition must have a video track below with a clip/PNG, or a Gradient plugin, otherwise Dissolve transition is not performed. With a video clip it works right.

Also Anti-aliasing on the PNG with alpha channel (for example a text) doesn't work if there isn't a video track below with a clip/PNG; but this last thing didn't work before either.

==============================
Overlay Mode tests in YUVA-8bit.
Tests made with two video tracks:
- Top track with two PNGs with Alpha channel (PNG_1 and PNG_2, both with only a text of a different colour). Insert the Dissolve transition at the beginning of the first clip, between the two clips, and at the end of the second clip.
- Bottom track uses the Gradient Plugin (first colour: purple; second colour: white).

Arithmetic...->
- Divide (behaviour slightly different by before)
- Replace (It doesn't perform the Dissolve transition; the old version yes)
PorteDuff...->
- Src (It doesn't perform the Dissolve transition; the old version yes)
- SrcAtop (It doesn't perform the Dissolve transition; the old version yes)
- SrcIn (It doesn't perform the Dissolve transition; the old version yes)
- SrcOver (It doesn't perform the Dissolve transition; the old version yes)
Logical...->
- Min (It doesn't perform the Dissolve transition; the old version yes)
- Max (It doesn't perform the Dissolve transition; the old version yes)
- Lighten (It doesn't perform the Dissolve transition; the old version yes)
- AND (It doesn't perform the Dissolve transition; the old version yes)
- OR (It doesn't perform the Dissolve transition; the old version yes)
Graphic Art...->
- Overlay (It doesn't perform the Dissolve transition; the old version yes)
- Screen (It doesn't perform the Dissolve transition; the old version yes)
- Burn (behaviour slightly different by before)
- Dodge (behaviour slightly different by before)
- Difference (It doesn't perform the Dissolve transition; the old version yes)
- Hardlight (It doesn't perform the Dissolve transition; the old version yes)
- Softlight (It doesn't perform the Dissolve transition; the old version yes)

Note: in some tests, using different Modes, show that Anti-Aliasing on PNG with text, it seems to work inside the Dissolve transition but don't outside. In the old version Anti-Aliasing doesn't work both inside and outside the Dissolve transition.

I added my test Project if it can help.

FadeIN-FadeOUT_ForTest-02.tar.gz (26,348 bytes)
Andrea_Paz

Andrea_Paz

2021-10-17 11:43

manager   ~0005089

Here my test. I confirm IgorBeg's results:

https://streamable.com/4lr8tr
https://streamable.com/tsdgcp
https://streamable.com/y3dot9
PhyllisSmith

PhyllisSmith

2021-10-16 15:24

manager   ~0005088

@IgorBeg
Since the freelancer does not have a fix yet, if you have time, could you continue to test RGBA-8bit because at least then we can see if there are even more problems. Thanks for your time.
IgorBeg

IgorBeg

2021-10-15 07:30

reporter   ~0005080

PhyllisSmith wrote:
I need to test more options myself before asking others to do so -- sorry

Don't worry for that,... thank you.
Okay, I will wait for your new AppImage. Thanks for your time.
PhyllisSmith

PhyllisSmith

2021-10-14 15:52

manager   ~0005077

@IgorBeg
Please wait for a new AppImage before testing further if you have time this weekend. The Freelancer is working on a fix.
Thank you so much for finding this bug (and it is in the Title plugin too) as it was an omission. I need to test more options myself before asking others to do so -- sorry.
IgorBeg

IgorBeg

2021-10-14 07:58

reporter   ~0005076

Thanks @PhyllisSmith for the cin-20211013_pluginsLoad_fade-older_distros.AppImage.
I have only done quick tests, sorry. More tests this week end, I hope.
It seems to work fine except for RGBA-FLOAT colour model. I didn't try the different modes in PatchBay.

In my fist test I am using two video tracks:
- Top track with two PNGs with Alpha channel (PNG_1 and PNG_2, both with only a text of a different colour). Insert the Dissolve transition at the beginning of the first clip, between the two clips, and at the end of the second clip.
- Bottom track uses the Gradient Plugin (first colour: purple; second colour: white).

Change the Colour Model (Settings-> Format-> Video Section ==> Color Model): YUVA-8, RGBA-8, RGBA-FLOAT.
In RGBA-FLOAT instead of the gradient I see the white colour.
PhyllisSmith

PhyllisSmith

2021-10-13 01:41

manager   ~0005067

@IgorBeg
I made a new AppImage on Ubuntu 16 that includes the Dissolve fade in/out patch if you have time to test it. It is my biggest concern because the patch change overlayframe.h which is included in 13 Cinelerra files and 23 plugins/transitions. I just wrote over the last testing file. This fix ONLY fixes it for the X11 Video Driver (not OpenGL yet).

https://cinelerra-gg.org/download/testing/cin_pluginsLoad_fade-older_distros.AppImage

@Andrea_Paz
I know you are busy too, but if you have any time to test, it would be appreciated. Especially the SRC OVER... stuff in the patch bay. This AppImage also includes Andrew's LV2 patch to MatN's modifications.
IgorBeg

IgorBeg

2021-10-12 07:37

reporter   ~0005061

Thanks @PhyllisSmith for the 20211010_AppImage https://cinelerra-gg.org/download/testing/cin_pluginsLoad_fade-older_distros.AppImage.
I tested the Title's fade issue as it was shown in "Cin_20201031_TitleFadeINOUT_issue_1.ogv" video, link to https://streamable.com/86y59m (2021-03-09, anymore available): it was for Title effect and its own dissolve feature.
For me it works very good.
Thanks Phyllis and Freelancer!

PS:
Sorry, I didn't try the "fadeInOut.dissolve.overlayframe.h.patch" patch.
Andrea_Paz

Andrea_Paz

2021-10-11 08:12

manager   ~0005047

My test is OK: I don't see any shadows in the title as seen in IgorBeg's video. But, I'm not sure how the Fade issue works, and I don't know if the test I did is appropriate.
PhyllisSmith

PhyllisSmith

2021-10-11 00:25

manager   ~0005043

Here is the patch to fix the Dissolve fade in/fade out. This one NEEDS LOTS OF TESTING. It is attached. All you have to do for people who do their own builds to apply the patch is:
1) go to the cinelerra-5.1/cinelerra directory
2) patch < fadeInOut.dissolve.overlayframe.h.patch
You will have to "make clean" and do a full build because it modified overlayframe.h which is used in many, many places. Makes me nervous.

fadeInOut.dissolve.overlayframe.h.patch (1,116 bytes)
diff --git a/cinelerra-5.1/cinelerra/overlayframe.h b/cinelerra-5.1/cinelerra/overlayframe.h
index 13c2e4b..f72e518 100644
--- a/cinelerra-5.1/cinelerra/overlayframe.h
+++ b/cinelerra-5.1/cinelerra/overlayframe.h
@@ -321,6 +321,21 @@ ZTYP(float);	ZTYP(double);
   } \
   ALPHA_STORE(out, ofs, mx)
 
+#define ALPHA4_STORE(out, ofs, mx) \
+  r = aclip(r, mx); \
+  g = ofs ? cclip(g, mx) : aclip(g, mx); \
+  b = ofs ? cclip(b, mx) : aclip(b, mx); \
+  if( trnsp ) { \
+    double alpha_in = 1.0*a*opcty/mx, alpha_out = 1.0*out3*trnsp/mx, total = alpha_in + alpha_out; \
+    r = (r * alpha_in + out0 * alpha_out) / total; \
+    g = (g * alpha_in + out1 * alpha_out) / total; \
+    b = (b * alpha_in + out2 * alpha_out) / total; \
+    a = (a * opcty + out3 * trnsp) / mx; \
+  } \
+  ALPHA_STORE(out, ofs, mx); \
+  out[3] = aclip(a, mx)
+
+/*
 #define ALPHA4_STORE(out, ofs, mx) \
   r = aclip(r, mx); \
   g = ofs ? cclip(g, mx) : aclip(g, mx); \
@@ -333,6 +348,7 @@ ZTYP(float);	ZTYP(double);
   } \
   ALPHA_STORE(out, ofs, mx); \
   out[3] = aclip(a, mx)
+*/
 
 #define BLEND_SWITCH(FN) \
 	switch( mode ) { \
PhyllisSmith

PhyllisSmith

2021-10-10 21:33

manager   ~0005042

@IgorBeg
There is also a fix for the Dissolve fade in/out problem but it is not included in this AppImage. It modifies overlayframe.h so potentially could affect SRC OVER, SRC ... Also, it only works when using X11 as the driver BUT as Andrea always points out to me and is stated in the manual, the transitions are better used with software instead of OpenGL.
PhyllisSmith

PhyllisSmith

2021-10-10 19:22

manager   ~0005039

@IgorBeg
A different freelancer has submitted a code fix for the fade in/fade out problem in the Title plugin.
The fix is localized and should not affect old project and using multiple effects to maintain compatibility.
If you have time to verify the fix, I would really appreciate it as I am not very good at doing a thorough test and compatibility must be maintained. Thank you. This AppImage also contain prevention of reload of plugins on every startup.

https://cinelerra-gg.org/download/testing/cin_pluginsLoad_fade-older_distros.AppImage

@Andrea_Paz
This fix is included in the other AppImage too so if you have a good test case to use, it would be so helpful also.

https://cinelerra-gg.org/download/testing/cin_pluginsLoad_fade-newer_distros.AppImage
PhyllisSmith

PhyllisSmith

2021-06-25 19:57

manager   ~0004862

Last edited: 2021-06-25 20:55

View 2 revisions

@IgorBeg
Thank you so much for the feedback. I will try to duplicate your gradient example to see what you are talking about.
@Andrew-R has been looking at this also and suggested perhaps we could special case for the Titler and Dissolve to use the new code and everything else keep using the old code. It would be hard for me to figure out how to do this though.

At least the mod fixes the reported bug, but it looks like we can not use it as is because of too much destruction.

Also, if I start with my current $HOME/.bcast5, the problem still occurs. If I start with a new one, the mod fixes the problem so there is some setting in Cinelerra_rc that retains the bad flash somehow.

IgorBeg

IgorBeg

2021-06-25 09:37

reporter   ~0004861

Thanks for the AppImage.
My tests compare Cin_20201031_static with Cin_20210624_AppImage.
I am using two my test xml (Project) files.

In my tests I am using a Gradient effect as bottom (background) video track.
Bottom track with Gradient Effect: Shape=Linear; Angle=83; Rate=Log; InnerRadius=3; OuterRadius=46; InnerColor= ffffffff; OuterColor=ff2a0c66.

In Cin_20210624_AppImage there is a different behaviour from YUVA8 to RGBA8, and there is a strange banding effect. Those there aren't on Cin_20201031_static release.

Changing some "OverlayMode" in Patchbay the behaviour is different for the two releases. So, an old project would no longer be compatible with the new Cin version.

If I add "Color3Way" effect on a top video track where there are PNGs (with Alpha channel) and Dissolve transitions that effect is transferred to the bottom video track and it changes the old behaviour.

The new mod works fine "alone", but with usual effects and an old Project, unfortunately you lose compatibility.

I could make some screencasts but I need a lot of time and I think I might just confuse you.
PhyllisSmith

PhyllisSmith

2021-06-23 22:23

manager   ~0004860

@IgorBeg
I need your testing expertise. A Freelancer has provided a fix but I can not tell for sure if it is totally correct and has no side effects.
Could you test it really well using the file at: https://cinelerra-gg.org/download/testing/cin_for_older_distros.AppImage ?
When I test on Fedora, using the black_flash demo provided by Camille, it seems to work (both Title plugin and Dissolve Transition).
When I test on Ubuntu 14, I had to start with a "fresh" copy of .bcast5 to get it to work correctly.

Some concern I have is that the modification is in overlayframe.h which is used in several places in Cinelerra.
Anyone is welcome to test and the "for older distros" works on the newer distros just as well.

If Andrew or anyone else who does their own builds, wants to rebuild change the following lines in overlayframe.h.

After line:
#define TWO 2

Add:
#define GAMMA 2.4
static inline double mpow(double a, double b) { return pow(a, b); }

#define LINEAR2SRGB(in) (in <= 0.0031308 ? 12.92 * in : 1.055 * mpow(in, 1.0/GAMMA) - 0.055)
#define SRGB2LINEAR(in) (in <= 0.04045 ? in / 12.92 : mpow((in + 0.055) / 1.055, GAMMA))

#define A_BLEND(top, bottom, alpha, max) \
        max * LINEAR2SRGB(SRGB2LINEAR(1. * top / max)+ SRGB2LINEAR(1. * bottom / max)*(1.0 - (1. * alpha / max)))

Change lines:
#define ALPHA_NORMAL(mx, Sa, Da) (Sa + (Da * (mx - Sa)) / mx)
#define COLOR_NORMAL(mx, Sc, Sa, Dc, Da) ((Sc * Sa + Dc * (mx - Sa)) / mx)
To:
#define ALPHA_NORMAL(mx, Sa, Da) ((Sa + (mx - Sa)*(mx - Sa)) / mx)
#define COLOR_NORMAL(mx, Sc, Sa, Dc, Da) A_BLEND(Sc, Dc, Sa, mx)
RafaMar

RafaMar

2021-03-10 14:47

reporter   ~0004670

When you insert an effect on an empty track the fade fades as if it were on a black background, it interprets the alpha as black where there is transparency, which is what produces the fade.
To avoid the unwanted effect produced by the fade over black (because there is no content) it is best to leave the fade in out of the effect at 0 and use the fade line to perform these, so there is no problem with the alpha channel.
Watch the following video
https://streamable.com/quj37w

Issue History

Date Modified Username Field Change
2021-03-09 20:44 PhyllisSmith New Issue
2021-03-10 14:47 RafaMar Note Added: 0004670
2021-06-23 22:12 PhyllisSmith Description Updated View Revisions
2021-06-23 22:23 PhyllisSmith Assigned To => PhyllisSmith
2021-06-23 22:23 PhyllisSmith Status new => feedback
2021-06-23 22:23 PhyllisSmith Note Added: 0004860
2021-06-25 09:37 IgorBeg Note Added: 0004861
2021-06-25 19:57 PhyllisSmith Note Added: 0004862
2021-06-25 20:55 PhyllisSmith Note Edited: 0004862 View Revisions
2021-10-10 19:22 PhyllisSmith Note Added: 0005039
2021-10-10 21:33 PhyllisSmith Note Added: 0005042
2021-10-11 00:25 PhyllisSmith File Added: fadeInOut.dissolve.overlayframe.h.patch
2021-10-11 00:25 PhyllisSmith Note Added: 0005043
2021-10-11 08:12 Andrea_Paz Note Added: 0005047
2021-10-12 07:37 IgorBeg Note Added: 0005061
2021-10-13 01:41 PhyllisSmith Note Added: 0005067
2021-10-14 07:58 IgorBeg Note Added: 0005076
2021-10-14 15:52 PhyllisSmith Note Added: 0005077
2021-10-15 07:30 IgorBeg Note Added: 0005080
2021-10-16 15:24 PhyllisSmith Note Added: 0005088
2021-10-17 11:43 Andrea_Paz Note Added: 0005089
2021-10-17 12:16 IgorBeg File Added: FadeIN-FadeOUT_ForTest-02.tar.gz
2021-10-17 12:16 IgorBeg Note Added: 0005090
2021-10-17 15:18 PhyllisSmith Note Added: 0005091
2021-10-18 07:24 IgorBeg Note Added: 0005092
2021-10-19 01:06 PhyllisSmith Note Added: 0005093