digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Capturing / Recording (http://www.digitalfaq.com/archives/capture/)
-   -   Current PVR-250 AviSynth Script - Recommendations (http://www.digitalfaq.com/archives/capture/14188-current-pvr-250-a.html)

diazl 04-04-2006 05:49 PM

Current PVR-250 AviSynth Script - Recommendations
 
Hi Everyone,

Below is my current avs I'm looking for a second option how i might possibly optimize this script. The source is cable, and it's not the cleanest source. Currently using CCE as the encoder, to KDVD. Any recommendations would be greatly appreciated. Also looking to see if there is away to increase the speed. I might be overdoing it on the filters.

dgdecode_mpeg2source("E:\TVPROC\tv.d2v")
Import("C:\Program Files\AviSynth 2.5\filters\LimitedSharpenFaster.avsi")
Import("C:\Program Files\AviSynth 2.5\filters\LRemoveDust.avsi")
LeakKernelBob(order=1,sharp=true,threshold=7)
Lanczos4Resize(704,480,6,58,708,362)
Undot()

LRemovedust(17,1)
LimitedSharpenFaster()

Cnr2()
ConvertToYV12()
Deen()
AssumeBFF()
SeparateFields()
SelectEvery(4,1,2) #(4,0,3) for bottom field first
Weave()
ConvertToYUY2()

Dialhot 04-04-2006 06:24 PM

Undot + Deen + LremoveDust ? 8O
Are you sure you need all that ?

Remove at least Deen IMHO, and perhaps Undot also (depends on the real quality of the source).
And you should put the convertToYV12 higher in the script (preferabily after the mpeg2source, except if cnr() does not support YV12), you will gain 30% in speed. Or if you want to avoid all color conversion and don't mind to encode slowly, juste remove all the convertTo... lines.

diazl 04-04-2006 09:46 PM

Phil - Thanks! I agree. I will do some tests tomorrow morning. Thanks for the quick reply!

Boulder 04-05-2006 12:17 AM

Are you sure you cannot IVTC the clip?

The colorspace should already be YV12 when the source is loaded.

Try
Code:

dgdecode_mpeg2source("E:\TVPROC\tv.d2v",cpu=4)
Import("C:\Program Files\AviSynth 2.5\filters\LimitedSharpenFaster.avsi")
Import("C:\Program Files\AviSynth 2.5\filters\LRemoveDust.avsi")
LeakKernelBob(order=1,sharp=true,threshold=4)
Lanczos4Resize(704,480,6,58,708,362)

LRemovedust(17,1)
LimitedSharpenFaster()

Cnr2()
ConvertToYUY2()

AssumeTFF()
SeparateFields()
SelectEvery(4,0,3)
Weave()

I would throw CNR2 away and use FFT3DFilter or FFT3DGPU instead to clean the chroma. I'd also substitute LeakKernelBob for TDeint (which recently got a big performance boost).

Lately I've been doing motion compensated denoising which is very efficient when you are dealing with analogue captures. The downside is that it'll take quite a while to process but the result is worth it IMHO.

diazl 04-11-2006 10:16 PM

After a few days of testing, here is my current script. so far so good. :?: Any feedback or optimizations would be greatly appreciated. :?:

Objective: Single script to process TV capture from MCE PVR250 29fps interlace to burn to DVD. medium noise and dual purpose for video and animations.

I also wanted to keep the processing time to at most x2 the length of the capture. This script gets me close to a 2x encoding time with CCE (e.g. if the capture is 30 minutes, it takes approx. 60-70 minutes to process).

To maximize the processing time, script Bicubicresize the video capture from 720x480 to 352,480, apply filter then Lanczosresize to 704x480.

Reduce the processing time, and the results are clean! :D

Code:

#4.08.2006.1
Import("C:\Program Files\AviSynth 2.5\filters\DeHalo_alpha.avsi")
Import("C:\Program Files\AviSynth 2.5\filters\LimitedSharpenFaster.avsi")
Import("C:\Program Files\AviSynth 2.5\filters\LRemoveDust.avsi")
Import("C:\Program Files\AviSynth 2.5\filters\Soothe.avsi")dgdecode_mpeg2source("E:\Recorded TV\Sesame Street_WNET_10_04_2006_07_00_01.d2v")


UnFoldFieldsVertical(flip=true)

Bicubicresize(352,480)
DeHalo_Alpha()
LRemoveDust_YV12(17,1)

Soothe(LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,Smode=4,soft=24),last,24)

Lanczosresize(704,480) 

FoldFieldsVertical(flip=true)

Addborders(0,4,0,4)
ConvertToYUY2(Interlaced=True)

#
#
## Functions ###

function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}
 
function SetParity(clip c, bool parity)
{
    return parity ? c.AssumeTFF() : c.AssumeBFF()
}

function UnfoldFieldsVertical(clip c, bool "flip")
{
    flip = default(flip, false)
    oldParity = c.GetParity()
    c = c.AssumeTFF().SeparateFields().AssumeFrameBased()
    top = c.SelectEven()
    bottom = c.SelectOdd()
    c = StackVertical(top, flip ? bottom.FlipVertical()
    \                          : bottom)
    return c.SetParity(oldParity)
}

function FoldFieldsVertical(clip c, bool "flip")
{
    assert(c.Height() % 2 == 0, "FoldFieldsVertical: unexpected frame height")
    flip = default(flip, false)
    oldParity = c.GetParity()
    originalHeight = c.Height() / 2
    evens = c.Crop(0, 0, c.Width(), originalHeight)
    odds = c.Crop(0, originalHeight, c.Width(), originalHeight)
    odds = flip ? odds.FlipVertical() : odds
    c = Interleave(evens, odds).AssumeFieldBased().AssumeTFF().Weave()
    return c.SetParity(oldParity)
}

#
####


Boulder 04-12-2006 03:59 AM

Use LimitedSharpenFaster to upsize, I think it's the parameters dest_x and dest_y. You can then remove the LanczosResize line. You'll probably need to raise the ss_x and ss_y parameters though, in any case, you should use a higher value than 1.0.

If you use Fold/UnfoldFields and resize, you might get problems due to incorrect aligning of the fields. I'm not sure whether it applies to a case where you end up in the same resolution as the original video is in. You might want to test that.

What CPU do you have?

diazl 04-12-2006 05:09 PM

Boulder Thanks! I have a pentium 4 with HT enabled. I will do some more testing on with this version later this week.

Here is latest version:

Code:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MVTools.dll")
Import("C:\Program Files\AviSynth 2.5\filters\DeHalo_alpha.avsi")
Import("C:\Program Files\AviSynth 2.5\filters\FastLineDarken.avsi")
Import("C:\Program Files\AviSynth 2.5\filters\LimitedSharpenFaster.avsi")

Import("C:\Program Files\AviSynth 2.5\filters\LRemoveDust.avsi")
Import("C:\Program Files\AviSynth 2.5\filters\Soothe.avsi")

dgdecode_mpeg2source("E:\Recorded TV\Sesame Street_WNET_10_04_2006_07_00_01.d2v")
#LeakKernelBob(order=0,sharp=true,threshold=7)

#converttoyuy2().convert60ito24p(2,0).converttoyv12()

UnFoldFieldsVertical(flip=true)

Bicubicresize(352,480)
#ScriptClip(" nf = YDifferenceToNext()" +chr(13)+ "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ).TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1)  ")

DeHalo_Alpha()
LRemoveDust_YV12(17,1)

videosource  = last.Lanczosresize(704,480)
videoLS  = videosource.LimitedSharpenFaster(ss_x=1.2,ss_y=1.2,dest_x=704,dest_y=480,Smode=4,soft=24)
Soothe( videoLS, videosource, 24 )

FoldFieldsVertical(flip=true)

Addborders(0,4,0,4)
ConvertToYUY2(Interlaced=True)
Trim(3112,101619)

#
#
## Functions ###

function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}
 
function SetParity(clip c, bool parity)
{
    return parity ? c.AssumeTFF() : c.AssumeBFF()
}

function UnfoldFieldsVertical(clip c, bool "flip")
{
    flip = default(flip, false)
    oldParity = c.GetParity()
    c = c.AssumeTFF().SeparateFields().AssumeFrameBased()
    top = c.SelectEven()
    bottom = c.SelectOdd()
    c = StackVertical(top, flip ? bottom.FlipVertical()
    \                          : bottom)
    return c.SetParity(oldParity)
}

function FoldFieldsVertical(clip c, bool "flip")
{
    assert(c.Height() % 2 == 0, "FoldFieldsVertical: unexpected frame height")
    flip = default(flip, false)
    oldParity = c.GetParity()
    originalHeight = c.Height() / 2
    evens = c.Crop(0, 0, c.Width(), originalHeight)
    odds = c.Crop(0, originalHeight, c.Width(), originalHeight)
    odds = flip ? odds.FlipVertical() : odds
    c = Interleave(evens, odds).AssumeFieldBased().AssumeTFF().Weave()
    return c.SetParity(oldParity)
}

#
####


Boulder 04-13-2006 12:31 AM

As you have a HT-capable CPU, I recommend you try this:

http://forum.doom9.org/showthread.php?t=94996

Extract the avisynth.dll in your Windows\System32 directory overwriting the old one. Extract the mt.dll in your plugins folder.

Put the line SetMTMode(2) as the first line in your script. See if you get any performance boost.

If you don't have a MaskTools v2 version of Soothe yet, it's here : http://forum.doom9.org/showthread.ph...366#post784366

MaskTools v2 alpha is here : http://forum.doom9.org/showthread.php?t=98985

diazl 04-14-2006 06:29 PM

Boulder - Thanks for the tip! I gained 20% increase of speed. I test the various MT modes to see the effects on the various filters and report back. Here is my latest version:

Code:

SetMTMode(4)
dgdecode_mpeg2source("e:\Recorded TV\work\Baby Looney Tunes_TOON_14_04_2006_07_00_02.d2v")

UnFoldFieldsVertical(flip=true)

Bicubicresize(352,480)


DeHalo_Alpha().LRemoveDust_YV12(17,1)
Soothe(LimitedSharpenFaster(ss_x=1.2,ss_y=1.2,Smode=4,soft=24),last,24)

ScriptClip(" nf = YDifferenceToNext()" +chr(13)+ "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ).TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1)  ")

Lanczosresize(704,480)

FoldFieldsVertical(flip=true)

ConvertToYUY2(Interlaced=True)
Addborders(0,4,0,4)

#
#
## Functions ###

function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}
 
function SetParity(clip c, bool parity)
{
    return parity ? c.AssumeTFF() : c.AssumeBFF()
}

function UnfoldFieldsVertical(clip c, bool "flip")
{
    flip = default(flip, false)
    oldParity = c.GetParity()
    c = c.AssumeTFF().SeparateFields().AssumeFrameBased()
    top = c.SelectEven()
    bottom = c.SelectOdd()
    c = StackVertical(top, flip ? bottom.FlipVertical()
    \                          : bottom)
    return c.SetParity(oldParity)
}

function FoldFieldsVertical(clip c, bool "flip")
{
    assert(c.Height() % 2 == 0, "FoldFieldsVertical: unexpected frame height")
    flip = default(flip, false)
    oldParity = c.GetParity()
    originalHeight = c.Height() / 2
    evens = c.Crop(0, 0, c.Width(), originalHeight)
    odds = c.Crop(0, originalHeight, c.Width(), originalHeight)
    odds = flip ? odds.FlipVertical() : odds
    c = Interleave(evens, odds).AssumeFieldBased().AssumeTFF().Weave()
    return c.SetParity(oldParity)
}

#
####



All times are GMT -5. The time now is 06:26 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.