digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Capturing / Recording (http://www.digitalfaq.com/archives/capture/)
-   -   Recording Video: Capturing interlaced + filters (http://www.digitalfaq.com/archives/capture/12052-recording-video-capturing.html)

ginoboy 09-10-2004 09:11 AM

Recording Video: Capturing interlaced + filters
 
Hi,

I began to do captures, and I am wanting to codify interlaced, for that I am using the script:

Code:

captura="capture1_huffyuv.avi"

avisource(captura)
JDL_UnfoldFieldsVertical(true)
JDL_FoldFieldsVertical(true)
letterbox(16,16,16,16)
converttoyuy2()

I also changed the configurations in CCE, I incapacitated "progressive frame flag", in "block scanning order" I put "alternate" and in "video -> offset line" changed for 0.

I am capturing with huffyuv in 704x480 -> YUY2 (my capture card is a bt878). I wanted to know a GOOD script to remove noises among other parameters to improve the image and compression. I will pass for KDVD.

All of the parameters to codify interlaced they are right?

Thanks.

Dialhot 09-10-2004 10:00 AM

Can you tell us where you find these "JDL_*" fonctions ?

incredible 09-22-2004 05:14 PM

@ Phil

http://www.avisynth.org/stickboy/
;-)



@ Ginoboy

Unfolding/folding fields does make ONLY sense when filtering interlaced inputs! So if you do NOT put any filters between these Xfoldfields commands, they are useless.

Boulder 09-23-2004 02:07 AM

For some tips, see http://www.kvcd.net/forum/viewtopic.php?t=13768 .

ginoboy 11-07-2004 11:59 AM

Hi, i'm back.. Thank's for reaply's

please, verify for me:

Quote:

AviSource("captura_vhs (2004-11-07 at 13-50-59).avi",false)

KernelBob(order=1,sharp=true,threshold=7)
AssumeFrameBased()

crop(8,0,696,480)

removegrain(mode=8)

addborders(12,0,12,0)
letterbox(12,12,0,0)

ConverttoYUY2()
AssumeBFF()
SeparateFields()
SelectEvery(4,1,2) # SelectEvery(4,0,3) for bottom field first video
Weave()
he is correct?

it seems to have been..

somebody recommends good filters to me for VHS capture of average quality (average for good)?

thanks!

Boulder 11-07-2004 12:13 PM

Your script looks OK to me, for some more filtering try this:

Code:

AviSource("captura_vhs (2004-11-07 at 13-50-59).avi",false)

KernelBob(order=1,sharp=true,threshold=7)
AssumeFrameBased()

removegrain(mode=2)
crop(8,0,696,480)
CNR2()
TemporalSoften(2,5,5,15,2)

addborders(12,0,12,0)
letterbox(12,12,0,0)

#ConverttoYUY2()  # your capture is already in YUY2 so this is not needed
AssumeBFF()
SeparateFields()
SelectEvery(4,1,2) # SelectEvery(4,0,3) for bottom field first video
Weave()

You'll need the CNR2 plugin, www.avisynth.org/warpenterprises . Get the v2.61, it's the only one that will work. KernelDeint was also updated today, http://gast3.ssw.uni-linz.ac.at/~kp/...eint_1.5.2.zip

You might also want to check if the chroma is shifted, which it probably is because you have a VHS capture. http://www.doom9.org/capture/chroma_artefacts.html

incredible 11-07-2004 03:32 PM

These days I encountered a VERY big Problem with the Remove series!

I treated "Fahrenheit 9/11" as capture for a mpeg2 encoding.

It was broadcasted as a fieldblended conversion directly from a telecined 29.97 state to 25.000 PAL.
I could have used Restore24() but for me actually fieldblended restorings to progressive via restore24() is actually no more an issue as Its ok if these kind of catures do fit on one CD in a extreme good quality. And as we do encode to mpeg2 for TV Purposes, a interlaced keeped encoding is ok for me.

Now the problem:

These Remove... Filters do mess up when interlaced stuff is delivered! Do check a station Logo, ... I tried a lot of changes in the script but it doesnt helped. Did you also encountered such Problems??


BTW: In the script above I wouldn't do the bobber using Kerneldeint() as you only perform an anti noise treatment. For that denoising routines you should ONLY use a "stupid" bob. As that bob() doesnt enhance captured artifacts like noise etc.

So a....

bob()
DenoiseingFiltersHere()
separatefields().selectevery(4,0,3).weave() # 4,1,2 for F'order change
KernelBob(...)
ResizingFiltersHere()
separatefields().selectevery(4,1,2).weave() # or 4,0,3 for F'order change

;-)

kwag 11-07-2004 03:40 PM

Hi Inc,

Wouldn't it be better to change:

ResizingFiltersHere()
separatefields().selectevery(4,1,2).weave() # or 4,0,3 for F'order change


To:

separatefields().selectevery(4,1,2).weave() # or 4,0,3 for F'order change
ResizingFiltersHere()

At the end ot the script :?:

-kwag

Boulder 11-07-2004 04:40 PM

No, because the material is reinterlaced..and resizing an interlaced video is a no-no :wink:

I use KernelBob because it keeps more details. A stupid bob bobs everything whereas a smart bob leaves the non-combed parts intact and treats them as if they were progressive. You might want to ask Scharfi about detailed explanations as he's tested these things a lot.

A softer bob would be TMCBob() or KernelBob with sharp=false parameter. I have used only RemoveGrain lately with mode=1 or 2, fed with smartbobbed video but I haven't noticed anything strange. I'll have to check that tomorrow, I've got one capture clip to be processed.

Actually someone said that Bob() is lossless only if b=0, that is Bob(0,x). The defaults are Bob(1/3,1/3). That might be worth remembering :idea:

kwag 11-07-2004 05:09 PM

Quote:

Originally Posted by Boulder
No, because the material is reinterlaced..and resizing an interlaced video is a no-no :wink:

Too tired here :oops:
The screen letters are getting mixed up :lol:

-kwag

ginoboy 11-07-2004 06:54 PM

Quote:

Originally Posted by Boulder
]You might also want to check if the chroma is shifted, which it probably is because you have a VHS capture. http://www.doom9.org/capture/chroma_artefacts.html

Ok, thanks... in this picture:

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

it observes the red shirt, these pink risks would be "chroma's shifted" ?

I tested some filters cited in link, but I did not perceive difference....

what it would be this?

@ Inc

about: http://www.vmesquita.com/forum/index.php?topic=66.15

for NTSC, pixelview bt878 (driver's btwincap WDM) and huffyuv codec, the correct resolution to capture would be 704x480?

thank's all....

incredible 11-08-2004 02:14 AM

Quote:

Originally Posted by Boulder
I use KernelBob because it keeps more details. A stupid bob bobs everything whereas a smart bob leaves the non-combed parts intact and treats them as if they were progressive. You might want to ask Scharfi about detailed explanations as he's tested these things a lot.

:) Yep I know and I also understood it like you do.
But Scharfi at Gleitz.de explained me/us that in case of a denoising a stupid bobber like bob() does it better as ...

bob().separatefields().selectevery(4,0,3).weave()

is a NOP ;-) And denoising in an untouched condition would be the best.
Resizing is another issue where a smart bobber is shurely a better choice, thats why I "quoted" that 2 bibbing-example from gleitz.de.

Quote:

Actually someone said that Bob() is lossless only if b=0, that is Bob(0,x). The defaults are Bob(1/3,1/3). That might be worth remembering :idea:
Yep! I would like to "understand" these kernels of 1/3,1/3 and 0,0.6 and so on .... as you can apply a lot of effects by choosing a specific one like a more bluring procedure.
Like that gauss() function from MugFunky, as he downscales with that the iage to a quarter of it size and rescales it using a special kernel in bicubicresize so the blurring gots a very good quality one.

Thats also why there some ones have been asked for a medianBlur() function as Avisynth actually gots no high actig gaussian blur function, only that blur(1.58) or unfilter(-100,-100) or asharp with negative values used.



@ Ginboy

Where did you got these cropping/bordering parameters???
Code:

crop(8,0,696,480)
...
...
addborders(12,0,12,0)
letterbox(12,12,0,0)
...
...

Seems a bit odd .....
At least you should process borders at MOD16.

ginoboy 11-08-2004 05:42 PM

Hi Inc,

I captured in 704x480...

Code:

crop(8,0,696,480)
I cut 8 pixels of the left to remove the black borders.

then he was 696x480...

Code:

addborders(12,0,12,0)
I added 12 pixels of border in left and 12 in the right to be with 720x480 and equal borders. 696+12+12=720.

and...

Code:

letterbox(12,12,0,0)
I "painted of black" that part that is with imperfections in low e also in top to be equal.

:arrow: Final resolution = 720x480, no resize and a good overscan. :wink:

thank you very much!

fragmaster170 11-08-2004 08:28 PM

these may help, whatever you can do in Vdub can probably be done with avisynth.
http://www.doom9.org/index.html?/cap...artefacts.html
http://www.doom9.org/index.html?/cap...sing_vdub.html

incredible 11-09-2004 01:01 AM

@ Ginoboy

Leave the 704x480 finally at 704x480 as its a d1 cropped compatible DVD format, NO need to force a 720 encoding afterwards of captured sources - no sense!

So

Avisource("Your704x480capture.avi")
Letterbox(16,16,16,16)

Does it all you need, means overlaying MOD16 based 16px all around for getting rid of border garbage and beside this applying the 16px around overscan area.

kwag 11-09-2004 01:09 AM

Quote:

Originally Posted by incredible
@ Ginoboy

Leave the 704x480 finally at 704x480 as its a d1 cropped compatible DVD format, NO need to force a 720 encoding afterwards of captured sources - no sense!

And on top of that, add an overscan block, to gain even more compression ;)

-kwag

incredible 11-09-2004 03:36 AM

In deed Karl

Quote:

Originally Posted by Incredible
Letterbox(16,16,16,16)

:lol:

Well only one "block" doesnt make that much sense (maybe a bit) as meg encoding at main level is done in 4:2:0 and there the chroma is half the resolution of luma (in both directions) and so you have to choose a 2blocks Overscan, so 16px each side as 16 devided by half chroma is 8 and thats the gain :D

EDIT!: Ahhh, you mean a resized overscan! Yep shurely in case of captures incl. black horiz. borders like 1.85:1 ones you will gain from even more compression - right!

the viking 11-09-2004 05:15 AM

Hi,interesting things to read here,
Boulder wrote:
Code:

and resizing an interlaced video is a no-no
So thats why we resize in a deinterlaced mode.Resizing a interlaced video
will mess up the interlaced structure I read somewhere in this forum.
Then I guess we can say the same about cropping,only do that in deinterlaced mode :?: If yes I may have understood something :lol:

So I made a test encoding yesterday with a stupid-bob before
de-noiseing and a smart-bob before resizing:
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")
LoadPlugin("C:\programfiler\AviSynth 2.5\plugins\Cnr2.dll")
DirectShowSource("D:\Capture 768x576\Video 0.avi",fps=25)
bob(0,0)
AssumeFrameBased()
RemoveGrain(mode=2)
Crop(6,4,-6,-12)
Cnr2()
STMedianFilter(3, 3, 1, 1 )
separatefields().selectevery(4,0,3).weave() # 4,1,2 for F'order change
KernelBob(order=1,sharp=true,threshold=7)
LanczosResize(688,560) #one block(resized)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(6,1670)

and the results looks ok to me.One thing im not sure about is the
bob values:bob(0,0) Is this the way to do it lossless :?:

Another question,I bought some hollywood-movies on VHS,
is it the same with this as with DVD,that 99% is framebased(progressive) film :?:
I captured one of them("Trinity Is Still My Name" :roll: ),and could not see any combing effects at all.

thanks
-----------------------
viking

Boulder 11-09-2004 05:20 AM

Quote:

Originally Posted by the viking
Hi,interesting things to read here,
Boulder wrote:
Code:

and resizing an interlaced video is a no-no
So thats why we resize in a deinterlaced mode.Resizing a interlaced video
will mess up the interlaced structure I read somewhere in this forum.
Then I guess we can say the same about cropping,only do that in deinterlaced mode :?: If yes I may have understood something :lol:

You can crop interlaced video, there's just a couple of things to remember. See the Avisynth docs' Crop section for them.

Quote:

One thing im not sure about is the
bob values:bob(0,0) Is this the way to do it lossless :?:
It's lossless if the first value is zero, i.e. Bob(0,x) will be lossless. The parameters are the same(?) as in BicubicResize.

Quote:

Another question,I bought some hollywood-movies on VHS,
is it the same with this as with DVD,that 99% is framebased(progressive) film :?:
I captured one of them("Trinity Is Still My Name" :roll: ),and could not see any combing effects at all.
That's correct. There's no difference between VHS and DVD on this matter. If the transfer has been done correctly, a Hollywood movie is in 99% of the cases progressive.

the viking 11-09-2004 05:56 AM

Boulder wrote:
Code:

You can crop interlaced video, there's just a couple of things to remember. See the Avisynth docs' Crop section for them.
So I found this:

Code:

In order to preserve the data structure of the different colorspaces, the following mods should be used. You will not get an error message if they are not obeyed, but it may create strange artifacts. For a complete discussion on this, see DataStorageInAviSynth

In RGB:

width no restriction

height no restriction if video is progressive

height mod-2 if video is interlaced

In YUY2:

width mod-2

height no restriction if video is progressive

height mod-2 if video is interlaced

In YV12:

width mod-2

height mod-2 if video is progressive

height mod-4 if video is interlaced

So when I have a YUY2,interlaced video,I set "round to 2" both for
width and height in FitCD and the result will be correct.

But if I bob() the same video like the in the script of my last reply,
AviSynth threats it framebased(progressive),then I will need mod 2
for width and I have no restriction for height,right :?:

thanks
-----------------
viking


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