Log in

View Full Version : nested overlays


Musitektus
30th August 2006, 09:27
I made a clip with a very complex series of overlays and fading masks. After a lot of tweaking I got it all working right, except for a small section. I've isolated that portion of the script below.

Within the context of the entire script, this portion of the clip displays correctly, but flickers randomly (the topmost layer shows in one frame, but not the next, then back again for 2 frames, gone again, only partially showing in the upper left part of the frame, suddenly back to normal, etc. in an apparently random fashion)

The randomness of which frames it decides to show correctly in is strange enough, but then it only shows a partially complete frame in other random frames of the clip.

I suspect that the flickering is caused by the nesting of Overlay function. When I isolated the problem portion of the script, it no longer flickers, but I now cannot seem to get the the second overlay to work at all (only the "blue" background clip shows)


path = "C:\commercial\"

logo = ImageReader(path+"logo.tif", 0, 85, pixel_type="rgb32", 29.97)
logoborder = ImageReader(path+"logoborder.tif", 0, 85, pixel_type="rgb32", 29.97)
blue = ImageReader(path+"blueback.tif", 0, 85, pixel_type="rgb32", 29.97)

lenpt1 = 20
combined = Overlay(logo.trim(0,lenpt1),logoborder.trim(0,lenpt1), mask=ShowAlpha(ColorKeyMask(logoborder.trim(0,lenpt1), $000000, 20)), mode="blend", opacity=1, pc_range=TRUE)
logo_pt1 = Overlay(blue.trim(0,lenpt1),combined.trim(0,lenpt1), mask=ShowAlpha(ColorKeyMask(combined.trim(0,lenpt1), $000000, 20)), mode="blend", opacity=1, pc_range=TRUE)

logo_pt1


I was originally having problems with strange color casts showing in areas that should be completely transparent. I found that the pc_range=TRUE variable helped eliminate most of this.

squid_80
30th August 2006, 10:48
What version of avisynth? Overlay was tweaked a while back.

Musitektus
30th August 2006, 11:34
AviSynth v. 2.56

Musitektus
30th August 2006, 18:41
After some more experimentation, it appears that it is not possible to define a Mask from a clip which is defined from an Overlay or Layer filter. However, I did in fact have it working correctly earlier for brief periods of time (there was usually the flickering problem). Does anyone know of a workaround for this?

Wilbert
30th August 2006, 21:50
After some more experimentation, it appears that it is not possible to define a Mask from a clip which is defined from an Overlay or Layer filter.
Sure it is.

Post a screenshot of the alpha of the mask:

ShowAlpha(ColorKeyMask(combined.trim(0,lenpt1), $000000, 20))

If it's all black or white, post a short clip (~10 frames) of 'combined'.

squid_80
30th August 2006, 23:11
Feeding rgb clips to overlay... I think you're definitely going to hit the full_range bug sooner or later, but whether this is the root cause of your problems I can't be certain. If you're game enough you could try avisynth 2.6 (http://forum.doom9.org/showthread.php?t=114643), which should have the problem fixed.