Log in

View Full Version : overlay-help


Terka
3rd June 2009, 09:03
want to deblock my DV source (applying blur on grid mask)
the mask is black/white picture,
http://img76.imageshack.us/img76/9939/blurmriz.png (http://www.imagehosting.com/)


a=avisource("c:\hj\kamera\avisynth\psi\!Psi.avi")
obr = ImageSource("c:\Program Files\AviSynth\plugins\blur_mriz.png", start=1, end=1999, fps=25,pixel_type = "rgb32").ConvertToYV12()


blur=a.blur(0.6,0).tweak(sat=3.75).tweak(sat=3.75).tweak(sat=3.75)
a=a.tweak(sat=0)

stackvertical(a,Overlay(blur,a, mask=obr, opacity=1),obr.ConvertToYV12() )

but the result is not as expected, want to overay only 2pixels width :(
http://img524.imageshack.us/img524/4162/blurmrizavsp.th.png (http://img524.imageshack.us/img524/4162/blurmrizavsp.png)

Gavino
3rd June 2009, 09:42
Try removing ConvertToYV12() from the mask, ie use the RGB32 original.

Terka
3rd June 2009, 10:02
it doesnot help. the bug is somewhere else.

stickboy
4th June 2009, 03:16
want to deblock my DV source (applying blur on grid mask)
but the result is not as expected, want to overay only 2pixels width :(I don't understand what that means. Exactly what do you want to do?

Terka
4th June 2009, 08:24
DV has blocks of 8x8. want blur their edges. (first try the vertical.) so i want make a mask (the picture above) and apply blur on the mask only.
the width of the mask stripes is 2 pixels, but the script i made applyies the blur on more pixels.
to see the result properly, i applied tweak instead blur only.

Terka
11th June 2009, 08:03
could anyone help please?

Gavino
11th June 2009, 09:58
If I understand what you are doing, your mask is black on pixels 0, 7, 8, 15, 16, 23, 24, etc. Overlay works internally in 4:4:4, but the result is converted back to YV12 on output. I think what you are seeing is the result of chroma subsampling where the masked pairs are not aligned with the chroma samples.

To test this theory, try adding output="RGB32" to the Overlay and see what you get.

Terka
11th June 2009, 11:32
>your mask is black on pixels 0, 7, 8, 15, 16, 23, 24
yes.
yes, adding output="RGB32" changes the line width.
:thanks:

Gavino
11th June 2009, 14:05
Good, now we know what's going on.

But, I assume you will eventually want to convert the output back to YV12, so the problem hasn't gone away. I think the solution depends on how you want the chroma to be processed - you could either keep the original chroma (blurring luma only), or use a different mask for the chroma.

Terka
11th June 2009, 14:40
The idea is to deblock my DV source before converting it to x264.
Im trying this "mask method", because when i use some Avisynth filters, the blocks remains.