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 |
This is what I've used lately for my caps (the ones that are progressive):
Code:
MPEG2Source("c:\temp\captures\clip.d2v",idct=7) |
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 |
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. |
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 |
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!
|
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 |
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.
|
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" ! |
Ill give it a try.
thanks -------------------- 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 |
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. |
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 |
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? |
Quote:
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. |
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. |
@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 |
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:
|
I can't use "AVISource" on my captures,I got following error
from AviSynth: "Could not decompress frame 0" |
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?
|
Boulder wrote:
Code:
Did you use DirectShowSource in that Info() test? |
Problem solved,after searching,downloading and
trying several codecs,I found one that let me use AVISource() for captures in AviSynth, the name is "AVIcodec v. 1.1.0.4",and can be found on this page: www.codec-download.com So I think its goodbye to DirectShowSource() now. :wink: :!: Boulder; When I loaded the info() test with AVISource() after the codec installation,colorspace reported was YV12. -------------------------- viking |
I'm not 100% sure which one would be better as it would be good to know the native colorspace. There's nothing wrong with using DirectShowSource, it's just that it used to cause issues but with the latest AviSynth versions there have been no known problems. I think you might want to ask incredible about it, if I remember correctly he has/had a DC30 so he might be able to advise you better.
|
The DC 10/30 series and their driver do capture in 768x576 or 640x480 directly. Also you can use 384x576 as its a half PAL resolution out of PAR 1:1 768x576
- two possibilities a) The driver caps using 14.769mhz and 52.000µ (14.769*52 = 768) b) or uses 13.5mhz and 52.000µ (=702) AND scales up to 768 width. The purpose of the DC Series wasnt only to capture but also to do a hardware playback DIRECTLY to TV specs which IS 13.5*52=720, so I do assume the option b) "could" be the internal process of the driver. Anyway.... As you got NO option to capture at 704 width for instance, YOU SHOULD keep the full PAR 1:1 capture width, means 768!! So capping at 768x576(PAL) or 640x480(NTSC) is OBLIGATORY! Cropping out trashy edges will be done ALWAYS afterwards in Avisynth or Vdub. The vfw Driver: Yep, right, the delivered Pinnacle mjpeg decoder "could" be only a directshow one. But no Problem, as you should look out for the "PicVideo mjpeg codec". That one comes as a vfw AND directshow codec, so no Problem if opening that DC resulted mjpeg stream AS IT IS in a ... directshow decoding environment - Mediaplayer - Graphedit - Avsiynths "Diretshowsource()" - TmpgEnc's directshow import - etc.... vfw decoding environment - Vdub - CCE - Avisynths "Avisource()" - TmpgEncs "Avi file reader" - etc ... Quote:
The active ITU compilant capture window of FULL pal at square pixels is 702, not 704 ... the mega-correct way would be capping at 13.5mhz at 52.000µ and adding to the 702 result 1pix right and 1px left of simple black to get a 100% right AR .... but thats like "sex between ants" as they say in germany :wink: BUT! .... You have to look at the card specifications at WHICH µs the incoming signal will be sampled AND WHAT will be used as µs by your outputting Device like a SAP. Example: A Cinergy400 from Terratec WITH the orig Cinergy driver used, captures in an ITU compilant signal way as followed ... 13.5mhz are used and sampling is done by 52.148µs! The result is 704 (13.5*52.148) Now that 704x576 Signal will be processed by your DVD SAP as followed .. Playback at 13.5*52.148 = 704 So that Cinergy Card in combo with its driver does directly output a 1:1 compilant stream width for playback on a DVD Device at cropped D1 (=704 width) Also do have a look at that VERY excellent doom9 capture guide, where the co-author wilbert has listed some parameters of some card/driver combinations and HOW you do resize/crop in the mhz/µs way ... which would be the total right (remember the ants ;-) ) way. Thats for instance very important in case of a capture to mpeg4 encoding! As its possible to fine-adjust PC monitor proportions, but TV Screen Proportion adjustments arent available for many TVmodels like for PC Monitors :( Also its a big compromise when trying to get a 100% AR! Because if your card just samples 2-4px incorrect, you must ask yourself ... "Do I want to end up in a 100% AR but in a blurrier result cause of the interpolation during a resizing so I do correct these 2-4px OR do I want to end up in a sharper orig image but 1% AR Error" |
I recall that a registered PicVideo codec v2 (there's v3 available now) was installed with some shareware capture application and the codec stayed even if you uninstalled the capture app itself! I just don't remember the name, maybe it was ShowShifter? I even tried searching at Doom9 and the VDub forums but couldn't find it.
|
Also FFdshow does play back "mjpg" FourCCs in directshow environments AND also in vfw envirenments by its internal ffdshow-vfw engnine.
BUT ... Im not shure if its capable to decode interlaced mjpeg footages correctly! The Encoding engine of that libavcodec based mjpeg codec CANT encode fieldbased and stripes-errors will be the result out of a ffdshow mjpg interlaced input encoding. |
I also wouldn't trust ffvfw with interlaced sources.. it's best to stay at those that surely know how to deal with the material.
|
Hello,I was reading a lot of guides/topics about resolutions/
A/R /active picxel area/DAR/PAR/sampling..... :? yesterday. Inc. wrote: Quote:
This is the only specs. I can find: -Plug and Play 32 bit PCI board with bus mastering interface -Video inputs:1 composite and one S-Video -Video outputs:1 composite and one S-Video -Video Capture and Output: -Video Format:PAL/SECAM/NTSC(SECAM:input only) -Frame Rate:Up to 25 frames per second/50 fields per second(PAL) -Frame size:Up to 768x576 -Compression:MJPEG,user selectable from 3:1 to 100:1 -MicroMV support requires Win XP About PICVIDEOv3codec,yes its installed,have a look HERE for the settings,there is also a picture of the specs.for my SAP. I found this article at http://www.uwasa.fi/~f76998/video/conversion/: Quote:
But a question,maybe teoretical, but I have a lot of captures in 720x540,and I want to get them on a KVCD/KDVD.SO when I load the captures into FitCD the program reports(of course) a real aspect of 1.3333,resizing to,lets say 624x512 also have a real aspect of 1.3333,so if I use 624x512 with black borders all the way around the picture I can put it on a 720x756 KDVD,and at the same time get all active pixels in the 720x540 picture. Or is it a better way to do it :?: Its a lot of work capturing all the video once again 8O Take a look HERE and you see what I mean(I hope) :) But as I said,Ill capture in 768x576 from now on. Thats all for now :crashed: Anyone that can point me to some kind of "how to crop noisy edges with Virtual Dub" article?I havent found any Thanks --------------------------- viking |
Well in case of a 720x540 capture cropped OUT of real 768x576 signal by the driver, that simply means cropped each side of the width by 16 and each side of the height by 8 thats called the "cache" in a PAR 1:1 state.
So the real gain is that you reduce a bit the Artifacts at the SAME MB/sec rate your capturing in. Your link tells the truth (IMHO) as THAT input IS PAR 1:1 (like XVID/DIVX): http://www.digitalfaq.com/archives/error.gif BUT!!!!: Your result gots too much overscan (but AFAIK that was your intention, right?) as Addborders(48,32,48,32) should never go above Addborders(16,16,16,16) in case of playback on a TVdevice (just a reminder) And also DO UNCHECK ALL RGB CHECKBOXES! As your input is YUY2 and only should be changed IF filters do need another colorspace ... and at the end ONLY use ConverttoRGB24() in case of using TmpgEnc for encodig, .. or in case of CCE ConverttoYUY2() !! BTW: Your PAR 1:1 Captures are almost prediscinated to be encoded using DIKO! I recommend you to have a look at it as its a great tool to get also PAR 1:1 captures on one DVD ;-) |
Yeah,DIKO is great,have tried it.
But I learn more of doing it the "old fashioned way",i.e. VirtualDub -FitCD-AviSynth-TMPGEncPlus-TMPGEnc DA-Nero. Yes the heavy borders was my intention.IF I want to present my videos om TV with visible black borders all the way around,I have to go above Addborders(16,16,16,16). :?: According to the scripts from FitCD,I only use the rezise and addborders line from it. But a simple question after all my reading,when source is 1.3333 and rezised movie is 1.3333 everything is ok?Right? when source is 1.8234 and rezised movie is 1.8234,its ok? When source is 1.8243 and rezised movie is 1.8379 I got a A/R error of 1.0075% am I right :?: IF yes I think i have understood something :lol: Thanks -------------------- viking |
The same output AR as the INPUT AR "would" be optimal.
BUT as mostly we do change from incoming PARs to outgoing PARs, its inevitable to perform a compensated minimal cropping by fitcd to KEEP the output AR as most accurate as possible! And still you often end up with a minimal AR Error wich wont be noticable on the final viewing device. Quote:
Or ....b) performing a Zoom-out of the screen (as you like to) by decreasing the size at the resize buttons. |
Ok Inc.,Ill think I get your point.
Let's say we want to to do a backup of a 720x576 DVD to 704x576 DVD.Source real aspect is 1.3675,using target 704x576 with one block overscan the movie is rezised to 688x560 ,and that will give us a target real aspect 1.3441,and the A/R error will be 1.01% or something like that.And that small error we cant see on a TV. (Back to the ants having sex :lol: ) Thats right? All calculations is done with FitCD. --------------------------------- viking |
An AR Error 1.01% is within the tolerance .... and maybe a noticable value for the ants (IMHO) :wink:
|
And what comes to determining the crop values with VDub, load the clip in VDub, add the filter "null transform" (in fact just about any filter will do), click OK and choose 'Cropping'. Get the correct values and feed them to FitCD and add them to your script. You should keep some basic points in mind when cropping, see the Avisynth documentations Crop page.
|
Yeah,I figured that out Boulder.
So I captured at 768x576 yesterday,loaded the clip into VDub Mod, cropped off some noisy edges,and created a script like this: Quote:
said,and with one block overscan I came out with this resize/border lines: Quote:
With two blocks overscan I got this values: Quote:
I've made test encodings with both options,and it looks OK on my TV. So back to the colorspaces... When I load : AviSource("G:\Capture 768x576\Video 1.avi") Info() In WMP I get the following values: FRAME: 524 COLORSPACE: YV12 WIDTH: 768 HEIGHT: 576 FPS: 25 FIELDBASED (SEPARATED) VIDEO: NO PARITY: ASSUMING BOTTOM FIELD FIRST VIDEO PITCH: 768 BYTES HAS AUDIO: YES AUDIO CHANNELS: 2 SAMPLE TYPE: INTEGER 16 BIT SAMPLES PER SECOND: 44100 CPU DETECTED: x87 MMX ISSE SSE 3DNOW 3DNOW_EXT When I load : DirectShowSource("G:\Capture 768x576\Video 1.avi",fps=25) Info() In WMP I get the following values: FRAME: 524 COLORSPACE: YUY2 WIDTH: 768 HEIGHT: 576 FPS: 25 FIELDBASED (SEPARATED) VIDEO: NO PARITY: ASSUMING BOTTOM FIELD FIRST VIDEO PITCH: 1536 BYTES HAS AUDIO: YES AUDIO CHANNELS: 2 SAMPLE TYPE: INTEGER 16 BIT SAMPLES PER SECOND: 44100 CPU DETECTED: x87 MMX ISSE SSE 3DNOW 3DNOW_EXT And Reading on AviSynth homepages told me this: Quote:
But I make test encodings,one with AVISOURCE() and one with DIRECTSHOWSOURCE(),using TMPGEnc,so I added ConvertToRGB24() at the end of the script,and my eyes could not see any difference on the encoded movies. :!: Anyone have any ideas what's the best one to use? So then I tried to make a complete script for this clip,using Boulder's script for interlaced sources,it went out like this: Quote:
maybe try some other filters will give even better results.More testing tomorrow. :) So if anyone see something in my post here that doesn't make sense,tell me please. Thanks ------------------------------- viking |
I tweaked your script a little:
Code:
LoadPlugin("C:\programfiler\AviSynth 2.5\plugins\kerneldeint.dll") It goes like this: AssumeBFF() + SelectEvery(4,1,2) = TFF video AssumeBFF() + SelectEvery(4,0,3) = BFF video AssumeTFF() + SelectEvery(4,1,2) = BFF video AssumeTFF() + SelectEvery(4,0,3) = TFF video As we are not sure which is the original colorspace, I recommend sticking with the codec that the card's software installed. Thus DirectShowSource should give the best results. |
Also you have to watch out WHATS used when playing back that stream via Directshowsource (as said, when PicVideo is installed it also comes with a vfw-compount which is used by Avisource() ).
Directshowsource is tricky! (seeking, preview!-syncing, Dshow chain order/inserts by the system). Do ope your source in Graphedit and you see how the Dshow chain is build by your system. |
@Inc.:Ok,I opened the .avi file in GraphEdit.
The result(chain) is HERE on top of the page. @Boulder,your "new" script give great results,I've made a test encoding now and the quality is very good. :) --------------------- viking |
I think you should uninstall PicVideo v3 so that Pinnacle's own codec is used (check with GraphEdit).
|
So I uninstalled PICVideo 3,uninstalled AviSynth,restart PC,
installed AviSynth,restart PC,then tried AviSource("G:\Capture 768x576\Video 1.avi") Info() and get that "Could not decompress frame 0" error. And so the funny part, :lol: ,when I load: DirectShowSource("G:\Capture 768x576\Video 1.avi",fps=25) Info() in WMP it reports colorspace RGB32 :!: screenshot from GraphEdit after uninstalling PICVideo HERE On the last screenshot there is a "color space converter" I noticed. ----------------------- viking |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.