digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: A good script for captures? (http://www.digitalfaq.com/archives/avisynth/12652-avisynth-good-script.html)

the viking 10-18-2004 02:40 PM

Avisynth: A good script for captures?
 
Hi,after several days and nights testing different scripts,I ended up with
this one:

LoadPlugin("C:\Programfiler\AviSynth 2.5\plugins\MPEG2Dec3.dll")
LoadPlugin("C:\Programfiler\AviSynth 2.5\plugins\Undot.dll")
LoadPlugin("C:\Programfiler\AviSynth 2.5\plugins\grip.dll")
LoadPlugin("C:\Programfiler\AviSynth 2.5\plugins\STMedianFilter.dll")
LoadPlugin("C:\programfiler\AviSynth 2.5\plugins\Blockbuster.dll")
LoadPlugin("C:\Programfiler\AviSynth 2.5\plugins\SmoothDeinterlacer.dll")
DirectShowSource("G:\Video Capture\capture 3.avi",fps=25)
ConvertToYUY2()
SmoothDeinterlace()
Blockbuster(method="noise",detail_min=1,detail_max =3,variance=0.1,seed=1)
GripCrop(352, 288, overscan=1, source_anamorphic=false,dest_anamorphic=false)
GripSize(resizer="LanczosResize")
undot()
STMedianFilter(3, 3, 1, 1 )
GripBorders()

The video source was VHS,captured with Pinnacle DC10Plus card
at res.720x540(Crop function "on"),one hour long concert film,
10,5 GB AVI-size.

Encoded with min bitrate 300,max bitrate 2000, CQ 82,
in TMPGEnc,final filesize was 784MB.

The quality was very good tesing on a 21 inch.TV.

So my question,does any of you have better ideas for filters to use
for VHS-captures??Or better settings for the filters I already use?

After doing some searching and reading around here,it
seems that "Dust" was the ultimate filter for captures,but as far as
I can see it only works with AviSynth 2.0.. :?:

Thanks

------------------------------

Viking

Boulder 10-19-2004 03:13 AM

This is what I've used lately for my caps (the ones that are progressive):

Code:

MPEG2Source("c:\temp\captures\clip.d2v",idct=7)
#Trim here
ColorYUV(off_y=6,gain_y=-18) # See the capture guide at Doom9 to determine the values
RemoveGrain(mode=2)
#Crop() here
CNR2() # Use v2.61, it's the only one that works!
ConverttoYUY2()
PeachSmoother(baseline=1.38,noiselevel=2.04,dospatial=false) # read the docs carefully on how to determine the values!
UnFilter(-5,-5)
#Resizing here
#Borders added here
Limiter()

I find PeachSmoother a very good denoiser for analog captures. Too bad it's YUY2 only, but then again, I encode in CCE so the conversion would have to be done anyway. UnFilter(-5,-5) gives a nice compression boost and also hides some temporal filtering artifacts that may occur.

the viking 10-19-2004 03:52 PM

Hi Boulder,

Okay,Ill run some tests with Peach Smoother and Unfilter to compare
the results.

But I have a newbie question;how to get progressive captures?
I don't think I have the option to capture proggressive in my pinnacle
software?or is it just to adjust the capture resolution to a resolution
that don't support interlace(352x288)???Or am I "totally" lost here on this
question? :?

--------------------
viking

Boulder 10-20-2004 03:15 AM

Some captures are progressive, some are not. It depends completely on the broadcasted material (and the original). If it's a concert video, it's very likely that it is truly interlaced.

Load the avi clip in VirtualDub, if you see comb artifacts in high motion, it is interlaced. There are some special cases, which incredible wrote about in the thread containing my guide to treating interlaced sources. But basically if you don't see any combing, it's progressive no matter if the resolution is n x 576. Here in Finland the subtitles often have combing when they fade in and out, I use the line FieldDeinterlace(blend=true,full=false,threshold=1 00) after the MPEG2Source line to get rid of that without touching any other frames.

I strongly recommend that you use KernelDeint() or TDeint() instead of SmoothDeinterlace().

http://forum.doom9.org/showthread.php?s=&threadid=81322
http://forum.doom9.org/showthread.php?s=&threadid=82264

Do you do DVDs or xVCDs only? If you do a DVD, you could use 352x576 and encode as interlaced.

the viking 10-20-2004 04:05 AM

Ok,The material is Interlaced.Ill see comb artifacts,horizontal lines
both in VDub and when I play the video clips in WMP.

Ill also took a look at "Eagles" Hell Freezes Over DVD
in DVD2AVI,and no problem to see that its interlaced.

I will try KernelDeint() or TDeint() next encoding.

Yeah,I do both DVDs and xVCDs.Ill make a try with
352x576 and encode as interlaced,using the script from
your guide to deal with interlaced sources.

When my AVI's have resolution x540,I guess Gripborders()
or Addborders() will add borders so the results will be x576
without stretching the picture?
When I capture at x576 I got noise at the bottom of the picture,
thats why I capture at x540.

--------------------------

viking

Boulder 10-20-2004 04:12 AM

You should always capture at the vertical res 576! Crop the garbage (actually it's head switching noise) off in the script right after deinterlacing!

the viking 10-20-2004 04:35 AM

Ok, ill try to capture in x576 then.
According to FitCD,when I set target to 352x576,ill get a "real" resolution of 320x528 when I use 2 blocks overscan.I guess that will kill the noise.
Or do you have other metods?

Thanks
---------------
viking

Boulder 10-20-2004 04:41 AM

FitCD will only resize and then add the borders, which means that the garbage will still be there. You'll have to determine the number of pixels to be cropped with VDub for example and then place the Crop line in the script and tell FitCD the number of pixels you have cropped. It's also a good idea to crop all the black borders off the source while you're at it.

Boulder 10-20-2004 04:44 AM

Let's assume you have 4 pixels of black on the left, 6 on the top, 10 on the right and 24 pixels of garbage at the bottom.

You'd use the line Crop(4,6,-10,-24) in your script (after the deinterlacing) and then input those values in FitCD. Don't let FitCD do any extra cropping so choose "No Cropping" !

the viking 10-20-2004 04:57 AM

Ill give it a try.

thanks

--------------------

viking

the viking 10-20-2004 05:21 AM

But back to the x540 capturing,when I have a 720x540 clip,its real
aspect is 1,3333,setting target to 720x576 ill get a real aspect
of 1.3371,and,correct me if im wrong,I dont see that small
A/R error when watching my movies.
So it seems to me that it isnt any big mistake to capture x540 :?:

# -= AviSynth v2.5.5.0 script by FitCD v1.2.3 =-
AVISource("C:\Documents and Settings\All Users\Dokumenter\Pinnacle Studio\Captured Video\Video 1.avi",pixel_type="RGB24")
SeparateFields()
LanczosResize(704,288,0,0,720,270).Weave()
AddBorders(8,0,8,0)

----------------------
viking

Boulder 10-20-2004 05:28 AM

It is a big mistake. You're not capturing all the information there is. I don't see why you won't capture at the full vertical resolution.

You shouldn't use SeparateFields() if you resize, use a smart bobber for that (found in the guide!). You shouldn't trust FitCD's scripts, it's only good for getting the correct values for resizing and borders :wink:

Also the pixel_type seems weird, are your captures RGB24? You should try to capture in YUY2 if possible.

the viking 10-20-2004 06:16 AM

Okay,it was just a question :wink:

Ill capture with full vertical resolution.

I got two options in my Pinnacle software,768x576 uncropped,
and 384x576 uncropped.I think the last one
will do fine for composite VHS captures.

I don't use FitCD scripts for my encoding.

Ill use Kernelbob like you wrote in your guide when im doing
Interlace to Interlace encodings.That works fine.Just a little
bit slow maybe??


Yes I my captures are RGB24,I have to use ConvertToYUY2
when I used SmoothDeinterlace() so I think they are RGB24.
But I use this line in the script:DirectShowSource("G:\Video Capture\capture 3.avi",fps=25)
as you can see in my first post on this page.

----------------------------
viking

Boulder 10-20-2004 06:35 AM

Yes, 384x576 should be enough for VHS. However, for better denoising without destroying all the details, 768x576 might be better.

To determine the colorspace, create a simple script with AVISource() loading the source and then after that the line Info(). What does it tell you? I suppose the DC10 card encodes in MJPEG which should be YUY2. Can you use the card for capturing in VirtualDub?

Prodater64 10-20-2004 06:39 AM

Quote:

Originally Posted by the viking
But back to the x540 capturing,when I have a 720x540 clip,its real
aspect is 1,3333,setting target to 720x576 ill get a real aspect
of 1.3371,and,correct me if im wrong,I dont see that small
A/R error when watching my movies.
So it seems to me that it isnt any big mistake to capture x540 :?:

# -= AviSynth v2.5.5.0 script by FitCD v1.2.3 =-
AVISource("C:\Documents and Settings\All Users\Dokumenter\Pinnacle Studio\Captured Video\Video 1.avi",pixel_type="RGB24")
SeparateFields()
LanczosResize(704,288,0,0,720,270).Weave()
AddBorders(8,0,8,0)

----------------------
viking

I am reading about crop and resize also, and Incredible point me at http://www.arachnotron.nl/videocap/d..._cap_v1_en.pdf

Read also http://www.kvcd.net/forum/viewtopic.php?t=11053

All capture cards, captures with a Pixel Aspect Ratio (PAR) not equal than 1:1.
Usually 1.0926:1.
This means that when you capture, your card (see card specifications at end of pdf file) that are capturing at 704*576 (1.0926:1 PAR), will be 768*576 (1:1 PAR)
This PAR it is not related in any way with Display Aspect Ratio (DAR), that you usually know as 4:3, 16:9 or 1.3333, 1.7777.
Then, when you capture 720*540 (It is rare that you can capture at height different to 576), surely your PAR is 1.0926:1 and your res expressed in 1:1 PAR will be 787*540 and DAR of 787*540=1.46. But all over 768 horizontal won't be showed in TV. Then you must to crop vertical res until reach 1.46 DAR with an horizontal res of 768 (I repeat, higher than 768 won't be showed in TV).

768/1.46=526 but you need sometimes mod 4 res, then your final res would be 768*528 (1:1). Some filters needs mod 16 res, then your final res would be (you are lucky) 768*528 (1:1).
But as you need to get 1.0926:1 values:
768/1.0926=702,91 and you need mod 4 or mod 16 -> 704*528 whose DAR is =...
I leave this for you.
I don't know if I understand good all this stuff, but you are a good examination for me. Let me know.

Boulder 10-20-2004 06:43 AM

I think that the simplest guide would be Doom9's analog capture guide.

Some cards scale and some don't, you just have to know whether your card does that (you'll have to know the chipset). If it doesn't scale, enable the ITU compliance in FitCD. If it does scale, disable it.

the viking 10-20-2004 08:08 AM

@Boulder:I've loaded Info() into WMP,and your right,
Colorspace is YUY2.

I can not use the card for capturing in VDub,I dont know why.

@Pro:Ill read the links tonight,a little busy right now :arrow:

-------------------
viking

Boulder 10-20-2004 08:12 AM

Could be that because you've used DirectShowSource to load the clip, the colorspace has been RGB. It's better to use AVISource anyway :wink:

the viking 10-20-2004 11:40 AM

I can't use "AVISource" on my captures,I got following error
from AviSynth: "Could not decompress frame 0"

Boulder 10-20-2004 11:46 AM

That means that you don't have a decoder for the MJPEG stream. Quite odd that Pinnacle doesn't include a VfW decoder but only a DirectShow one. Did you use DirectShowSource in that Info() test?


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