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 29th November 2006, 03:09   #1  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
I need help eliminating some nasty aliasing on a PAL video

I'm currently creating a DVD out of some short films and the one I'm trying now has some VERY nasty aliasing. DGIndex reported the file as interlaced, but the footage seems to be progressive as there is no interlacing at all (which would also rule out the possibility of it being phase shifted or field swapped, right?).

What I need is someone to confirm me wether this is progressive or phase shifted/field swapped and how to get rid of the aliasing. You can download a short sample here.


Here's the script I came up with so far:

Code:
MPEG2Source("X:\wherever\ashort.d2v")

TFM(d2v="X:\wherever\ashort.d2v",order=0,mode=6,pp=7,slow=2)

Deblock_QED()

a = last
b = a.DeGrainMedian().VagueDenoiser(threshold=0.8, method=1, nsteps=6, chromaT=0.8)
SeeSaw(a,b, NRlimit=6, NRlimit2=7, Sstr=1.5, Slimit=5, Spower=5, SdampLo=6, Szp=16)

AAA()

Crop(2,0,718,576,align=true)

EEDI2().TurnRight().EEDI2().TurnLeft()

Lanczos4Resize(672,544)

dull=last
sharp=dull.LimitedSharpenFaster(SMode=4,Strength=200)
Soothe(sharp,dull,25)

Tweak(sat=1.2)

AddBorders(24,16,24,16)

Levels(0,1,255,16,235)

ConvertToYUY2()
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.

Last edited by Chainmax; 29th November 2006 at 06:34.
Chainmax is offline   Reply With Quote
Old 29th November 2006, 12:33   #2  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: UK
Posts: 1,673
It looks to me like it was shot interlaced, and then converted to progressive by dumping then duplicating+blurring ever second field. In other words, it's been very cheaply "filmised" (filmic effect).

Dumping every other line (i.e. field) and then using EEDI2 would be my first attempt...

Code:
mpeg2source("PALSample.demuxed.d2v")

separatefields()

selectodd()

EEDI2()
selectodd() keeps the "good" fields (i.e. the ones that were probably in the original interlaced video). selecteven() keeps the duplicated, blured fields - not good.

Even with selecteven(), this might look much worse than what you've done - I didn't have all the filters you used here to compare.

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 29th November 2006, 13:11   #3  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Symptoms are like 2Bdecided said.

Quickly tried that "double-edi" thingy buried in MCBob:

Code:
AssumeTFF()
merge(SeparateFields().SelectEven().eedi2(field=1),SeparateFields().SelectOdd().EEDI2(field=0),0.5)
Too lazy right now to post a screenshot, but the result in front of me is smooth as silk.
Could be followed, perhaps, by some "sharpen-up---but-dont-sharpen-more-than-previous-filter-did-blur" filtering.
__________________
- 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 29th November 2006, 15:11   #4  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: UK
Posts: 1,673
That's weird - you're using the "bad" field as well as the "good" one, but it does improve the result. At least, it's softer (because the bad field is soft) but also more stable. Looking at the switch on the microwave, it doesn't seem to wobble as much with your version.

Makes me wonder if EEDI2 can be made generally more stable by running it twice, once with a slightly softened image?! Probably much better ideas abound. I need to read and learn!

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 29th November 2006, 15:18   #5  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Ok, I'll try these suggestions and compare them with my results. Thanks for the answers so far .
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 1st December 2006, 01:10   #6  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Wow Didée, the suggestion you posted worked wonders . There might be some very slight remaining aliasing, but it's still much better than my attempt, which was slow as hell and blurred the picture too much because of AAA. It should be much faster as well . What's the rationale behind it?


[edit]There's some noticeable artifacting on a scene but I guess it's an ok tradeoff.
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.

Last edited by Chainmax; 6th December 2006 at 17:02.
Chainmax is offline   Reply With Quote
Old 6th December 2006, 17:03   #7  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Didée, you can download two 1s scenes where the artifacting occurs here:

http://rapidshare.com/files/6334520/..._VOBs.rar.html
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 13th December 2006, 22:39   #8  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
Originally Posted by Chainmax View Post
Didée, you can download two 1s scenes where the artifacting occurs here:
Okay, I downloaded. What next?



Reduce 'maxd' to prevent those artefacts. Large search distances for EEDI2 aren't needed in this case. Default is 12, smaller ranges give less artefacts and run faster. '4' should be okay, I've even tried '2' and the anti-aliasing was still intact.


Aliased source:


DoubleEdi'ed:


DoubleEdi + ContraSharpen:


Code:
o = last
AssumeTFF().SeparateFields()
dbl   = mt_Average( SelectEven().EEDI2(field=1,maxd=4),
 \                  SelectOdd() .EEDI2(field=0,maxd=4), U=3,V=3 )
dblD  = mt_MakeDiff(o,dbl,U=3,V=3)
shrpD = mt_MakeDiff(dbl,dbl.RemoveGrain(11),U=3,V=3)
DD    = shrpD.Repair(dblD,13)

dbl.mt_AddDiff(DD,U=3,V=3)
__________________
- 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; 14th December 2006 at 02:43.
Didée is offline   Reply With Quote
Old 14th December 2006, 00:56   #9  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
That Code seems to work very well in conjunction with mcbob (it should be applied afterwards). Is this the sorta thing we can expect from the SoonToCome bobber Didée?
Terranigma is offline   Reply With Quote
Old 14th December 2006, 01:24   #10  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
Originally Posted by Terranigma View Post
That Code seems to work very well in conjunction with mcbob (it should be applied afterwards).
No. It should be applied during MCBob, not afterwards.

And surprise, basically it is already in v0.3:
EdiPost=2 does exactly this, just without the ContraSharpening. (Used is a slight pre-sharpening ... okay for EdiPost=1, but for 2 ^that^ kind of post-sharpening would be better.)

The trick is, when used after MCBob, then you'll change also the original fields. When used within, then the original fields remain unchanged.

Quote:
Is this the sorta thing we can expect from the SoonToCome bobber
No. That's too cheap.
For many types of realworld sources, this kind of processing is okay and can work out. But for really sharp + highly detailed sources, it takes too much away.
__________________
- 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 14th December 2006, 01:46   #11  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Quote:
Originally Posted by Didée View Post
No. It should be applied during MCBob, not afterwards.

And surprise, basically it is already in v0.3:
EdiPost=2 does exactly this, just without the ContraSharpening.
Thanks for the positive reply.

How would I go about editing mcbob, so that edipost2 would use ContraSharpening?
Terranigma is offline   Reply With Quote
Old 14th December 2006, 02:26   #12  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Thanks Didée .
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 14th December 2006, 04:11   #13  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
Originally Posted by Terranigma View Post
How would I go about editing mcbob,
Oh, you're going to make another famous mod? . . .

If result's like this, then it's OK.
__________________
- 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 14th December 2006, 09:19   #14  |  Link
Alain2
Registered User
 
Join Date: May 2005
Posts: 236
Quote:
Originally Posted by Didée View Post
If result's like this, then it's OK.
Quote:
[...]
(EdiPost==2) ? edidouble : last

# ( post-sharpen for EdiPost = 2 )
# ------------------------------------------------------
edidoubleD = mt_makediff(last,edidouble,U=3,V=3)
if EdiPost==2, isn't the second last of the above quote already equal to edidouble ?
Alain2 is offline   Reply With Quote
Old 14th December 2006, 13:43   #15  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Oops, indeed. Well spot. And two more syntax issues on top of that.
It's corrected now, try again.
__________________
- 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 14th December 2006, 16:36   #16  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Thanks Didée & Alain2


Edit:
I get an error when trying to load version c

Last edited by Terranigma; 14th December 2006 at 16:44.
Terranigma is offline   Reply With Quote
Old 14th December 2006, 20:10   #17  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Me too:

Code:
Script error: '\' can only appear at the beginning or end of a line
(MCBob_v03c.avs, line 39, column 43)
Then after removing leading spaces, I get:

Code:
Script error: expected ':'
(MCBob_v03c.avs, line 186, column 0)
David
wonkey_monkey is offline   Reply With Quote
Old 15th December 2006, 09:45   #18  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
line 39: avisynth does not like line-continuation+comments; it's one of the few bugs in the parser. Take the \ out and it'll work.

line 186: add a colon ( : ) to the end of line 184:
Code:
    diff2prev12= (mtnmode==0) ? diff2prev2 :
foxyshadis is offline   Reply With Quote
Old 15th December 2006, 10:37   #19  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Thanks for that. Now I get:

Code:
RemoveGrain: invalid mode 20


I also (previously) got an error that because of mt_lut, only YV12 and I420 are allowed. Are we losing out slightly on quality if we can't use YUY2?

David
wonkey_monkey is offline   Reply With Quote
Old 15th December 2006, 11:29   #20  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
You have to update removegrain. Hmm, no wiki so I don't have the link handy, let's see if google does... Ah, http://home.arcor.de/kassandro/Remov...emoveGrain.rar

Copy the files in there over your existing plugins. Obviously only copy up to the SSE level your system supports.

Since your source material is 99% probability of being YV12 converted to YUY2 by the decoder, it's very doubtful you'll lose any quality. But make sure you downconvert with interlaced=true! (mcbob should do this automatically, iirc mvbob does.)
foxyshadis 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 00:08.


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