Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th May 2010, 17:56   #1  |  Link
bartel75
Used Registerer
 
Join Date: Mar 2009
Location: Brussels
Posts: 15
Looking for an "all-purpose" avisynth script

I've been converting DVD videos for a couple of years now, and I've used lots of different combinations of resize, deinterlace, denoise, etc. filters.

Because I don't want to spend (a lot of) time finetuning the avs script for each individual conversion, I tried creating some "standard" settings.

This is what I currently use (relevant lines only):
Code:
Mpeg2Source("H:\mymovie.d2v")
TomsMoComp(-1,5,1)
GaussResize(712,528,8,0,-0,-0,p=60)
ColorMatrix(d2v="H:\mymovie.d2v")
hqdn3d(2)
TTempSmooth()
Is there any way I can improve this script? Might some filters be outdated, and/or have better alternatives? Or maybe there is something wrong with how these filters will interact?

Some (possible important) remarks:
- I always encode to x264, mostly using crf 22, or sometimes crf 20
- quality is important, but also: decent conversion speed, and relatively small file size (say, about 1200 kbps)
- TomsMoComp: when working with video that is clearly not interlaced, I skip this step, of course
- GaussResize: evidently, the values are variable, depending on the source. Please note that I don't resize; I just use this for cropping...
- ColorMatrix: not sure if I really need this, but I suppose it's fast, and it doesn't hurt

So, my question: any chance I could improve this "standardized" script?

Thanks a lot for your help!

(BTW, I haven't found any threads related to standard avs settings, but if I'm mistaken, my apologies, and thanks for pointing me in the right direction)

Last edited by bartel75; 19th May 2010 at 18:06. Reason: Additional info
bartel75 is offline   Reply With Quote
Old 19th May 2010, 18:07   #2  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
I know of exactly ONE script does fit all possible cases.

Code:
Return( last )
Anything more than that, and it won't be all-purpose.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 19th May 2010, 18:21   #3  |  Link
bartel75
Used Registerer
 
Join Date: Mar 2009
Location: Brussels
Posts: 15
Quote:
Originally Posted by Didée View Post
I know of exactly ONE script does fit all possible cases.

Code:
Return( last )
Anything more than that, and it won't be all-purpose.
Okay then, make that "almost-standard" then...

What I meant: I don't want to fiddle with the settings each time I encode a new video. Of course, if I see a video that is (for example) extremely grainy, I would adjust the settings accordingly.

But most videos (up to now) were regular PAL DVDs (movies), with the occasional exception of some old B&W footage from the 50s or 60s.

One specific example: I ALWAYS use TTempSmooth(), but maybe you guys think there's a filter that does the same, does it faster, or gives better quality without a severe time penalty?
bartel75 is offline   Reply With Quote
Old 19th May 2010, 18:37   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Nobody here is going to support a quest for a "standardized script" ignoring the specifics of the source material.

If you are asking for suggestions for your posted script, then you will need to provide a sample of the source material it is to be used with.
Guest is offline   Reply With Quote
Old 19th May 2010, 19:29   #5  |  Link
bartel75
Used Registerer
 
Join Date: Mar 2009
Location: Brussels
Posts: 15
Quote:
Originally Posted by neuron2 View Post
Nobody here is going to support a quest for a "standardized script" ignoring the specifics of the source material.
Maybe my wording was a bit off. (I kept the title of my post simple in the hope of getting some simple (read: "staightforward") replies.) Naturally, I would modify most of the script options to suit my needs. Especially with hqdn3d, I change the denoise level depending on the source and the compression rate I want to achieve.

Perhaps I could ask some questions that can be answered in a general sense.
  • For example: I suppose that, for just about any type of video, temporal smoothing is a good idea. Could you tell me if I might be mistaken, and there might be some specific case I overlooked, where TS is not the right thing to do?
  • The same goes for ColorMatrix. It's my idea that you should always use it. Am I correct?
  • One last example: suppose I always used PixieDust, and I talked about wanting fast conversion. Then someone could point out to me that this filter is quite cpu-intensive, and that there are faster alternatives.

I hope I'm getting my message across a little better this time...

BTW: the reason I'm not talking about the "specifics of the source material" is the following: I am trying to find a way to convert videos without having to come to the forum each time I'm doing a new encode. You guys probably have better things to do, and I want to find a way to work things out myself. But I'm getting a little overwhelmed reading about (for example) all 20 deinterlace filters mentioned on avisynth.org, let alone testing them one by one, repeating the proces for each new encode I'm starting.

Could anyone at least have their say about my two specific questions above (TS / colormatrix) ?

Thanks in advance!
bartel75 is offline   Reply With Quote
Old 19th May 2010, 21:02   #6  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 418
The man comes to Doom9 for "staightforward" answers. You have come to the wrong place. Now first of all, all commercial movies are either shot on film which is always progressive or captured progressively with a digital camera. TomsMoComp is meant for natively interlace material - not progressive material which as been interlaced in post-process. So TFM from the TIVTV package would go a long way. And then AssumeFPS("ntsc_film") to change the fps to its original state but only when you plan on trancoding the audio into another format. Why would you use GaussResize for cropping, there is a function called Crop for that, you know. What's with all the denoising?

Last edited by Gser; 19th May 2010 at 21:06.
Gser is offline   Reply With Quote
Old 19th May 2010, 21:07   #7  |  Link
BigDid
Actually in reserve
 
Join Date: Oct 2004
Posts: 1,605
Quote:
Originally Posted by bartel75 View Post
...
Perhaps I could ask some questions that can be answered in a general sense.
...
Hi,

Problem is, avisynth is complex (and needs scripting)!

Either you do not want to script and try to use a GUI which wraps these filters in something you can manage, either you want full control and have to script.

What I mean by script is wrapping one filter after another and entering manually parameters to tune the filter/function to the desired effect; many filters, many parameters.

So as Didée as pointed out: "Anything more than that, and it won't be all-purpose".

At this point I can only point you to a very useful (IMO) thread that will give you what usual filters are used by some (estimated) members of this forum. Up to you to read/compare test these ressources. But, it will not give you a all-in-one / all-purpose solution!

It is called what are your current go-to filters:
http://forum.doom9.org/showthread.php?t=149919

Did
__________________
Having a problem with AutoGK? Read & use the FAQ & MORE FAQ first
Want to exchange on AutoGK? try doom10.org
In reserve (inactive) for an undefined period of time.
BigDid is offline   Reply With Quote
Old 19th May 2010, 21:09   #8  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,576
Quote:
Originally Posted by Gser View Post
TFM from the TIVTV package would go a long way. And then AssumeFPS("ntsc_film") to change the fps to its original state but only when you plan on trancoding the audio into another format.
Emmm... what? After TIVTC, decimation should be applied, and it has nothing to do with audio.
Keiyakusha is offline   Reply With Quote
Old 19th May 2010, 21:27   #9  |  Link
bartel75
Used Registerer
 
Join Date: Mar 2009
Location: Brussels
Posts: 15
Quote:
Originally Posted by Gser View Post
Why would you use GaussResize for cropping, there is a function called Crop for that, you know. What's with all the denoising?
GaussResize: I guess it comes from the time I used HDConvertToX. It's (AFAIK) the default crop/resize filter there, even when you don't actually resize. And when I went to manually inspecting the avs scripts this tool generated, I just left it there. Crop is of course the simpler solution in my case (as I rarely or never resize).

Denoise: good point. I should probably get my foot off the gas pedal there!

Thanks for your input...
bartel75 is offline   Reply With Quote
Old 19th May 2010, 21:34   #10  |  Link
bartel75
Used Registerer
 
Join Date: Mar 2009
Location: Brussels
Posts: 15
Quote:
Originally Posted by BigDid View Post
Either you do not want to script and try to use a GUI which wraps these filters in something you can manage, either you want full control and have to script.
As I just said in my previous post, I come from HDConvertToX. But I'd rather know what I'm doing, so (for example) instead of setting the de-noise filter option to "super light", I prefer to see which function is actually called, and with what parameters. Let's say I want to have 'some' control.

Quote:
Originally Posted by BigDid View Post
So as Didée as pointed out: "Anything more than that, and it won't be all-purpose".
Ok ok, it won't be all-purpose, then...

Thanks for the link!
bartel75 is offline   Reply With Quote
Old 19th May 2010, 22:38   #11  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by bartel75 View Post
For example: I suppose that, for just about any type of video, temporal smoothing is a good idea.
Wrong. Why would you think that?

Quote:
The same goes for ColorMatrix. It's my idea that you should always use it.
Wrong. Why would you think that?

Quote:
One last example: suppose I always used PixieDust, and I talked about wanting fast conversion. Then someone could point out to me that this filter is quite cpu-intensive, and that there are faster alternatives.
There are ample threads about denoising here. But again, there are many types and degrees of noise and thus no standard prescription. And do you necessarily always want to remove film grain, for example?

Quote:
I hope I'm getting my message across a little better this time...
I'm afraid not.

Quote:
I am trying to find a way to convert videos without having to come to the forum each time I'm doing a new encode.
Then increase your knowledge base so that you can draw on it as needed rather than asking for spoonfeeding in every case.
Guest is offline   Reply With Quote
Old 19th May 2010, 23:51   #12  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,989
What neuron2 says here is key:

Quote:
Then increase your knowledge base so that you can draw on it as needed rather than asking for spoonfeeding in every case.
Use "no filters" as your default You'll learn when sources will need denoising when you're targeting a specific filesize for example, and you should spot interlacing issues when running DGIndex etc...

~MiSfit
__________________
These are all my personal statements, not those of my employer :)
Blue_MiSfit is offline   Reply With Quote
Old 20th May 2010, 08:48   #13  |  Link
bartel75
Used Registerer
 
Join Date: Mar 2009
Location: Brussels
Posts: 15
Quote:
Originally Posted by neuron2 View Post
Wrong. Why would you think that?
(temporal smoothing) My reasoning, based on the info found on the net: TS greatly helps compressibility, without introducing any (obvious) artifacts to the final video. To my eyes, at least... Please do correct me if there's something I forgot to take into account...

Quote:
Originally Posted by neuron2 View Post
Wrong. Why would you think that?
(ColorMatrix) From the filter description on avisynth.org: "ColorMatrix corrects the colors of MPEG-2 streams of dvds." As I'm working with exactly these streams all the time, it sounds like a no-brainer to me. What I couldn't find on the net though: maybe 80% of mpeg streams are already perfectly fine, and this filter has no obvious advantage?

Quote:
Originally Posted by neuron2 View Post
There are ample threads about denoising here.
I agree that denoising questions cannot be answered in a simple way. Luckily for me, I can do some tests, and just compare the different results myself...

Quote:
Originally Posted by Blue_MiSfit View Post
Use "no filters" as your default
Blue_MiSfit, I'll follow that advice.

I'm just left with the two filters (ts & colormatrix) that seem to be 'universal'. So my remaining 'specific' question:

Why not use ts & ColorMatrix all the time? What would be a situation where it's not recommended? ColorMatrix ensures that my colors are never off, and ts ensures better compressibility, without any major disadvantages. Right? (I guess you guys will say 'wrong', but I'm curious about the specifics )

For the record, my main sources: this forum, and the avisynth website. Maybe there's an important source of info out there that I don't know about?
bartel75 is offline   Reply With Quote
Old 20th May 2010, 09:39   #14  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,361
hello bartel75. As you see Im newer than you, but I might have spent more time reading these pages and others as well, so I throw ya some tips

Colormatrix must be used only if your source colors have the wrong type. You check by mpeg2decode (info=1) I think. Note SD is 601, HD is 709. If you use hints=true then it will automatically read if a conversion is needed and fix it accordingly, but as you see, there are exceptions where there is no tag to read from, and you must eye-check yourself. But normally is right.

what is ts? temporal smoothing? Id only use a strong temporal if its temporal stable source (no shaking, not heavy action,no grain(?)), if not a low temporal should be enough.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 20th May 2010, 14:17   #15  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 418
Quote:
Originally Posted by Keiyakusha View Post
Emmm... what? After TIVTC, decimation should be applied, and it has nothing to do with audio.
DECIMATION SHOULD NOT BE APPLIED TO A PAL SOURCE!! TFM is a frame matching filter - it leaves the frame count. Tdecimate removes the duplicates. In most cases anyways - I haven't encountered a single case in which it was needed. Especially since we're dealing with film sources which tend to be sped up to 25fps rather than use dummy frames.

PS. UnDot is a good filter for reducing the file size without loosing a lot of visual appeal. (Much better alternative than all that denoising anyways.)

Last edited by Gser; 20th May 2010 at 17:10.
Gser is offline   Reply With Quote
Old 21st May 2010, 08:16   #16  |  Link
7ekno
Guest
 
Posts: n/a
Quote:
Originally Posted by Gser View Post
PS. UnDot is a good filter for reducing the file size without loosing a lot of visual appeal.
Doesn't RemoveGrain(mode=1) give identical results to Undot(), but execute faster due to SSE optimizations and better MT compatibility?!?

7
  Reply With Quote
Old 21st May 2010, 15:04   #17  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 418
Quote:
Originally Posted by 7ekno View Post
Doesn't RemoveGrain(mode=1) give identical results to Undot(), but execute faster due to SSE optimizations and better MT compatibility?!?

7
I don't know and care tbh. Undot works at least at realtime for me on HD material. And I never use it.
Gser is offline   Reply With Quote
Old 21st May 2010, 18:25   #18  |  Link
txporter
Registered User
 
Join Date: Nov 2009
Posts: 110
Quote:
Originally Posted by 7ekno View Post
Doesn't RemoveGrain(mode=1) give identical results to Undot(), but execute faster due to SSE optimizations and better MT compatibility?!?

7
Yes, that is what I have read. I use RemoveGrain(1) rather than Undot() because it is faster.
txporter is offline   Reply With Quote
Old 21st May 2010, 18:26   #19  |  Link
BigDid
Actually in reserve
 
Join Date: Oct 2004
Posts: 1,605
Hi,
Quote:
Originally Posted by Gser View Post
I don't know and care tbh...
Up to you to build or not your credibility.
Quote:
Originally Posted by 7ekno View Post
Doesn't RemoveGrain(mode=1) give identical results to Undot(), but execute faster due to SSE optimizations and better MT compatibility?!?
Yes it gives identical results, yes it should be faster but you usually won't notice (both realtime).

While we are on the subject :
* use of remove grain() (spatial) from weaker to stronger:
mode1 => mode2 ...
* use of degrainmedian() spatio/temp, weaker to stronger:
mode5 => mode4 => and so forth..

I prefer dgm/mode5 to removegrain for hot pixels, kind of all purpose; my opinion only

Did
__________________
Having a problem with AutoGK? Read & use the FAQ & MORE FAQ first
Want to exchange on AutoGK? try doom10.org
In reserve (inactive) for an undefined period of time.
BigDid is offline   Reply With Quote
Old 21st May 2010, 20:14   #20  |  Link
bartel75
Used Registerer
 
Join Date: Mar 2009
Location: Brussels
Posts: 15
Quote:
Originally Posted by txporter View Post
Yes, that is what I have read. I use RemoveGrain(1) rather than Undot() because it is faster.
That might be a candidate for my "all-purpose" avs script!
I always had trouble with Undot's extensive list of exotic parameters!

On a serious note: degrainmedian sounds like a good idea, too. I'll run some tests...
bartel75 is offline   Reply With Quote
Reply

Tags
avisynth, filters

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:59.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.