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 12th July 2009, 11:25   #1  |  Link
shoopdabloop
Registered User
 
Join Date: Mar 2009
Posts: 166
Is this script already as optimized as can be?

Or can it be optimized more with no visible difference?

Here's a 7z containing an unprocessed sample, a processed clip of the sample, and the script:
http://www.megaupload.com/?d=4OTM5OL0

the unprocessed sample isn't technically unprocessed; i loaded an AVS with a simple AviSource of the source and a KillAudio into VDM, took a sample of it, and re-encoded it with a dvsd codec (cedocida) very similar to the original (sony dv) because i wasn't sure how to get a sample otherwise. but the post-script output looks identical when operating on the original source compared to the provided sample. (the provided one is compressed with xvid, however)

and just in case you just want to look at the script, here it is:

Code:
#filters used:
#MT, removegrain, nnedi2, motionprotectedfps, mvtools2, fft3dfilter, gradfun2dbmod, warpsharp (2003), and depan

AviSource("filmlook sample - unprocessed.avi").AssumeBFF()
MT("removegrain()",0,splitvertical=true,overlap=4)
nnedi2(field=-2)
motionprotectedfps(239.76)
b = selectevery(10, 1)
selectevery(10, 0)
Merge(b)
#the merging of the two slightly different points in time simulates a 1/48 shutter speed from the original 1/60
LanczosResize(752,500)
MT("""
super = MSuper()
bv2 = MAnalyse(super,isb=true, delta=2)
bv1 = MAnalyse(super,isb=true, delta=1)
fv1 = MAnalyse(super,isb=false,delta=1)
fv2 = MAnalyse(super,isb=false,delta=2)
MDegrain2(super,bv1,fv1,bv2,fv2)
""",0,overlap=4)
MT("fft3dfilter()",0,splitvertical=true,overlap=4)
MT("gradfun2dbmod()",0,splitvertical=true,overlap=4)
MT("warpsharp(64)",0,overlap=4)
mdata = DePanEstimate(trust=0)
DePanStabilize(data=mdata,dxmax=12,dymax=12,mirror=12)
Crop2(720,356)
#simply a shorthand for Crop(16,72,-16,-72)
AddBorders(0,62,0,62)
ColorYUV(levels="TV->PC")
#final output: 720x480 23.976p
shoopdabloop is offline   Reply With Quote
Old 12th July 2009, 15:17   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
What do you mean by "optimized"?
Guest is offline   Reply With Quote
Old 12th July 2009, 17:29   #3  |  Link
Nightshiver
Quality Freak
 
Join Date: Jun 2007
Location: Area 52
Posts: 597
I suppose he wants it to encode faster. But essentially for that, you need a better computer, as you are already using MT to make things go quicker.

Last edited by Nightshiver; 12th July 2009 at 20:46.
Nightshiver is offline   Reply With Quote
Old 12th July 2009, 21:02   #4  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
MT("removegrain()",0,splitvertical=true,overlap=4)
nnedi2(field=-2)
MDegrain2(super,bv1,fv1,bv2,fv2)
""",0,overlap=4)
Why do you use three denoisers? fft3dfilter is enough. Also try GPU version. Replace nnedi2(field=-2) with Yadif deinterlacer. Quality will be better and speed will be alot faster.
Atak_Snajpera is offline   Reply With Quote
Old 13th July 2009, 04:56   #5  |  Link
shoopdabloop
Registered User
 
Join Date: Mar 2009
Posts: 166
quality will be better if i use yadif and take away mdegrain? i highly doubt that.
shoopdabloop is offline   Reply With Quote
Old 13th July 2009, 07:07   #6  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
You don't need three denoisers! I does not make sense at all.

yadif


nnedi2
Atak_Snajpera is offline   Reply With Quote
Old 13th July 2009, 22:03   #7  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,699
I see artifacts in the floor for the Yadif version.

@shoopdabloop
Quote:
quality will be better if i use yadif and take away mdegrain? i highly doubt that.
Read his post again. He never said that. What he says is that you only need to use one denoiser. Either only use MDegrain2, or only use FFT3DFilter/GPU, etc...
Personally, I like to use MCTemporalDenoise for my heavy filtering. However, you can usually achieve whatever effect you desire using only FFT3DFilter/GPU due to its ability to be tuned for specific noise frequencies.

As for the Yadif deinterlacer argument, I never did like Yadif myself. I always see artifacts whenever I use it. I never use NNEDI2 alone, only in combination with TFM/TDeint.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo

Last edited by Adub; 13th July 2009 at 22:10.
Adub is offline   Reply With Quote
Old 13th July 2009, 22:24   #8  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Quote:
I see artifacts in the floor for the Yadif version.
I see ugly edges in nnedi2 version



nnedi2 as deinterlacer is useless. it deinterlaces whole picture intead of specific areas and it is slooooooowww as heeeeeelllll.....
Atak_Snajpera is offline   Reply With Quote
Old 13th July 2009, 22:55   #9  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,699
Exactly why it's meant to be used with TFM/TDeint. NNEDI is used to generate the pixels sampled from by TDeint. I agree with you. NNEDI should not be used alone to deinterlace, but Yadif isn't flawless either. The way that NNEDI is used in standalone can introduce "stair stepping" aka aliasing. Which is why I use it as a sample platform, not final output.

However yadif has it's flaws as well, which mostly appear in the thresholds of edges:
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 13th July 2009, 23:49   #10  |  Link
shoopdabloop
Registered User
 
Join Date: Mar 2009
Posts: 166
well, nnedi2 is my favorite deinterlacer because it has a nice balance between speed, smoothness, and realism, so i will try combining it with TDeint.
but my source is 100% interlaced, so will it really help much?

also, i will see what i can do about the denoisers.
shoopdabloop is offline   Reply With Quote
Old 14th July 2009, 00:35   #11  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,699
Yes it will. Not TFM but TDeint will. TDeint (as can be guessed by the name) is also a deinterlacer. But one of the nice things about is that you can specify an external clip to be used for pixel sampling when deinterlacing a frame.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 14th July 2009, 02:41   #12  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by shoopdabloop View Post
but my source is 100% interlaced, so will it really help much?
Yes, because the adaptive deinterlacers, such as TDeint(), affect only the combed parts of each frame.
Guest is offline   Reply With Quote
Old 14th July 2009, 02:50   #13  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
The general point stands.

Quote:
Originally Posted by shoopdabloop View Post
i don't even think there are any points in my source where there is no visible combing
Maybe you should actually look and see.
Guest is offline   Reply With Quote
Old 14th July 2009, 02:57   #14  |  Link
shoopdabloop
Registered User
 
Join Date: Mar 2009
Posts: 166
err, i was hoping no one had replied to that post when i deleted it.

you're talking about low-detail areas, correct? i didn't realize i had so many.

now, about the denoisers... i'm not sure how to get rid of one or two of them without losing visual quality... (i've already taken out removegrain)

Last edited by shoopdabloop; 14th July 2009 at 03:05.
shoopdabloop is offline   Reply With Quote
Old 14th July 2009, 02:59   #15  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Not just that. I mean, in general, you should make a definitive determination about your video when deciding the appropriate treatment, not work using the "I think" approach. You're obviously concerned about quality, so spend some time on the analysis phase.

Anyway, a low-detail area won't be affected as much by a deinterlacer, i.e., detail loss will be less significant.

Last edited by Guest; 14th July 2009 at 03:03.
Guest is offline   Reply With Quote
Old 14th July 2009, 09:11   #16  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: UK
Posts: 1,673
For quite fast but quite good deinterlacing, try yadifmod + nnedi(2). Best of both worlds (hopefully).

Or leave temp gaus mc running overnight!

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 14th July 2009, 16:45   #17  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,699
Yeah, I would have to agree on the TempgaussMC option. However, it is unimaginably slow if you want to encode a DVD in a couple of hours.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 15th July 2009, 10:36   #18  |  Link
m3mbran3
Registered User
 
Join Date: Jun 2009
Posts: 90
I see lots of mention of use of nnedi and TDeint, but how do these work together? can someone post an avisynth script snippet.
The reason I ask is because I have an interlaced PAL VHS source that I am deinterlacing using
Code:
AssumeTFF()
nnedi2(qual=3)
but would be keen to try out different methods, encoding time is not an issue for me.

edit: here is the rest of the script, pretty similar to shoopdabloop actually.
Code:
DGDecode_mpeg2source("C:\familyvids\xmas1989\Xmas 1989 to be trimmed.d2v", info=3, cpu=4)
ColorMatrix(hints=true, interlaced=true, threads=0)
ColorYUV(autowhite=true)
HDRAGC()

AssumeTFF()
nnedi2(qual=3)
crop( 12, 2, -12, -12)

mdata = DePanEstimate()
DePanStabilize(data=mdata, method=1, mirror=15)

TemporalDegrain(degrain=2)
Spline36Resize(720,576)
LSFmod(strength=80)

Last edited by m3mbran3; 15th July 2009 at 10:54.
m3mbran3 is offline   Reply With Quote
Old 15th July 2009, 12:13   #19  |  Link
shoopdabloop
Registered User
 
Join Date: Mar 2009
Posts: 166
TDeint(edeint=nnedi2())

for bobbing:

TDeint(1,edeint=nnedi2(field=-2))
shoopdabloop is offline   Reply With Quote
Reply

Tags
film, multithreaded, optimize, script

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 14:07.


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