View Full Version : Desperate AviSynth Help.
State of Mind
6th December 2004, 07:41
Hello to all.
I know you probably get newbies in all the time asking to help with AviSynth, but I just can't get the hang of it. I have a Panasonic DV-PV953 MiniDV Camcorder. My biggest curiosity is noise removal. But the thing is, I hate smoothing because I love maximum detail. I shoot in Interlaced Mode but have the Progressive option as well. I don't do this because I loaded a Progressive clip in VirtualDub once and there were strange lines on the edges of things in the image. If I was to get help from someone with AviSynth and was assured that Progressive resulted in better image quality considering it's DV level, then I would do it. I'm also interested in color correction. I mean, I'm sure with today's most common luminescent lights and such that colors can't be true. The last thing I am interested in is the whole quality/filesize thing. Depending on the material I shoot, I may intend for it to go on DVD, which in this case I wouldn't care about filesize and would give it such a high bitrate that it would look brilliant on TV. But, for other things that I record that I simply want stored on the HD, I am picky about HD space regardless if I had a 300 GB drive, I don't want friends and family downloading a clip from me that I could have been more mature with the settings and bitrate to make the clip better quality and smaller filesize. I actually have found this to happen in XviD's case. However, I usually like to use a bitrate no higher than 1500 kbps. With the last DV to XviD encode with that bitrate, default settings and a 2-pass, the quality was...not that good.
Anyway, if >anyone< is willing to help me out, please contact me at jeremy_of_many@hotmail.com. I am really desperate at this point. :(
Please help.
Jeremy
sh0dan
6th December 2004, 12:05
0) :search: AKA rule 1.
1) Post about what you are doing now and what you'd like to have better.
2) Post small samples/screenshots.
3) Don't ask people to email you - that way nobody else can learn from it. You can subscribe to the thread and get an email every time someone writes a message here.
4) Use a descriptive title AKA rule 9.
State of Mind
6th December 2004, 14:23
Well, I already described what I have done and what I am interested in improving. And like I said, I am having trouble getting the hang of AviSynth so I haven't actually encoded anything yet so no screenshots. I wanted to use a plugin to deinterlace my video but I didn't find what to type in for the plug in.
lark
6th December 2004, 15:25
Originally posted by State of Mind
I wanted to use a plugin to deinterlace my video but I didn't find what to type in for the plug in.
have you tried decomb? with which parameters? how did it look like?
regards
t :)
trolltuning
6th December 2004, 15:32
It sounds like most of the things you are interested in are fairly complex. I would suggest you encode a few short clips 100-500 frames and play around with Trim(),Crop(), and maybe some of the resize filters. Then you will have some screen shots and scripts to post for more help and you'll be more used to the syntax so you can understand the answers people give you.
Socio
6th December 2004, 16:15
You might want to check out this guide is has lots of good info:
AviSynth for the scripting impaired (http://www.afterdawn.com/guides/archive/avisynth_tutorial.cfm)
Mug Funky
6th December 2004, 16:56
btw, if you're getting edge jaggies with progressive mode, then definitely don't use it :)
also, only deinterlace if you absolutely need to. that is if either:
a) you're compressing for very low bitrates. 1500kbps probably would need deinterlacing, if the motion is pretty high.
b) your codec doesn't support interlace (and you must use that codec for whatever reason)
c) you're after a film-look (in which case, good luck as deinterlacing is only part of that:))
d) you really really want to
also, a search for "deinterlacer" would have probably turned up a fair bit. check in the development forum, there's an active thread announcing a particularly good deinterlacer (IMHO the best yet, at least not counting really slow stuff). it's called "Tdeint", and there's a spinoff IVTC package in the same thread.
there's plenty of denoisers too. the only limit is the speed of your computer.
if you're into preserving detail, then it's probably best not to over filter - a lot of people feel the need to use every noise filter they have, 1 after the other :)
try:
- removedirt/removegrain (these can be used together:)) by kassandro
- degrainmedian by fizick (good for fine grain - doesn't touch anything but noise, except when there's coloured flashes, but every temporal filter of this kind will have trouble with that...
- medianblur by tsp. a very new addition to this filter is a very nice spot killer called ml3dex, which can also work with motion compensation if you install Manao's MVtools
stuff you just have to have if you want fun with avisynth:
- masktools (and maybe mvtools) by Manao. so useful, not having it is like leaving your head at home and then really needing it later.
- kerneldeint by Neuron2 (get the optimised and bugfixed one by Leak - it's way faster)
- decomb, also by Neuron2. mainly for IVTC, but has useful general filters.
- DGdecode by... Neuron2 :). even if you're working with DV, the blindPP filter is a handy little deblocker. i've seen blocks in DV before, so this could help.
the avisynth docs (in the installer) are extremely comprehensive and very useful, as well. i have a memory like a seive, so i still spend loads of time reading the docs, after over a year.
oh yeah, and search is useful too :)
CraigBjorn
7th December 2004, 00:32
Here's a fairly good post on color correction. (http://forum.doom9.org/showthread.php?s=&threadid=85617) And alot of people around here I'm sure would be willing to help, as long as you can give us some specifics, like what types of videos are they? They're obviously home movies of some sort, but under what conditions... that definitely comes into play when correcting images.
State of Mind
7th December 2004, 02:11
Ok, I have KernalDeint but how do I put it into the text file? I just want to see how well it deinterlaces before trying anything else.
PhrostByte
7th December 2004, 02:20
If you have time (lots), PixieDust is the best filter I've seen for noise removal.
Mug Funky
7th December 2004, 05:30
if it's in your autoloading plugins directory (i'm lazy, so mine all are unless they cause weird crashes), then do this:
avisource("c:\myDVavi_o_lordy_lord.avi")
kerneldeint(order=0)
that's the simplest operation. the order argument sets the "dominant" field - the one that's kept in the output. the other field is either passed through if it's similar enough to the dominant field, or it's kernel interpolated.
the help files have all this in them, but you'll have to get the hang of how avs works to be able to make good use of the help files, i think. it's reeeal easy when you get the hang of it.
State of Mind
7th December 2004, 06:47
I applied the script but it gave me an error message: "KernalDeint requires RGB32, YUV2 or YV12 data, line 2."
What gives? What am I missing?
stickboy
7th December 2004, 06:55
Well, there's only one AviSynth-supported colorspace left: RGB24.
Either open your file in VirtualDub and look at File > File Information or use an AviSynth script:
AVISource("whatever.avi")
Info()Try:
AVISource("whatever.avi", pixel_type="yuy2")
kerneldeint(order=0)
State of Mind
7th December 2004, 07:24
Ah, I cannot use this Deinterlacer because my DV is RGB24 and KernalDeint requires of the other three. What other good deinterlacers are there? Also, I could not find PixieDust noise filter.
tedkunich
7th December 2004, 07:33
Originally posted by State of Mind
Ah, I cannot use this Deinterlacer because my DV is RGB24 and KernalDeint requires of the other three. What other good deinterlacers are there? Also, I could not find PixieDust noise filter.
just add this before the call to the deinterlacer:
converttoyv12(interlaced=true)
Pixiedust is part of the Dust package released by Steady -it can be found on the WarpEnterprises site (it is a sticky in the first few posts in this forum) Good filter, but slow as hell.
T
State of Mind
7th December 2004, 17:06
I did so, but MPC and VirtualDub complain that no decompressors for YV12 can be found.What do I need?
I know this is like ant crawls, one step at a time...but I'm learning. Thanks for your help so far.
Boulder
7th December 2004, 17:12
Install Koepi's latest XviD build:
http://www.koepi.org
Alternatively you can download and install DivX5 or the Helix YV12 codec.
State of Mind
7th December 2004, 17:21
I have FFDShow, can this be configured to compensate?
tedkunich
7th December 2004, 17:22
Originally posted by State of Mind
I did so, but MPC and VirtualDub complain that no decompressors for YV12 can be found.What do I need?
I know this is like ant crawls, one step at a time...but I'm learning. Thanks for your help so far.
Did you try converttoyuy2(interlaced=true)? If your system does not have yv12 or yuy2 codecs installed, then you can always revert to the following:
Convertoyuy2(interlaced=true) <<conversion for the filters
kerneldeint(order= _ ) <<put your field order here, 0 for DV sources
>>other filters here<<
ConverttoRGB24(interlaced=false) <<conversion for output to encoder
Not the best way of going about it, but it should get you some results. The trick is to minimize the number of colorspace conversions you have to go through along the way as you lose a little information every time you do.
Good luck,
T
Boulder
7th December 2004, 17:50
Originally posted by State of Mind
I have FFDShow, can this be configured to compensate?
I don't think ffdshow can help you. You'll fix things easily by installing Koepi's XviD codec.
State of Mind
7th December 2004, 18:17
Ok, I have it installed. I am not a newbie when it comes to installing things. ;)
Well, now I have a deinterlaced clip in VirtualDub. That's cool. The noise is really bugging me. I need to clean the head of my camcorder, too.
So, PixieDust filter is good, eh? Will try and get that. Can someone tell me what to type for that? Would it be "PixieDust(<number to specify threshold or whatever>)"? Am I getting the hang of this bit by bit?
Oh, tedkunich, just saw your post above. No, as you can see, I installed XviD, which obviously allowed YV12 to work. And I agree on the colorspaces...I like to preserve those as best as I can...so any other help on that maybe? I'll try your method and see what it looks like. Thanks.
Edit - I get an error about Line 5 regarding needing one of the forms of data, even with XviD installed. I think it's easiest and better to stick with what Boulder said. Anything else?
Boulder
7th December 2004, 18:39
What's your script? The Dust family is very slow and requires some fiddling to get it working with Avisynth 2.5, also requires YUY2 or RGB colorspace. I recommend trying RemoveGrain() followed by RemoveDirt(), it will give you similar results without any colorspace conversions (works in YV12 and YUY2).
State of Mind
7th December 2004, 20:58
Boulder, I used the RemoveDirt filter and my video looks quite a bit better. Much less noise and the sharpness does not appear to be affected. There still is some noise and I was not able to locate the RemoveGrain filter on the Filter Collection site, however. Can you be so kind as to provide me with a link? Also, what's all the hype about this "TDeint" filter? From the little bit I read on it, it seems it is for the advanced users. Am I correct? Motion deinterlacer...does it make scenes with fast motion look better in some way?
My script so far is this:
AviSource("C:\Documents and Settings\Owner\My Documents\Clip.avi", pixel_type="RGB24")
Converttoyv12(interlaced=true)
kerneldeint(order=0)
RemoveDirt()
Boulder
7th December 2004, 22:07
http://www.removegrain.de.tf if I remember correctly.
TDeint is an advanced deinterlacer, download it and see the docs. I would try TDeint(order=0,type=2) instead of KernelDeint.
State of Mind
7th December 2004, 22:52
I just noticed the quality of the image during a moment of motion. Here's the screenshot http://img92.exs.cx/img92/6082/motionframe9rw.jpg (Original DV quality). Are there any filters to clear this up? What encoding tools do you AviSynthers use? I use TMPGEnc.
Mug Funky
8th December 2004, 07:42
there's only a few ways to denoise motion:
a) spatial smoothing, basically a thresholded blur
b) motion-compensation and then temporal smoothing
c) some kind of mixture of the above
the fastest way of handling motion is using temporal in low motion and spatial in high motion (peachsmoother does this with some success).
the most accurate (but potentially buggy) way to handle it is motion-compensation, falling back on spatial for bits that can't be compensated. pixiedust does this, and functions involving MVtools do as well.
btw, Tdeint will probably handle that particular high-motion bit with less jaggyness, but unfortunately overexposed areas (the highlights in that pic) tend to look bad with any kind of deinterlace.
State of Mind
8th December 2004, 15:05
I don't really like to smooth things, but do these motion temporal and spacial smoothers only smooth areas where there is some motion, so it gets sharp again once the image is still?
kingmob
9th December 2004, 13:33
The temporal smoother basicly checks the frame before and after your current to see if a pixel is noise. Where the different temporal denoisers differ is the way they remove the noise and how they compensate for motion, which has to be done to make any kind of noise detection possible.
High motion areas are hard to detect so spatial smoothing is applied. As Mug Funky said, this is done by a threshold value, which means that any pixel which 'sticks out' too much is detected as noise. Obviously sharp edges will have a tendency to get blurred. The thought is that you will not notice this in a motion scene (and i definately agree with that thought).
The good denoisers automaticly apply the best option for the current scene. My personal favourite is removegrain().Removedirt(). You can tweak all these beformentioned settings, yet the default is already excellent.
The big plus is that noise removal will allow you to use a lower bitrate during encoding to achieve te same quality and that while the image has improved :).
State of Mind
9th December 2004, 15:33
Ah, thank you kindly for the wonderful reply with good technical details which were what I was hoping to get from someone. Sounds good to me. And after the second vote for RemoveGrain() and RemoveDirt(), I think I'll stick with them since I already have them and they are very easy to put to use. :)
RemoveGrain()
RemoveDirt()
Just like that, right?
State of Mind
10th December 2004, 08:01
Also, can someone provide me with the most commonly used filter for simple color correction and the commands for it/them? Thanks in hopeful advance.
Wilbert
10th December 2004, 17:53
Have a look at the analog capture guide.
State of Mind
12th December 2004, 02:05
But I don't have an analog camera. And if its only a capture guide, what relevance is that to color enhancements?
Wilbert
12th December 2004, 02:09
It shows you what tools you can use for color correction (vdub, but also AviSynth). Ok, you don't have an analog source, but maybe you can learn something from it.
State of Mind
18th December 2004, 02:46
I have an issue with the plugins I'm using. I have take before and after screenshots and notice that after I use the following plugins/settings, I get too much brightness and less detail AT DV quality level. Mind you, I have taken the apparent default settings given to me by members of different forums who aren't dedicated to DV...so any additional help from the pros here at AviSynth would be greatly appreciated. I gave up on this stuff once, but was encouraged to get back at it.here is the code.
AVISource ("C:\Documents and Settings\Owner\My Documents\Clip.avi", pixel_type="RGB24")
Converttoyv12(interlaced=true)
TDeint(order=0,type=2)
RemoveGrain()
RemoveDirt()
Tweak(0,0.85,10.0,1.0)
All, I am interested in is the Deinterlacing, Denoising, Color Correction and Detail. I will encode with XviD.
Before and After Shots:
http://img95.exs.cx/img95/3143/screenshots7jr.jpg
State of Mind
18th December 2004, 08:39
Ok, I don't like the Tweak filter...not what I was looking for. I can adjust the color in VirtualDub just fine. I have removed most of the noise, an further and I will lose further detail. Also, since that is a dim lighted scene, it wouldn't really make a difference if I used a smaller bitrate than usual. I am using one of the best Deinterlacers and have only converted the color spaces once. For this DV, is there really anything else I can do to enhance the quality?
Boulder
18th December 2004, 09:50
If you do the color correction in VDub, it means two more colorspace conversions. RGB24->YV12->RGB->YV12.
kingmob
18th December 2004, 17:05
Originally posted by State of Mind
Ok, I don't like the Tweak filter...not what I was looking for. I can adjust the color in VirtualDub just fine. I have removed most of the noise, an further and I will lose further detail. Also, since that is a dim lighted scene, it wouldn't really make a difference if I used a smaller bitrate than usual. I am using one of the best Deinterlacers and have only converted the color spaces once. For this DV, is there really anything else I can do to enhance the quality?
As said above me, using vdubmod and avisynth filters both, without working in RGB in avisynth is a pretty big nono. Try getting the right numbers in vdubmod and then input them into an avisynth filter.
It seems a hassle at first, but it'll preserve quality and speed up your encode.
State of Mind
18th December 2004, 19:41
Well, if I don't use thr Tweak plugin, I don't get excessive brightness and I don't lose color. What's the difference between VDub and VDubMod?
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.