Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th September 2009, 09:44   #1  |  Link
MasterYGM
Registered User
 
Join Date: Nov 2006
Posts: 13
blinking line on top or bottom when yadif bob

with yadif(mode=1) some dvd show blinking thin line on top or bottom.

usally i crop this by letterbox(0,2) or letterbox(2,0) because this will reduce compressiblilty.

why this blinking happen? and how can I handle this with one general script?
MasterYGM is offline   Reply With Quote
Old 15th September 2009, 10:39   #2  |  Link
Forteen88
Herr
 
Join Date: Apr 2009
Location: North Europe
Posts: 363
Have you tried
TempGaussMC_beta1mod(EdiMode="NNEDI2").SelectEven()
instead?
Forteen88 is offline   Reply With Quote
Old 15th September 2009, 11:49   #3  |  Link
MasterYGM
Registered User
 
Join Date: Nov 2006
Posts: 13
Quote:
Have you tried
TempGaussMC_beta1mod(EdiMode="NNEDI2").SelectEven()
instead?
I know TGMC is best for quality. but it's too slow for me.
MasterYGM is offline   Reply With Quote
Old 15th September 2009, 13:29   #4  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
On the topmost and bottommost line, there are not enough neighbor pixels to make a spatial estimation from.

The issue can be worked around by manually padding the input clip:

Code:
mpeg2source(...)
pointresize(width,height+8,0,-4,width,height+8.001)
Yadif(mode=1).crop(0,4,-0,-4)
Et voila, no more blinking lines on top or bottom. BTW, that's the same padding method that TGMC uses.


Edit: just got aware of
Quote:
because this will reduce compressiblilty.
Just to have it noted ... I surely understand if you consider TGMC as too slow for you. But, consider also that TGMC usually will give a result that is *way* more compressible than what Yadif (or any other deinterlacer/bobber) produces. It depends on the source and used settings, but 10~20% better compressability are almost guaranteed. I've seen cases where TGMC after q2-encoding had almost *half* the filesize of Yadif...
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 15th September 2009 at 13:38.
Didée is offline   Reply With Quote
Old 15th September 2009, 13:39   #5  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Didée, why the extra .001?
Gavino is offline   Reply With Quote
Old 15th September 2009, 13:54   #6  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Because occasionally, I'm still using AS v2.5.6. And it is realistic to assume that other people out there still do, too.

Remember that in 2.5.6, the resampler went NOP when in/out sizes were exactly the same, no matter the offset.

Yes it looks strange, but it works in all Avisynth versions. "Keep backward compatibility as long as possible!"

I prefer it that way. Else, people might try it, find "what crap is he telling, it does not work", and keep wondering in silence.


Edit:
Okay, I've beaten myself: In this case here, that epsilon thingy would not be needed.
I rephrase: In AS 2.5.6, the resizer would go NOP under some certain conditions.
... And since I can't remember for sure which the exact conditions are, I keep adding the epsilon thingy to be always on the safe side.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 15th September 2009 at 14:12.
Didée is offline   Reply With Quote
Old 15th September 2009, 14:10   #7  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Ah, I thought it might be something like that.
2.5.6 was before my time, so I'm not sure exactly what form the bug took. But here the in/out heights are not the same,
In: height
Out: height+8
Gavino is offline   Reply With Quote
Old 15th September 2009, 14:48   #8  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Yeah ... thinking about it, it could be the bug first stroke me when doing subpixelshift-correction for NNEDI, where input/output sizes are equal. Forbear with a dodderer.

Just to confirm my claim about compressibility, I've run the "Musicians" test sequence through Yadif(mode=1) and TGMC(2,2,1,4,4,0,"bcbc"), encoded to Xvid@q2. (see, a dodderer)

Here they are:

Yadif - 14320 kB
TGMC - 7452 kB

I'm not sure if it's the visual appearance or the different bitrate requirement which is more remarkable.

***

For completeness: the Yadif sample was done *with* forementioned calming of the blinking lines. Without that, the resulting filsize was 14396 kB.

Easy math: calming of the blinking scanlines "improved" Yadif's compressibility by 0.005%. { (14396-14320)/14396 }
Whereas TGMC improved compressibility by 48%. { (14320-7452)/14320 }

(This falsely includes container overhead, but with those numbers that's completely irrelevant.)
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 15th September 2009 at 15:00.
Didée is offline   Reply With Quote
Old 15th September 2009, 15:46   #9  |  Link
MasterYGM
Registered User
 
Join Date: Nov 2006
Posts: 13
workaround script could produce artifact. is there any better way?

Original


Resize and crop
MasterYGM is offline   Reply With Quote
Old 15th September 2009, 16:27   #10  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Workaround script does not produce artifacts. You certainly produced error in script. Post your script.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 15th September 2009, 22:48   #11  |  Link
MasterYGM
Registered User
 
Join Date: Nov 2006
Posts: 13
Code:
ImageReader("rings_lg_orig.png")
pointresize(width,height+8,0,-4,width,height+8.001)
crop(0,4,-0,-4)
I tested script to resize test pattern image.
rings_lg_orig.png is 'Original' from previous post.

that script could fill top or bottom blinking line. but could produce another artifact.
MasterYGM is offline   Reply With Quote
Old 15th September 2009, 22:58   #12  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Quote:
Originally Posted by MasterYGM View Post
Code:
ImageReader("rings_lg_orig.png")
pointresize(width,height+8,0,-4,width,height+8.001)
crop(0,4,-0,-4)
Did you forget to put in the deinterlacer?
What you have there is an identity filter.

Or at least it should be. Are you in fact saying that it isn't?

EDIT: I've just tested it with Compare and it produces 100% identical image to original.

Last edited by Gavino; 15th September 2009 at 23:13.
Gavino is offline   Reply With Quote
Old 16th September 2009, 07:16   #13  |  Link
MasterYGM
Registered User
 
Join Date: Nov 2006
Posts: 13
see the second image i posted with 100% actual size. then you can see horizental crack about 100pixel below from top.
image is already changed before deinterlacer. so putting deinterlacer or not is not important.
if you see 100% idential image after script then it's maybe you are using another simple image as source or using another script.
MasterYGM is offline   Reply With Quote
Old 16th September 2009, 07:38   #14  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Bad news for you, but ... using exactly the "ringslgorig.png" provided by you, and using exactly the script you posted, I get a result that is exactly identical to the input. No artifacts anywhere. And that's exactly what is expected to happen.

BTW, the artifact you show is not ~about~ 100 pixels from the top, it appears exactly at the 128th line. A funny number, that might indicate that some routine of some application somewhere on the long way to the compressed output might have a problem. Whatever it might be, don't know. But it's extremely unlikely that Avisynth is the culprit. And the script is correct.

Now it's up to you to provide more information about which programs (and their versions) you're using to open the script, and to save the PNG. In case of doubt, use VirtualDub (or -Mod).
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 16th September 2009 at 07:46.
Didée is offline   Reply With Quote
Old 16th September 2009, 13:26   #15  |  Link
MasterYGM
Registered User
 
Join Date: Nov 2006
Posts: 13
I'm using AvsP 2.0.2 to run script and capture
AviSynth version is 2.57 tsp MT version 5
MasterYGM is offline   Reply With Quote
Old 16th September 2009, 13:43   #16  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Try this script:

ImageReader("rings_lg_orig.png")
orig = last
pointresize(width,height+8,0,-4,width,height+8.001)
crop(0,4,-0,-4)
Compare(orig)

You will see a difference of zero, showing the two are identical.
Gavino is offline   Reply With Quote
Old 16th September 2009, 13:52   #17  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Strange, but interesting.

I never used AvsP up to now, and Im not running any special MT-version ov Avisynth. (I've only single-core PCs, that's why.)

The script is expected to work (because it is correct), and it does work correct with the official Avisynth versions 2.56 and 2.58, in VirtualDub (and /Mod), and in all mediaplayers I tried (ZoomPlayer and mplayer2.exe).

So it seems that either AvsP, or the MT build of Avisynth is to blame.

Try to use just "+8" instead of "+8.001" (which is perfectly okay), perhaps the rounding is off for some reason.

If that ain't help, try vanilla VirtualDub instead of AvsP.

If that ain't help, try a standard Avisynth build.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 16th September 2009 at 13:56.
Didée is offline   Reply With Quote
Old 16th September 2009, 16:53   #18  |  Link
MasterYGM
Registered User
 
Join Date: Nov 2006
Posts: 13
with 8.001 and Compare...

Main Abs Dev: 90.1333 (90.133/90.133/0.006)
Mean Dev: +0.0064 (+0.006/+0.006/+0.006)
Max Pos Dev: 228
Max Neg Dev: -228
PSNR: 7.78 dB (7.78/7.78/7.78)
Overall PSNR: 7.78 dB

I'll try other version of AviSynth later.

Edit: same result with AviSynth 2.58, Build Dec 22 2008 [08:46:51]

and same with VirtualDub too.


Last edited by MasterYGM; 16th September 2009 at 17:07.
MasterYGM is offline   Reply With Quote
Old 16th September 2009, 17:12   #19  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Hmmm ... I remember vaguely some discussion about pointresize and sample positioning, though long time ago. Perhaps the internal code for pointresize isn't the same in MT-Avisynth?

Try with e.g. bicubic instead:

ImageReader("rings_lg_orig.png")
orig = last
bicubicresize(width,height+8, .33,.33, 0,-4,width,height+8)
crop(0,4,-0,-4)
Compare(orig)

Better, or is it the same disaster?
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 16th September 2009, 17:17   #20  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
The problem is due to RGB 'starting at the bottom'.

pointresize(width,height+8,0,-4,width,height+8.001)
needs to be replaced by
pointresize(width,height+8,0,-4,width,height+7.999)
but
pointresize(width,height+8,0,-4,width,height+8)
works OK anyway.

When I tested it yesterday, I used a YV12 clip, so 8.001 worked.

See the problem you caused with your outdated 2.5.6 attachment Didée...

Last edited by Gavino; 16th September 2009 at 17:22.
Gavino is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.