digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Optimal MA script for Black & White movies ? (http://www.digitalfaq.com/archives/avisynth/6464-avisynth-optimal-ma.html)

Surfinette 11-02-2003 07:01 AM

Avisynth: Optimal MA script for Black & White movies ?
 
High Kwag and team,
Hello from a happy newbie :D . First, thank you all for the fantastic job you've done with kvcd, especially for optimising the AVS script and making the whole process fairly easy for newbies such as me.

I would like to know if there is a way to optimize the MA Script for B&W movies, which are usually (much) less compressible than color movies?
For instance, I am currently trying to make a 1-CD kvcd from the French movie 'Les tontons flingueurs' which is 96 min long and I can't get CQ above 58 (which seems rather low).

Any suggestion to optimize the script for truly B&W movies?

Surfinette

Dialhot 11-02-2003 07:58 AM

Can we see your original script ?

Encoder Master 11-02-2003 08:01 AM

If it's a black White movie you can use Dee() in your script and the quality at cq57 is much better.
Or you have to change the resolution .
Perhaps 480x576
or 352x576

Or the Max bittrate from 2500kbps to 2200 or 2000. An dyou have better CQ level.

Surfinette 11-02-2003 11:40 AM

Thank you for your answers
For your info, I use DVD2SVCD to generate my K(S)VCD
Below is a copy of my script.
The only change I made from the original script is that I do not use GripCrop and GripSize (because I have not figure out how this scrip works!) but I do not think it makes any difference

Surfinette


LoadPlugin("D:\Video\Outils Video\DVD2SVCD\\Avisynth2.5 Plugins\Mpeg2dec\MPEG2Dec3.dll")
## DLL Section ##
#
LoadPlugin("D:\Video\Outils Video\AviSynth 2.5\plugins\STMedianFilter\STMedianFilter.dll")
LoadPlugin("D:\Video\Outils Video\AviSynth 2.5\plugins\Asharp\asharp.dll")
LoadPlugin("D:\Video\Outils Video\AviSynth 2.5\plugins\UnFilter\unfilter.dll")
LoadPlugin("D:\Video\Outils Video\AviSynth 2.5\plugins\UnDot\undot.dll")
#
####

## Defined Variables and Constants ##
#
MaxTreshold = 1.50
nf = 0 # Current frame.
#
####

## Main section and static filters ###
#
mpeg2source("D:\Video\DVD2SVCD_Movie\DVD2AV~1.D2V" )
#
undot()
Limiter()
asharp(1, 4)
BicubicResize(448,384,0,0.6,25,0,672,576)
STMedianFilter(3, 3, 1, 1 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.1))
#
#

## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:

SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")

#
#
#

AddBorders(40,96,40,96)
Limiter()

#
#
## Functions ###

function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2
}

#
####

incredible 11-02-2003 11:58 AM

Try this one .... (No "LoadPlugIn ..." 's are needed!)

Code:

nf =  0
ml =  2 #### Multiplicator / MA Motionsoften, Default = 2
mpeg2source("D:\Video\DVD2SVCD_Movie\DVD2AV~1.D2V")
BlindPP(CPU=4)
ATC()
undot()
Limiter()
BicubicResize(448,384,0,0.6,25,0,672,576)
MergeChroma(blur(1.50))
MergeLuma(blur(0.1))
#
## Linear Motion Adaptive Filtering ##
#
SwitchThreshold = 3 ## at 480 width
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
unfilter( -(fmin(round(nf)*ml, 200)), -(fmin(round(nf)*ml, 200)) ) : \
TemporalCleaner(round(4+nf), round(8+nf)) ")
#
######################################
#
Undot()
Blockbuster(method="noise",detail_min=1,detail_max=3,variance=0.1,seed=1)
AddBorders(16,96,16,96)
Limiter()
DCTFilter(1,1,1,1,1,1,0.5,0)
#
######################################

## Functions ###
function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}
#
######################################

When filtering classic movies I wouldn't apply an Asharp as it is set in your Script. Cause CalssicMovies aren't that detailed and on the other hand you would enhance noise!


BTW: In your Script it seems the Addborders/width settings where set wrong?? Are you shure with your width calculations? Even the width is cropped the resized result is 448 and ...
448+16+16 = 480 .... and I assume thats what you want to encode with!

;-)

Dialhot 11-02-2003 03:04 PM

In fact he uses very stange values :
Code:

AddBorders(40,96,40,96)
40 pixels for left and right margin !!! Where did you find these values ?

Note : if you want to use DVD2SVCD with gripcrop, go to the DVD2SVCD section of the forum. I put all the optimale scripts adapted to DVD2SVCD in a sticky post (updated today).

Surfinette 11-02-2003 05:17 PM

Thank you all for your help

The margins I've been using were calculated from FitCD. Note that the original size of the movie is 672x720, ie pretty wide left and right margins in the first place (24 pixels each).

For Encoder Master: Where in the script would you positioned Dee(), or instead of which filter?

For incredible: What are BlindPP(CPU=4) and ATC() used for? Are these included in Avisynth 2.5? (sorry for those typical Newbies questions :oops: )

Surfinette

Dialhot 11-02-2003 07:19 PM

1/ your source size is weird !

2/ the black borders included in the source shouldbe removed before making any filter on the picture. That's the purpose of the "Gripcrop" filter. Again I suggest you to go to the DVD2SVCD section of the forum to give a glance to the optimal script adapted for DVD2SVCD (and perhaps making your own starting from them).

3/ it is not "dee" but deen but I suggest you to drop this filter : it is too heavy on many sources.

4/ ATC and BlindPP (actually included in Mpeg2Dec3) are filters for avisynth 2.5. You must DL them at :

http://www.avisynth.org/~warpenterprises/

incredible 11-02-2003 07:32 PM

Quote:

Originally Posted by Surfinette
Thank you all for your help

The margins I've been using were calculated from FitCD. Note that the original size of the movie is 672x720, ie pretty wide left and right margins in the first place (24 pixels each).

Well however, ... 40 pixels for left and right margin are too much!
Cause they are bigger than the overscan of your Tv! So you'll see them!

Quote:

Where in the script would you positioned Dee(), or instead of which filter?
Well in the case of your script, says the MA original, you should replace the STmedian.. Line by Deen("a2d",2,12,15) , ... set to spatial settings like this .

BUT!: As I encoded also many Classic Movies my recommendation is to use the ATC()! It cleans more the heavier Grain of old movies , although its said to use a "spatial" filter only in front of the MA routine, cause ATC is doing his job "temporal", but however it serves very well ... ;-)
If you want to use Deen("a2d",2,12,15) instead of ATC() try it and change it in my script.
Quote:

For incredible: What are BlindPP(CPU=4) and ATC() used for?
BlindPP is used for preprocessing/deblocking a block aligned (8x8) DCT Source image like your mpeg source.
ATC() is IMHO another very well temporal cleaner.
Quote:

Are these included in Avisynth 2.5?
No! BlindPP() is included in the mpeg2dec3.dll plugin it has to be downloaded at Warpenterprises:
http://www.avisynth.org/~warpenterpr...l_20030728.zip
Also ATC():
http://www.avisynth.org/~warpenterpr...l_20030118.zip
And Deen():
http://www.avisynth.org/~warpenterpr...l_20030119.zip
Quote:

(sorry for those typical Newbies questions :oops: )
No problem, that's why we are here ;-)
There's nobody who did not start as a newbie.

EDIT: Now recognised after submitting .. Dialhot ... answering faster and brings it better to the point ;-)


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