digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Trouble with MA-Script in PAL? (http://www.digitalfaq.com/archives/avisynth/4574-avisynth-trouble-ma.html)

Avalon 07-17-2003 06:15 PM

Code:

######
###        AVISYNTH-Script (für Version 2.5.2) von Avalon
###                DCD 4.0
###        ScriptVersion 180703/0056/Normal
######
##
## DLL Sektion ##
#
LoadPlugin("C:\Filters25\mpeg2dec3_25_dll_20030119\MPEG2Dec3.dll")
LoadPlugin("C:\Filters25\GripFit_YV12\GripFit_YV12.dll")
LoadPlugin("C:\Filters25\stmedianfilter_25_dll_20030122\Avisynth_2.5a_Version\STMedianFilter.dll")
LoadPlugin("C:\Filters25\asharp_25_dll_20030118\asharp.dll")
LoadPlugin("C:\Filters25\unfilter_25_dll_20030116\UnFilter_Avisynth_2.5_Alpha\UnFilter.dll")
LoadPlugin("C:\Filters25\undot_25_dll_20030118\UnDot.dll")
LoadPlugin("C:\Filters25\decomb_25_dll_20030327\decomb406b7\Decomb.dll")
####
##
#
####

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

## Main section and static filters ###
#
Mpeg2Source("E:\dcd\test25\2.d2v")
#
FieldDeinterlace()
undot()
Limiter()
asharp(1, 4)
GripCrop(352, 288)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
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 >= 2 ? \
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) ")

#
#
#

GripBorders()
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
Limiter()

#
#
## Functions ###

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

#
####

Is this OK?

Avalon 07-17-2003 06:27 PM

I used the MA Script. I only add an Deinterlacer.

This was the Output. Original 352x288

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

What can I do, to get the blocky picture smoother?[/IMG]

jorel 07-17-2003 06:40 PM

yes,
just like i post here many times ago and today,and i see more..
the skin color is too green(means less red) and see the white
in her eyes are yellow/green too!

see my last post trying to explain it...
Posted: Thu Jul 17, 2003 8:45 pm here:
http://www.kvcd.net/forum/viewtopic.php?t=4983&start=16


:!:

Dialhot 07-17-2003 06:46 PM

Quote:

Originally Posted by Avalon
What can I do, to get the blocky picture smoother?[/IMG]

Raise the CQ :idea:

jorel 07-17-2003 06:52 PM

i'm back to answers Phil!

if with 480x480 in 83 minutes movie i got blocky and
"everybody" with more resolution(544x or 702x)with more than 83 minutes
:arrow: don't got blocks... :?
the script is the same used for all...
if i "Raise the CQ" the final file size will encrease,of course and i say
bye,bye to one cdr 700mb.
:lol:
what i do?
:? :?

Avalon 07-17-2003 07:01 PM

If I use this script:

Code:

#======================================================#
# -= AviSynth script by MovieStacker v2.0.0 (beta3) =- #
#======================================================#

LoadPlugin("C:\Programme\MovieStacker\Filters\MPEG2Dec.dll")
LoadPlugin("C:\Programme\MovieStacker\Filters\DecombLegacy.dll")
LoadPlugin("C:\Programme\MovieStacker\Filters\GripFit_preview.dll")
LoadPlugin("C:\Programme\MovieStacker\Filters\BlockBuster.dll")
LoadPlugin("C:\Programme\MovieStacker\Filters\UnFilter.dll")
LoadPlugin("C:\Programme\MovieStacker\Filters\LegalClip.dll")

Mpeg2Source("E:\dcd\test25\testfinal.d2v")
LegalClip()
FieldDeinterlace()
GripCrop(352, 288, overscan=1)
GripSize(resizer="BilinearResize")
UnFilter(50, 50)
TemporalSmoother(1, 2)
MergeChroma(blur(1.58))
MergeLuma(blur(0.2))
BlockBuster(method="noise", detail_max=7, seed=1)
GripBorders()
LegalClip()

The Output will be this: Original again 352x288

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

Why? Can I get of of the blocks or not?

Min.Bit 300; Max.Bit. 1800; CQ 60.

I´ll try it again with CQ 90...

AviSynthSwitcher: I fixed the problem. I looked into the folder of the program. I found older versions of AVISynth and updated it to 2.0.8 and 2.5.2. Now i can switch without problems!!!!!

kwag 07-17-2003 07:10 PM

@Avalon,

Blockbuster(noise) is not effective with CQ. Use CQ_VBR for resolutions of 352x240(288).

-kwag

Avalon 07-17-2003 07:24 PM

Now i tested all.

d2v directly loaded in TMPGEnc:

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

sometimes blocky.

d2v across AVS 2.0.8 (KVCD Script):

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

blocky

d2v across AVS 2.5.2 (MA Script):

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

The hole sample blocky!!!

Avalon 07-17-2003 07:27 PM

Quote:

Blockbuster(noise) is not effective with CQ. Use CQ_VBR for resolutions of 352x240(288).
I´ll try it...

Result:

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

now i try it with 2.5.2...

Dialhot 07-17-2003 07:33 PM

Quote:

Originally Posted by jorel
i'm back to answers Phil!

if with 480x480 in 83 minutes movie i got blocky and
"everybody" with more resolution(544x or 702x)with more than 83 minutes
:arrow: don't got blocks... :?
the script is the same used for all...
if i "Raise the CQ" the final file size will encrease,of course and i say
bye,bye to one cdr 700mb.
:lol:
what i do?
:? :?

You :

1/ lower the min video rate to 64Kbs (I encode everything at this rate)
2/ lower the audio rate to 112
3/ lower the res to 352*480
4/ blur the chroma to 1.58 insteed of 1.50 (Maxthreshold in the MA script)
4/ use TemporalCleaner(6+nf,13+nf) insteed of temporalsoften
5/ add DCT(1,1,1,1,1,1,0.5,0) at the end of the script
6/ blur luma a little bit more (0.2)
7/ add Dup(threshold=1,blend=true) just before DCT
8/ use an overscan of 2

Do this step by step until you have correct result. I generaly stop to 5 even with movie monger than 1h40 !

And finaly, if nothing works, change the movie :-)

PS: I forgot "0/ use a 90min CD" :-))

Avalon 07-17-2003 07:38 PM

@ Dialhot: Can u post your script?
Do U use CQ or VBR_CQ?

Will it be like this?

Code:

######
###        AVISYNTH-Script (für Version 2.5.2) von Avalon
###                DCD 4.0
###        ScriptVersion 180703/0246/Normal
######
##
##          Es werden alle Filter geladen, aber nicht alle sind aktiviert. Um dies zu ändern
##          entfernt die # vor den jeweiligen Zeilen.
##
## DLL Sektion ##
#
LoadPlugin("C:\Filters25\mpeg2dec3_25_dll_20030119\MPEG2Dec3.dll")
LoadPlugin("C:\Filters25\GripFit_YV12\GripFit_YV12.dll")
LoadPlugin("C:\Filters25\stmedianfilter_25_dll_20030122\Avisynth_2.5a_Version\STMedianFilter.dll")
LoadPlugin("C:\Filters25\asharp_25_dll_20030118\asharp.dll")
LoadPlugin("C:\Filters25\unfilter_25_dll_20030116\UnFilter_Avisynth_2.5_Alpha\UnFilter.dll")
LoadPlugin("C:\Filters25\undot_25_dll_20030118\UnDot.dll")
LoadPlugin("C:\Filters25\decomb_25_dll_20030327\decomb406b7\Decomb.dll")
LoadPlugin("C:\Filters25\dctfilter_25_dll_20030221\DctFilter.dll")
LoadPlugin("C:\Filters25\temporalcleaner_25_dll\TemporalCleaner.dll")
LoadPlugin("C:\Filters25\dup220b1/Dup.dll")
#
####
##
##
## Definierte Variablen und Konstanten ##
#
MaxTreshold = 1.50
nf =  0 # Current frame.
#
####
#
##### Haupt Sektion und statische Filter ###
#
Mpeg2Source("tragt hier den Pfad zu Eurer d2v-Datei ein.")
#
# z.B.          MPEG2Source("C:\dcd\dvd.d2v")
undot()
Limiter()
asharp(1, 4)

GripCrop(352, 288)

GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(1.58))
MergeLuma(blur(0.2))

FieldDeinterlace()
TemporalCleaner(6+nf,13+nf)

# ( 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 >= 2 ? \
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) ")
#
#
#
GripBorders()
#
#
####LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
Limiter()
#
#
#
##### Functions ###
#
function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}

Dup(threshold=1,blend=true)
DctFilter(1,1,1,1,1,1,0.5,0)

#
########


kwag 07-17-2003 07:45 PM

Hi Avalon,

When you have some time, and I mean a very long time :) , take a look at this (LONG) thread: http://www.kvcd.net/forum/viewtopic.php?t=2073
There you'll find all the tests we made, comparing CQ vs. CQ_VBR.

-kwag

Avalon 07-17-2003 07:54 PM

Thanks!

I´ll look to Your samples:

Quote:

Here's another view. Please pay special attention to the water and fire scenes:

These are shorter samples:
http://www.kvcd.net/k19-cq-vbr.m1v
http://www.kvcd.net/k19-cq.m1v

jorel 07-17-2003 08:49 PM

Quote:

Originally Posted by Avalon
Thanks!

I´ll look to Your samples:

Quote:

Here's another view. Please pay special attention to the water and fire scenes:

These are shorter samples:
http://www.kvcd.net/k19-cq-vbr.m1v
http://www.kvcd.net/k19-cq.m1v

and more:
frame 86 in vdubmod:
the cord(cable) between the leg of the guy walking
and the head of other guy..in cqvbr show strange artefacts,cq is clean,
and more details in this scene,easy too see.

frame 140 in the water,cq is champion comparing with cqvbr.
frame 208 in the fire,cq is champion comparing with cqvbr that is blocky.
frame 290 with H.Ford,cq is champion again comparing with cqvbr.
and in general details cq is better!

ps:
8O
the strange:
H.Ford seems to me , but i'm really much more beautiful!
:lol: :lol: :lol: :mrgreen:
hey,....but he have more hair.
:bawl:

Avalon 07-17-2003 08:53 PM

This is quite good... Im on page 39 of 43 :wink: :wink: :wink: :wink:

Quote:

0. Encoder: Use TMPGEnc
1. Matrix: Q.Matrix Notch
2. Rate control mode: CQ (use ToK to predict value)
3. Min BR: does not really matter. Use 0.
4. Max BR: 2520
5. GOP: 1-24-2-1-24 (for cartoons 1-12-2-1-15 NTSC, 1-24-2-1-12 PAL)
6. Res: 528x480
7. Stream: MPEG-1 if the average video BR < 1800, MPEG-2 otherwise.
8. Don't detect scene change
9. Use Moviestacker, load the suggested script for KVCDx3 and tweak it to match the "Latest Optimal Script". Use Gripfit and Bicubic resize. Use overscan = 2.
10. Motion search precision: Use High Quality
11. DC component precision: 8 bit
12. Audio: 128 kbps, Joint stereo
13. VBV buffer size: 0 (Auto)
14. Picture spoilage: 0 0
15. No motion search for still picture part by half pixel: Checked
16. Soften block noise: Unchecked
17. Burn as SVCD if your player supports it, else use VCD.
18. File prediction factor: 0.98
19. In NTSC, use Force Film if possible, IVTC if Telecined, and Deinterlace as a last resort.
20. Don't use "Add SVCD scan offsets" nor "Align sequece headers".
21. Use CD size 810 and overburn a minute or so if your CD-Writer supports it. Use 8x at most when overburning.
And Kwags replay:

Quote:

Hi r6d2,

A couple of corrections on the latest achievemnts and findings :

"3. Min BR: does not really matter. " Use 0. -> If your player supports going down to 0, by all means use it
Most DVD players have problems below 300Kbps, so we settled for 300 as a safety factor.

"7. Stream: MPEG-1 if the average video BR < 1800, MPEG-2 otherwise." -> I would say up to 2,500, use MPEG-1. Above that, use MPEG-2.

"10. Motion search precision: Use High Quality" -> If you are going to use the new motion adaptive script for AviSynth 2.52, change that to "Motion Estimation". It produces better video with less visible artifacts.

"12. Audio: 128 kbps, Joint stereo" -> Joint stereo is a No No
Use "Dual channel", and you can also go down to 112Kbps if you encode with HeadAC3he. If you encode "Joint Stereo", you will kill "Surround 2" signals, and the sound will be messed up on a Prologic II receiver.

"13. VBV buffer size: 0 (Auto)" -> Don't use auto Use TMPEG's default. It's more compatible.

"15. No motion search for still picture part by half pixel: Checked" -> Uncheck that

Everything else is fine

Avalon 07-17-2003 08:58 PM

My last test will go with Motion Estimation and the MA-Script in 528x576...

I´m very tired!!!! Now in Germany it is 3:57 AM and I´ve today a long day...

Good night everyone (or goodmorning...)

BTW...

can I edit the Video.en1-file to VBR-CQ or Motion Estimation ?

An nother question...

is there a good Deinterlacer out... where and if posible a sample ASV-Script...

jorel 07-17-2003 09:35 PM

@ Avalon
good night my friend!
:)
i'm using fielddeinterlace(decomb) but maybe someone can show us
another better choice.

@ Phil
ok friend,i will try all of your recomendations posted....
seems a "brain surgery" in the script!
:lol:
thank you very much!
:wink:

Avalon 07-18-2003 02:50 AM

I changed the testing source... The Princess Blade sample wasn´t the good choice!!!!

I´ll try it now with the full Tomb Raider 2 Trailer out of a DVD...
Looks better...

Post U then my results...

Dialhot 07-18-2003 05:03 AM

Quote:

Originally Posted by Avalon
@ Dialhot: Can u post your script?

I don't have it here at the office so I'll just modify you own script to show you where are the errors.

Quote:

Do U use CQ or VBR_CQ?
CQ

Now the script :

MaxTreshold = 1.50
nf = 0 # Current frame.

Mpeg2Source("tragt hier den Pfad zu Eurer d2v-Datei ein.")
undot()
Limiter()
asharp(1, 4)

GripCrop(352, 288) <-- you can try (352,576)

GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(1.58))
MergeLuma(blur(0.2))

FieldDeinterlace()
TemporalCleaner(6+nf,13+nf) <-- REMOVE

SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \
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) ") <-- REPLACE by the "TemporalCleaner" line shown above

GripBorders()
MovieStacker!
Limiter()

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

Dup(threshold=1,blend=true) <-- move before function
DctFilter(1,1,1,1,1,1,0.5,0) <-- move before function

#
########[/code][/quote]

Wilbert 07-18-2003 06:48 AM

Two mistakes:

1) You smooth before deinterlacing. Deinterlace first and then do the rest.

2) You sharp first and then smooth again. Better do it the other way around.


All times are GMT -5. The time now is 07:56 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.