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?

the viking 10-20-2004 12:10 PM

Boulder wrote:
Code:

Did you use DirectShowSource in that Info() test?
Yes I did.

the viking 10-20-2004 05:05 PM

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

Boulder 10-21-2004 02:28 AM

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.

incredible 10-21-2004 05:55 AM

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:

Originally Posted by Prodater
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)

If you want to be precise ....
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"

Boulder 10-21-2004 06:11 AM

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.

incredible 10-21-2004 06:16 AM

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.

Boulder 10-21-2004 06:31 AM

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.

the viking 10-22-2004 04:03 AM

Hello,I was reading a lot of guides/topics about resolutions/
A/R /active picxel area/DAR/PAR/sampling..... :? yesterday.

Inc. wrote:
Quote:

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.
I haven't found out which µs the incoming signal will be sampled,
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:

4.7 What do you mean by saying it is better to avoid 720×540?
The problem with this resolution is that while you think you are editing in a format that is both 1) 4:3 square pixels and 2) easily convertable to a standard video resolution (either 720×576 or 720×480) just by vertical resampling, you are not. See the table. There is no real world video format that would use full 720 pixel horizontal range as the width of the active 4:3 frame.

In order to get to a standard video format from this one, you need to take in account the actual form of the sampling matrices. The 4:3 area in 625-line formats is 702×576, not 720×576. In 525-line formats it is 711×486, not 720×480. Resizing a 720 pixels wide 4:3 format directly to 720×576 or 720×480 simply won't work. You will either have to resample in both directions (unlike you originally thought, you do not get to keep the image width neatly as 720 pixels at all times), or to crop some top and bottom lines off.

If you need to construct an intermediary square-pixel resolution that is a) exactly 720 pixels wide and b) covers exactly the same area as 720x576 or 720x480 (thus only having to resample in vertical direction for conversions), you will end up with two separate resolutions, one for each video standard:

The 720 pixels wide square-pixel equivalent of 720×576 (ITU-R BT.601 pixels for 625-line systems) is 720×526.5 pixels
The 720 pixels wide square-pixel equivalent of 720×480 (ITU-R BT.601 pixels for 525-line 4739/9systems) is 720×526 + 5/9 pixels
Fortunately, the numbers will nicely round up to 720×527 for both standards.

Note that the original interlaced field structure (if any) will go haywire as you mess around scaling in the vertical direction.
Sooo...There won't be any more capturing at 720x540 for me I guess :!:

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

incredible 10-22-2004 04:35 AM

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 ;-)

the viking 10-22-2004 04:59 AM

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

incredible 10-22-2004 05:17 AM

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:

my videos om TV with visible black borders all the way around,I have to go above Addborders(16,16,16,16)
Like Muaddib statet, you can a) perform a Pan-scanning by zooming the picture when INCREASING the height by entering the resize buttons (like if you would like to Pan-Scan a movie from 2.35:1 Cinemascope to 1.85:1 Widescreen).
Or ....b) performing a Zoom-out of the screen (as you like to) by decreasing the size at the resize buttons.

the viking 10-22-2004 06:15 AM

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

incredible 10-22-2004 07:16 AM

An AR Error 1.01% is within the tolerance .... and maybe a noticable value for the ants (IMHO) :wink:

Boulder 10-23-2004 08:34 AM

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.

the viking 10-24-2004 02:56 PM

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:

AviSource("G:\Capture 768x576\Video 1.avi")
Crop(6,4,-6,-12)
Then I loaded the script into FitCD,choosed "No Cropping" as you
said,and with one block overscan I came out with this
resize/border lines:
Quote:

LanczosResize(688,560,0,0,756,560)
AddBorders(16,8,16,8 )
The A/R error for this operation was 0,44%.

With two blocks overscan I got this values:

Quote:

LanczosResize(672,544,0,0,756,560)
AddBorders(24,16,24,16)
The A/R error here was -0,11%.

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:

Q3.8: What/when do I care when filter X works in RGB- or YUV-space ? A: The main reason why you should care is the improvement in speed you can obtain by not unnecessarily changing between colorspaces. If your source is YV12 (when encoding DVD's for example, or captures from digital sources) try to use only filters/plugins which work in YV12-space. On the other hand if your source is in RGB (for example from analog captures) try to use only filters/plugins which work in RGB-space.

Speed is also quite different between the different colorspaces, because each colorspace takes up different amounts of memory. The slowest colorspace is usually RGB24, because every pixel has an odd alignment in memory, avoid using this mode. The fastest mode is usually YV12 (followed by YUY2), because data only takes up half as much space as RGB32. So if you have to process your video a lot, try using ConvertToYV12 or ConvertToYUY2 before you do your filtering. Note that ConvertToRGB converts to RGB32 if the source is YV12/YUY2 - use ConvertToRGB32 to force a RGB24 to RGB32 conversion.
So I don't know whats the correct colorspace for this captures.

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:

LoadPlugin("C:\programfiler\AviSynth 2.5\plugins\kerneldeint.dll")
LoadPlugin("C:\Programfiler\AviSynth 2.5\plugins\UnDot.dll")
LoadPlugin("C:\Programfiler\AviSynth 2.5\plugins\STMedianFilter.dll")
AviSource("G:\Capture 768x576\Video 1.avi")
KernelBob(order=1,sharp=true,threshold=7)
AssumeFrameBased()
Crop(6,4,-6,-12)
undot()
STMedianFilter(3, 3, 1, 1 )
LanczosResize(688,560,0,0,756,560) #one block overscan
AddBorders(16,8,16,8 )
SeparateFields()
SelectEvery(4,1,2) # SelectEvery(4,0,3) for bottom field first video
Weave()
ConvertToRGB24(interlaced=true) # For TMPGEnc or VFAPI
Trim(0,3150)
And the results was Ok,
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

Boulder 10-25-2004 02:39 AM

I tweaked your script a little:

Code:

LoadPlugin("C:\programfiler\AviSynth 2.5\plugins\kerneldeint.dll")
LoadPlugin("C:\Programfiler\AviSynth 2.5\plugins\RemoveGrain.dll")
LoadPlugin("C:\Programfiler\AviSynth 2.5\plugins\STMedianFilter.dll")
DirectShowSource("G:\Capture 768x576\Video 1.avi")
KernelBob(order=1,sharp=true,threshold=7)
AssumeFrameBased()
RemoveGrain(mode=2)
Crop(6,4,-6,-12)
STMedianFilter(3, 3, 1, 1 )
LanczosResize(688,560) #one block overscan
AddBorders(16,8,16,8 )
AssumeBFF()
ConvertToRGB24() # For TMPGEnc or VFAPI
SeparateFields()
SelectEvery(4,1,2) # SelectEvery(4,0,3) for bottom field first video
Weave()
Trim(0,3150)

I switched to DirectShowSource and replaced UnDot() with RemoveGrain(mode=2) and moved the ConverttoRGB24 line before reinterlacing, which will give better quality. I also added AssumeBFF() to the script to make sure the result is TFF.

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.

incredible 10-25-2004 02:55 AM

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.

the viking 10-25-2004 04:05 AM

@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

Boulder 10-25-2004 06:28 AM

I think you should uninstall PicVideo v3 so that Pinnacle's own codec is used (check with GraphEdit).

the viking 10-25-2004 07:38 AM

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


All times are GMT -5. The time now is 10:09 AM  —  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.