digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: VHS and Capture script? (http://www.digitalfaq.com/archives/avisynth/4528-avisynth-vhs-capture.html)

Bilal 07-14-2003 10:17 PM

Avisynth: VHS and Capture script?
 
Is the VHS and Capture optimal script for avisynth 2.5? because it looks small, can you use the dvd and clean material script for captures?
Bilal

ovg64 07-14-2003 10:37 PM

Good Question the Capture script in the Optimal is only for ASynth 2.08

ak47 07-14-2003 11:47 PM

Here is what I used for Vhs captures on AVIsynth 2.52

Code:

## DLL Section ##
#
LoadPlugin("C:\encoding\mpeg2dec3.dll")
LoadPlugin("C:\encoding\sampler.dll")
LoadPlugin("C:\encoding\decomb.dll")
LoadPlugin("C:\encoding\STMedianFilter.dll")
LoadPlugin("C:\encoding\unfilter.dll")
LoadPlugin("C:\encoding\gripfit.dll")
LoadPlugin("C:\encoding\asharp.dll")
LoadPlugin("C:\encoding\undot.dll")
LoadPlugin("C:\encoding\TomsmoComp.dll")
LoadPlugin("C:\encoding\LoadPluginEx.dll")
LoadPlugin("C:\encoding\DustV5.dll")
#
####

## Defined Variables and Constants ##
#
MaxTreshold = 1.50
nf =  0 # Current frame.
#
####

## Main section and static filters ###
#
Mpeg2Source("I:\winfast\KensinT1P1.d2v") 
#
Telecide(Post=false)
Decimate(Cycle=5)
tomsmocomp(1,17,1)
undot()
Limiter()
asharp(1, 4)
GripCrop( width=544, height=480, overscan = 3)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
ConvertToYuY2
GoldDust()
ConvertToYV12
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.15))
#
#

## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:

SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
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) ")

#
#
#

GripBorders()
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
Limiter()

#
#
## Functions ###

function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}

#
####

There really isn't a filter for 2.5x that clean extreme noise good so you have to revert back to older filter like dust. You can experiment with the different type of dust filters but gold dust seems the fastest (except space dust but that isn’t a strong filter) and most compressed but my TV captures weren't so noisy.

Bilal 07-15-2003 02:05 AM

cool thanks for that :)

ak47 07-15-2003 11:47 AM

Sorry for being late on this, but you don't have to follow this script to the exact, you probably already know that, but just to make sure, you should change the MergeLuma(blur(0.15)) to MergeLuma(blur(0.1)) like kwag says(I was doing this because I was encoding and anime). Also you shouldn't have that high resolution of a TV capture; I just did it because I was testing the power of it. And the last thing tomsmocomp usually should be (1,?,1) and the question mark should change it kind of changes from computer to computer see what one give you the best speed/size/quality, make sure you stay in the limit of -1 - 30 its best if you only do odds.

Boulder 07-15-2003 01:25 PM

Don't use values higher than 5 in TomsMoComp! It's a known fact that it may produce weird artifacts and even the author, Tom Barry, recommends 5 as the maximum Search Effort value.

ak47 07-15-2003 01:29 PM

Thanx Boulder I didn't know that at all. I just didn't notice any weird artifacts.

Bilal 07-15-2003 06:36 PM

i downloaded all the filters needed for your script ak47 all except LoadPluginEx.dll because i couldn't find it, but do i have to go back to an earlier version of avisynth to use it?
Bilal

ak47 07-15-2003 08:28 PM

Ya you could get it here http://www.avisynth.org/~warpenterprises/ it's in the WarpSharp Package called warpsharp_25_dll_20030121. But next time hit search on this forum it’s been asked about it location a lot of times, but since your new here its ok.

P.S. just call me ak it’s my initials

Have fun with your captures.

Bilal 07-15-2003 09:59 PM

thanks AK i thought you called yourself that after the gun ak47 :)

dredj 07-25-2003 07:30 PM

Hi Ak, I notice in your script you use .d2v instead of avi, did u capture to mpeg2 or mpeg1 or avi file? the reason i ask is because your source seems to be in yv12 colorspace.

thanks,
dredj

Seeker 07-30-2003 04:14 PM

Help with script
 
I get an error running the script at the start of this topic, '....MSVCP71.DLL was not found....'. :(
Any ideas??? :lightbulb:

Wilbert 07-30-2003 04:33 PM

You need to move the two dll's in

http://www.geocities.com/wilbertdijkhof/71.cab

to your system/system32 dir of windows.

Seeker 07-31-2003 12:03 PM

Thanks
 
Thanks Wilbert, worked a treat..... :D

Funny :? I've seen no mention of these files before on this site, I wonder why I'm the first to have a problem with them :?:

All I have to do now is sort out the 'Upside down mirror problem' with my output file. I've tried all the suggestions to date and none seem to work :(

Wilbert 07-31-2003 02:59 PM

Code:

Funny  I've seen no mention of these files before on this site, I wonder why I'm the first to have a problem with them
With older versions of LoadPluginEx.dll you needed the 6.0 resp. 7.0 versions.

Quote:

All I have to do now is sort out the 'Upside down mirror problem' with my output file. I've tried all the suggestions to date and none seem to work
Could you give the link to that thread?

Seeker 07-31-2003 03:57 PM

Upside down
 
The thread was http://www.kvcd.net/forum/viewtopic....ghlight=upside

Here is the 'AVIcodec' info from one of my captured files:-
File : 1.55 GB (1.55 GB), duration 0:29:48, type AVI, 1 audio stream(s), quality 72 %
Video : 1.24 GB, 5976 Kbps, 25.0 fps, res. 352*288 (4:3), BW10 = Unknown, Supported
Audio : 300 MB, 1411 Kbps, 44100 Hz, 2 chan., 0x1 = PCM, Supported


I use a Broadway Capture card:- http://www.b-way.com/
It's not just the above file that is causing problems, it's any that I've captured using this card.
They're fine if I use TMPGEnc on it's own, it only occurs when I use TOK. :?

incredible 08-21-2003 12:00 PM

Sorry, late reply but maybe someone else who's also searching in here to see an alternative script for interlaced Tv captures can maybe try this script:
(change to NTSC values if needed)

EDIT: Moved the fade-command lines to the end of the script (see Jorel's advices further down)

Code:

 
#============================================== 
# An AviSynth 2.5 Script für (PAL) Tv Captures
#==============================================

### The needed Plugins for Avisynth 2.5!!! will be loaded in here
### If you miss one you can find it here:
### http://www.avisynth.org/~warpenterprises/

LoadPlugin("C:\Programme\AviSynth 2.5\plugins\MPEG2Dec3.dll")
LoadPlugin("C:\Programme\AviSynth 2.5\plugins\STMedianFilter.dll")
LoadPlugin("C:\Programme\AviSynth 2.5\plugins\GripFit_YV12.dll")
LoadPlugin("C:\Programme\AviSynth 2.5\plugins\FluxSmooth.dll")

### Load the avi file

AviSource("D:\The path to your capture stream.avi")

### Change for GripFit into the YV12 colorspace

ConvertToYV12()

### Now we change the size (in here I use 480x576 PAL SVCD Size)

GripCrop(480, 576, overscan=0, source_anamorphic=false)
GripSize(resizer="BilinearResize")

# To work with the following integrated VirtualDub Plugin 
# you have to change into the RGB32 Colorspace

ConvertToRGB32()

### We intentionally use the Vdub-Deinterlacer AFTER the resizing,
### cause we did not modify the high of the movie (576!) 
### By not modifying the Videos high at "GripCrop" above
### we keep the interlaced lines correctly "alive", but on the other side
### we enjoy a faster deinterlacing process cause of less horiz. size!

### A very good VirtualDub Deinterlacer "SmartDeinterlace"
### with a good compromise of Quality and speed
### Download: http://vdfilters.videoxone.de/downlo.../smart27b2.zip

LoadVirtualdubPlugin("C:\Your path to the Vdub Smart interlacer plugin\Smart.vdf","_VD_smartdeinterlace",1)
_VD_smartdeinterlace(0, 1, 15, 100, 0, 0, 0, 0, 1, 2, 1, 0)

### Back to the YV12 colorspace to continue working with the following filetrs

ConvertToYV12()

### Unsharp mask using Asharp

asharp(2, 2)

### Now we remove the noise from the capture videostream

#FluxSmooth(2, 2) # In case of heavy noise, remove the "#" at the BEGINNING of this line ;-)
STMedianFilter(8, 15, 4, 7)

MergeChroma(blur(1.58))
MergeLuma(blur(0.2))

GripBorders()

### Fading the Video and Audio in at beginning and out at the end
### Thanx for Jorel's advice so I moved this to the end of this script

FadeIn(50)
FadeOut(125)

If someone gots an advice to use other logical kind of filters for denoising,
just let me know I'm on experimental ways ... always ;-)

With this script I received very good deinterlaced streams, here an example (this example is orig. still at 768x576 (not mpeg) and NOT resized to 480x576, but you can assume the Quality at a horizontally resized format):

http://www.digitalfaq.com/archives/error.gif

A very easy way to find out which values (like the (0, 1, 15, 100, 0, 0, 0, 0, 1, 2, 1, 0)-Line at the Deinterlacer part) are the best for NTSC is:

Open your Avi in Vdub... choose this smart deinterlacer filter ... choose your settings in the "Smart Deinterlacer"-window ... do a preview until you stuck with the best quality ... safe the "processing settings" in Vdub ... open this Vdub-settings"...vcf" file in the Windows editor .... copy exactly the values as shown above ... an paste them into the Script at the Deinterlacing Part. Thats it! ;-)

jorel 08-21-2003 12:10 PM

incredible,
i did tons of tests using fade and here are my simple observations:

use fade in the end of the script, is faster and give me
some problems when is in the begining,
now i don't remember what error...

important:
when (if) you search the prediction,
remove the lines with fade cos will give wrong CQ values.

:wink:

incredible 08-21-2003 12:15 PM

Quote:

Originally Posted by jorel
incredible,
i did tons of tests using fade and here are my simple observations:

use fade in the end of the script, is faster and give me
some problems when is in the begining,
now i don't remember what error...

important:
when (if) you search the prediction,
remove the lines with fade cos will give wrong CQ values.

:wink:

Really! Good advice ...

So I move the Lines containing the fade-commands to the end of the script ...?
And whats about the incorrect CQ Value if I use prediction (yes I do ;-))???
Should I remove the fade commands while prediction and add them again before encoding totally?

Thanx a lot!

PS: What means "cos" in combination with fade you wrote

jorel 08-21-2003 12:25 PM

yes my friend,
you're right in all observations!

remove the lines with fade to got predictions....
then put fade to the (very)end of the script to encode.

:)

oh...cos?
means :arrow: because.....is in klinglish!
:lol:


All times are GMT -5. The time now is 04:58 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.