Log in

View Full Version : TV-Capture editing with avisynth2.07


sillKotscha
20th January 2003, 15:56
Hi folks,

for my personal taste I found out that the following script can give very, very good results.

- starting with (Cable-TV):

1. [PicVideo]MJPEG @q19, Luma2, Chroma3 - and according to my ATI-Radeon-AIW a resolution of 720x540 (strange/ peculiar resolution, I know but I have to use it only while capturing with MJPEG otherwise all is screwed up - I don't know why?!)


LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Cnr2.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Convolution3D.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\MSharpen.dll")
AVISource("D:\Capture\source.avs")
#where source.avs = SegmentedAviSource("D:\Capture\CAPTURE000.avi")
crop(3,0,715,538) [# your personal values]
SeparateFields().SelectEven() # if needed
Convolution3d(0,3,4,3,4,3,0) # 1. described later on
Cnr2(-1,35,192,47,256,47,256) # 2. described later on
MSharpen(25,100,true,false,false) # 3. described later on
BicubicResize(512,352,0,0,5) # 4. described later on


2. Huffyuv-FullPal 720x576


LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Cnr2.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Convolution3D.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\MSharpen.dll")
AVISource("D:\Capture\source.avs")
#where source.avs = SegmentedAviSource("D:\Capture\CAPTURE000.avi")
crop(11,0,695,570) [# your personal values]
SeparateFields().SelectEven() # if needed]
Convolution3d(0,3,4,3,4,3,0) # 1. described later on
Cnr2(-1,35,192,47,256,47,256) # 2. described later on
MSharpen(25,100,true,false,false) # 3. described later on
BicubicResize(512,384,0,1) # 4. described later on


ad1:
- as you can see, it's nearly the same as (preset="movieHQ") and I only played around with the second and second last value

ad2:
- here I played with the [mode]=first value, where [0]=default

ad3:
- for MSharpen I liked a threshold of 25 very much (first value, 15=default I think)

and last but not least...

ad4:
- here I played with the 'c' coefficient - as you know from GKnot: [~,0.75 = sharp], [~,0.5 = neutral], here: [~,1 = (very?) sharp, I don't know :D ], etc. pp

ad5:
- and of course you can try Con3D before Cnr2 and vice versa

ok, I hope you'll like and tweak your scripts ;)

according to 'SegmentedAviSource' with avisynth 2.07, one last word...

have a look at my post, within this thread:
- GKnot 0.27 Segmented AVI loading (http://forum.doom9.org/showthread.php?s=&postid=244997#post244997)

happy testing :D

- regards Sill

vidiot
20th January 2003, 19:00
@sillkotscha,

first I´ve to say I love the cute picture from "KINDER-".
They have this for over 30 years now...?

I missed my "I used it nearly always" filter:
TELECIDE() (Decomb)

It´s often (very often) needed with working on captured anime
(in my case "Trickfilme" for younger kids), but also good on other sources sometimes.
Think about it and try it, if it works you can save the separate fields of course...

kind regards
Harald

sillKotscha
21st January 2003, 05:33
Originally posted by vidiot
@sillkotscha,

first I´ve to say I love the cute picture from "KINDER-".
They have this for over 30 years now...?

hehe, thanks - I don't really know how long they have this kind of 'brand'

Originally posted by vidiot
I missed my "I used it nearly always" filter:
TELECIDE() (Decomb)

It´s often (very often) needed with working on captured anime
(in my case "Trickfilme" for younger kids), but also good on other sources sometimes.
Think about it and try it, if it works you can save the separate fields of course...


wOOt, I must admit I totaly changed my mind here - it looks so unbelievable good, damn how could I have missed this filter?!!

thanks vidiot :)

so, here is my 'new' beloved script to play around in the future


LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Decomb.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Convolution3D.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Cnr2.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\MSharpen.dll")
AVISource("D:\Capture\MJPEG19\source.avs")
crop(4,3,712,534)
TELECIDE()
Convolution3d(0,3,4,3,4,2.8,0)
Cnr2(-1,35,192,47,256,47,256)
MSharpen(25,100,true,false,false)
BicubicResize(512,384,0.5,0.75)


for the testclip I have to quote myself...

(Cable-TV):

[PicVideo]MJPEG @q19, Luma2, Chroma3 - and according to my ATI-Radeon-AIW a resolution of 720x540 (strange/ peculiar resolution, I know but I have to use it only while capturing with MJPEG otherwise all is screwed up - I don't know why?!)

but Decomb really knows how to slow down :rolleyes:

5-6 fps_first and 5-8 fps_second, and I thought my 1600XP with 256RAM is (still) powerfull :D

regards Sill

lark
21st January 2003, 07:53
hi,
could you please explain me,
why do you resize like that.

i know there are a lot of resize guides,
but i'd like to get your view ;-)

i realized that you cap @720x540 and 720x576,
because of codec limitations,
but why do you have different ar for the final video?
512x352 => ar ~13/9
512x384 => ar 4/3

for me the later seems OK, but there you cropped
a lot from the horizontal res (695x570).

i don't quite get this and would like to understand more.

just as a reference, i usually capture at 768x576 or 580x576,
crop a little bit to get rid of the black lines,
and in both cases resize to 576x432.
i'd like to get your opinion on my resolutions as well.

kind regards
t :)

^^-+I4004+-^^
21st January 2003, 08:47
>crop(4,3,712,534)


this is WEIRD resolution for any end-format....
that won't help any mpeg variant (wether it be
mpeg1,2 or 4...)

534 isn't even "8 compatile"....while you should aim for
16.....

trust me,weird resolutions destroy video more than anything else....

also,i recommend peach or grapesmoother,and then perhaps all of this

>LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Convolution3D.dll")
>LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Cnr2.dll")
>LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\MSharpen.dll")

is redundant.......

on the resolution:downsize as little as possible,or don't do it at all....(yes,you'll need 2cdr's for a movie ,but quality is awesome,really....)
hell if my cel600 can do 720x576 divx3,then........
(still didn't tried xvid on that high res,but will do....)

edit:oups,and yes,you cannot work with such wrong capture res. at start:
PAL is 576.....you must get that to have proper capturings.....

lark
21st January 2003, 09:02
sorry to say, but did you miss that crop is only intermediate.
he later resizes and encodes at 512x352 and 512x384 which are multiples of 16...

regards
t :)

vidiot
21st January 2003, 12:36
Originally posted by sillKotscha

LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Decomb.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Convolution3D.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\Cnr2.dll")
LoadPlugin("D:\Tools\[~]\Avisynth_2.0x\MSharpen.dll")
AVISource("D:\Capture\MJPEG19\source.avs")
crop(4,3,712,534)
TELECIDE()
Convolution3d(0,3,4,3,4,2.8,0)
Cnr2(-1,35,192,47,256,47,256)
MSharpen(25,100,true,false,false)
BicubicResize(512,384,0.5,0.75)


for the testclip I have to quote myself...


but Decomb really knows how to slow down :rolleyes:

5-6 fps_first and 5-8 fps_second, and I thought my 1600XP with 256RAM is (still) powerfull :D

regards Sill

Sillkotscha,
Telecide is absolutely fast - you should try the VD Version to determine what I say...:D (Thanks to Donald Graft).

- You should telecide before any cropping or resizing!
- Then CNR2 () (Yes you can tweak, depending on your source,
sometimes you can get rid of colour bandind).
- Or, sometimes even better - try Convolution 3D with different
settings - > You´ll be surprised (and leave CNR2 passiv in
this case, as this is could reduce "ghosting alarm")

Harald

BTW: I say YES to german water and SVCD
Thats why I capture in 480x576 with cropping of 16 pixel
each side...
I get 35 - 40 fps with telecide this way and 30 together with
C3D...

sillKotscha
21st January 2003, 12:53
Originally posted by sillKotscha

crop(4,3,712,534)

for my weird resolution it is as easy as it is...

- first I open my segmentedavisource in GKnot (720x540 = AR 4/3)
- choosing the resolution tab 1:1
- autocrop -> pixel and crop pixel as I like but keep focus to to aspect error - 0.0% and choose resolution as I like... (512x384 = AR 4/3) ;)

see here:

http://www.sahnau.de/skotscha/resolution.jpg

and a little example:
removed

regards Sill

wotef
21st January 2003, 13:44
O/T but your avatar scares me - wtf is it from ? :scared: Kinder Eggs or Stepford Wives? :D

sillKotscha
21st January 2003, 14:10
Originally posted by wotef
O/T but your avatar scares me - wtf is it from ? :scared: Kinder Eggs or Stepford Wives? :D

harhar :D

Kinder - Schokolade

http://www.kinderschokolade.de/ks_willkommen.htm

hakko504
21st January 2003, 14:38
Can I just remind everyone to always use even numbers in the crop calls when you are using YUY2 and YV12. Explanation can be found here. (http://www.avisynth.org/index.php?page=DataStorageInAviSynth)

sh0dan
21st January 2003, 14:48
Well - uneven numbers are ok for height in progressive YUY2 (which is what we're dealing with here).

Edit: :stupid: - sorry - I missed that you crop BEFORE you deinterlace.

sillKotscha
21st January 2003, 14:55
ok ok, ;)

according to Der_Karl (a [well know] german capture freak) and of course you, I totally changed my mind

have a look:

http://www.sahnau.de/skotscha/resolution.jpg

and of course fielddeinterlace() makes more sense then Telecide()

very good - I like all inputs

now my script looks like:


FieldDeinterlace()
crop(4,4,712,534)
Convolution3d(0,3,4,3,4,2.8,0)
Cnr2(-1,35,192,47,256,47,256)
MSharpen(25,100,true,false,false)
BicubicResize(512,384,0.5,0.75)


thanks

hakko504
21st January 2003, 15:14
@sh0dan

I usually recommends mod-2 for all crops as it is something that always works. It's easier to remember just one thing all the time.

vidiot
21st January 2003, 15:49
Originally posted by sillKotscha

and of course fielddeinterlace() makes more sense then Telecide()


...strongly depending on your source!
Capture "Benjamin Blümchen" for example and "simply"
restore the full frames with Telecide(post=false).
On some sources you have to have a Decimate(25) behind that...

And just because telecide() runs fielddeinterlace if neccessary:
You nearly can´t go wrong with it... :cool:

Harald

^^-+I4004+-^^
21st January 2003, 22:50
Originally posted by lark
sorry to say, but did you miss that crop is only intermediate.
he later resizes and encodes at 512x352 and 512x384 which are multiples of 16...

regards
t :)

oups!you caught me there!
i missed last line of script.....

but anyhow,his starting resolution is flat-wrong.....720x540?
what's that?you're missing 26 lines there,and god knows how ati does such vertical interpolations on 576 input etc.
(search for xesdeeni's recent posts on capturing forum)

don't tell me ati can't capture om 720(or 768)x576?
don't tell me that you capture at 720x540 because of AR???(it seems like you do...)cause that's a big LOL!
if you capture at 7xx x 576 you can resize afterwards to correct AR
if needed.....be aware of that!

i see (jpeg image) you have some weird interlacing (bigger "combing" than usual), your vertical resolution is the source of that....

>and of course fielddeinterlace() makes more sense then Telecide()

and smoothdeinterlacer makes even more sense!beat the crap out of fielddeint. on my last test with interlaced stuff.....
(huh i should of made some screenshots,cause graft will get all upset now...LOL!)

and remember:there's NO discussion of proper video(or processing/deinterlacing) on silly vertical resolutions.....all of this is in capturing forum,so why not take a look?

cheers

Ivo

edit:
>have a look:

http://www.sahnau.de/skotscha/resolution.jpg

same image twice?huh...
and i thought after der karl's suggestions you changed something?

sillKotscha
21st January 2003, 23:46
C'mon ivo I'd like to hear nice pro's & con's - no need to piss on me :devil:

and what I really like is that you would read what someone is writing or pointing to...

1.
Originally posted by ^^-+I4004+-^^
but anyhow,his starting resolution is flat-wrong.....720x540?
what's that?you're missing 26 lines there,and god knows how ati does such vertical interpolations on 576 input etc.

read my first post again, ATI is able to capture @720x576 - I know, and I always capture at that resolution - and again read my first post again - I capture at a resolution of 720x540 if I capture with MJPEG otherwise my picture is very weird, so again - read my first post for the 3rd time ;)

2.
Originally posted by ^^-+I4004+-^^
don't tell me ati can't capture om 720(or 768)x576?
don't tell me that you capture at 720x540 because of AR???(it seems like you do...)cause that's a big LOL!
if you capture at 7xx x 576 you can resize afterwards to correct AR

if needed.....be aware of that!

see 1. and a big LOL backwards for someone who isn't able to read ;)

3.
Originally posted by ^^-+I4004+-^^
i see (jpeg image) you have some weird interlacing (bigger "combing" than usual), your vertical resolution is the source of that....

I doubt that :p

4.
Originally posted by ^^-+I4004+-^^
and smoothdeinterlacer makes even more sense!beat the crap out of fielddeint. on my last test with interlaced stuff.....

uuh, wow first nice input - thanks I'll check that

5.
Originally posted by ^^-+I4004+-^^
and remember:there's NO discussion of proper video(or processing/deinterlacing) on silly vertical resolutions.....all of this is in capturing forum,so why not take a look?

wOOt, how could I have miss the capture forum, tststs - silly me. I always look first in here (http://forum.doom9.org/showthread.php?s=&threadid=32575) and maybe you would like to do the same and read the first lines... :cool:

Originally posted by ^^-+I4004+-^^
same image twice?huh...
and i thought after der karl's suggestions you changed something?


yupp, twice - just because I've uploaded the second screenshot but with the same name as the first - so it was overwritten ;)

and btw, Karl is a big helping hand and we're working on that

cheers Sill

^^-+I4004+-^^
22nd January 2003, 00:08
>read my first post again, ATI is able to capture @720x576 - I know, and I always capture at that resolution - and again read my first post again - I capture at a resolution of 720x540 if I capture with MJPEG otherwise my picture is very weird, so again - read my first post for the 3rd time

semms like a good thread for capturing forum:
"weird image on mjpeg xxx x 540"
(heh)
but seriously,you didn't said what kind of weirdness is it with
mjpeg,what mjpeg etc.
and indeed that stuff is for capturing forum (if you wan't to discuss
it...)...
it's weird that mjpeg gets ok ( i doubt anything gets 540 ok because the stuff i mentioned earlier ) that unstandard res. ,and is faulty with proper res.

>see 1. and a big LOL backwards for someone who isn't able to read

i was in a rush.....honestly!
LOL!

[screenshot]
>I doubt that

yes,it was not VD's <Ctrl+1>,was it.....hehe
i hurried to erase that part of my post,but you were faster....

>wOOt, how could I have miss the capture forum, tststs - silly me. I always look first in here and maybe you would like to do the same and read the first lines...

FAQ is for beginners!(heh)
us (illiterates ) don't need that FAQ's anyhow.....
(especially if we were correcting some parts of it...heh)




[yes,my mistake not to read more carefully.....]

btw. is this mjpeg issue being discussed on some german forums?
although i'm not very good in german ,i would appreciate some link
if you're currently discussing it.......

cheers_

sillKotscha
23rd January 2003, 11:29
it turns out that my capture card is scaling not cropping.

even at 540 the fieldorder is scaled, that means the interlace structur is kept (does anyone understand what I'm trying to say -oh jesus, my poor english ;) ). This is indeed a weird behaviour of a capture card/ an ATI card.

I made two testclips to let you believe the scaling effect:

- 720x540 [uncompressed] - 2.4MB (http://www.sahnau.de/skotscha/720x540.avi)
- 720x576 [uncompressed] - 2.7MB (http://www.sahnau.de/skotscha/720x576.avi)

these are only 10 frames but enough to see the effect. If you resize the 540 up to 576 than you will notice only 4 missing lines at the bottom.

This is a weird behaviour of my card because the original fieldorder is virtually destroyed. So, for correct PAR I have to stick to 704.

You see, no one can complain about the calculation because of the peculiarity of my individual capture device (except mod2 :) ).

By no mean I didn't found it out all by myself. Der_Karl was such a big helping hand and I have to thank him very much!!

If you're able to read german, you may wan't to read here:
- how everything turned out (http://forum.doom9.de/viewtopic.php?t=4821&start=15)

thank you,

Sill

P.S.: maybe it's time to move this thread in the capture corner?! :D

^^-+I4004+-^^
23rd January 2003, 23:05
> even at 540 the fieldorder is scaled, that means the interlace structur is kept (does anyone understand what I'm trying to say -oh jesus, my poor english ).

yes,i know what it means (am i clever or what?heh)
but it's VERY HARD to believe that interlacing is kept at 540 lines,
very hard.........
[ edit: ok,i was wrong here: it's not that hard to preserve interlacing if you simply throw away the lines....as bt8x8 and ati are doing on non 576 resolutions ]
BUT it's hard to preserve image quality on anything that's not 576 !

i think same results would be obtainable with "resize" (VD filter) and
interlaced ticked....i think that wouldn't look so smashing...

anyhow,i'll dload your samples (if this damned "kmeleon" can dload at all.heh) and try to see how good that ati vert. scaler is....

>P.S.: maybe it's time to move this thread in the capture corner?!

no,it's too late now!we have our standards!
LOL!

[update]:saw your samples.( you could just make jpeg's,as all is visible as well.....as it happens i'm on modem...huh )

nothing weird: xxx x 540 looks very lousy! 576 look normal.....

did my own test and got results same as you did.( so i wonder why der_karl was surprised(?)...also at the moment i can't access german forum (to read complete german thread),as site asks for login+password.....loks like your server collapsed... )
my screenshots here:
+++++++++++++++++++++++++++++++++++
{edit:time's up}
[that was done with bt8x8 on 720x576 & 720x540...
looks same as your stuff(!)...even same tv channel.hehe

all this suggests something we (on the capture forum..hehe) already know:anything other than 576 is wrong for PAL video signal.(real nasty ,let me add....this question occured when guy tried to capture PAL at 640x480...you're doing the same thing if you trying 540 on PAL....do everything you can to solve the issue : card drivers , different mjpeg version , check input color space selection (just incase) , etc. )
[ see the xesdeeni's explanation,i myself couldn't explain it better....i really couldn't...hehe
here
http://forum.doom9.org/showthread.php?s=&threadid=43198 ]

your card is just throwing away lines here and there....(if it did interpolation,video would look waay better...it doesn't!
it does it same way as bt8x8 )

i was asking of you to clear up why mjpeg doesn't work for you on 576 ( as THAT is weird! ).....but for that (eventual) discussion join us on capturing forum (if you have interest..after all it's your device that's making faulty mjpeg's,not mine.... this 540 stuff is horrible------> see how graphics on screen look half way drawn? it's because they are missing lines,and 540 is not (can't be) properly aligned to 576 source...).
( and PLEASE provide some screenshots of that faulty mjpeg,this 540 stuff isn't interesting anymore.......
mjpeg faults ARE!..... )

cheers

Ivo

Didée
25th January 2003, 21:13
sillKotscha,

could you explain what's going wrong with MJPEG @ 576? What kind of AIW are you running, what driver version, and what OS?

I can report capturing with an AIW 8500DV and (also PicVideo) MJPEG with no problems at all. xxx*576 works perfect for me. OS is XP, driver is latest "pre-catalyst" ("Plutonium" mod from RedSoft) ...

:confused: about your problem

Didée