digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Latest script discussion (http://www.digitalfaq.com/archives/avisynth/3145-avisynth-latest-script.html)

bigggt 04-24-2003 05:36 PM

Hi Daager,do you mean to download svcd instead of the divx or xvid movies,if you are into that sort of thing :wink:

Wolfi 04-24-2003 05:45 PM

What is macroblocks, were do I look, how do they look like 8O

//Wolfi

Bigswaffo 04-24-2003 08:14 PM

Quote:

Originally Posted by bigggt
Hi Daager,do you mean to download svcd instead of the divx or xvid movies,if you are into that sort of thing :wink:

I'm also curious as to how you go about converting SVCD to KVCD. :D

Reno 04-24-2003 10:32 PM

Quote:

Originally Posted by Wolfi
What is macroblocks, were do I look, how do they look like 8O

//Wolfi

Macroblocks manifest in flat, darkened areas, like a wall in a dimly lit house, or in subtle gradients, such as those found in scenes with fog or smoke. I hate them with a passion, but if you're working with Divx sources, you're sort of stuck with em...

Is it just me, or do macroblocks have a certain color bias?? Mainly towards earthtones and low saturation blues... I've gotten to the point where I can watch a DVD, and key in on areas where macroblocks will appear on an encode. Boy, I miss just watching a movie to enjoy it... now I frikkin analyze everything!! :oops:

Kane 04-25-2003 02:42 AM

Quote:

Originally Posted by Reno
Boy, I miss just watching a movie to enjoy it... now I frikkin analyze everything!! :oops:

hehe
yeah, that´s the "disadvantage" of encoding

jorel 04-25-2003 02:58 AM

ok.....not kiddin!
:)

two months pass,
8O 8O i'm trying to encode the musical
from Sarah Brightman-La Luna.

MovieStacker and ToK help me (us) a lot with this job.
don' t need to write this but....
without the templates was impossible ,of course.

the boring part:
the filters! :roll:

La Luna is a really blue film,the ilumination is too blue and dark!
using the last filters, i see lots of smoke.
with blockbuster noise, is just a few better but really slow! :cry:

then i'm waiting for new mix filters ideas cos
i really want a big result!
i don't like the "more or less things",this time is gone.

any news?
or change anything in the last script?
:idea: :?:

girv 04-25-2003 05:25 AM

MarcFD's "MSoften" filter seems to make a good job of de-blocking
xvid and divx sources. I havent had a chance to play with settings
much or try it on different sources, but results on one particularily bad
source with the defaults look very promising! Flickering block artefacts
on flat areas were almost completely removed - the temporal denoiser
in MSoften seems to be something special :)

There were some other artefacts introduced however so it still needs
some tweaking. But its worth checking it out IMHO...

/girv

Wolfi 04-25-2003 08:19 AM

Quote:

Originally Posted by girv
MarcFD's "MSoften" filter seems to make a good job of de-blocking
xvid and divx sources. I havent had a chance to play with settings
much or try it on different sources, but results on one particularily bad
source with the defaults look very promising! Flickering block artefacts
on flat areas were almost completely removed - the temporal denoiser
in MSoften seems to be something special :)

There were some other artefacts introduced however so it still needs
some tweaking. But its worth checking it out IMHO...

/girv

Hi girv :) were can I download and try MSoften filter :?: And were do you put the filter in your script?

//Wolfi

girv 04-25-2003 08:55 AM

Quote:

Originally Posted by Wolfi
Hi girv :) were can I download and try MSoften filter

I got MSoften (AVISynth 2.0x YUY2 only) from this this doom9 thread

Quote:

Originally Posted by Wolfi
And were do you put the filter in your script?

The script I was messing about with:
Code:

...
AVISource("divx.avi")

UnFilter(20,20)
Blockbuster(method="dither",detail_min=1,detail_max=7,variance=0.3,seed=1,luma_offset=-2)
FluxSmooth()
MSoften(3,3,4,3,pre=1,post=1,speed=4,showmask=false)

I'm not entirely sure what the MSoften parameters mean :) Also
you may want to start with just MSoften on its own to see the effect.

I was loading the script in vdub and applying a +200% contrast
filter to make the blocks more obvious to the eye.

good luck :)

/girv

jorel 04-25-2003 10:17 AM

@ girv and Wolfi :wink:

all filters that you need:

http://www.kvcd.net/forum/viewtopic....f0cf67c08bcc12

click on "tons more" link!
:wink:

Daagar 04-25-2003 01:34 PM

Since I hadn't tried for a while, I converted a 1-CD XViD to a 1-CD KVCD using the latest "optimal script" settings. The results were outstanding. So my previous statement about always going from svcd to kvcd isn't always necessary. This was a low action film, so that may have helped, but I didn't notice any strong left-over artifacts from the original vxid encoding. (The movie was some screwy 580x306 resolution, so I used KVCDx3 at 528x480).

The optimal scripts are truly optimal!

Reno 04-25-2003 02:28 PM

Gotta try that Msoften filter...

It doesn't trash detail, does it?

Boulder 04-28-2003 03:24 PM

Has anyone tried fiddling with Unfilter(-5,-5) ? It seems that it reduces the filesize with lower quality sources quite dramatically.

See here:

http://forum.doom9.org/showthread.php?s=&threadid=51181

kwag 04-28-2003 03:37 PM

I believe Unfilter values below 0 (negative) just start to blur the image!, so I think that mergechroma with a tad of mergeluma, should accomplish a similar result. That's just what I think. I haven't made any comparisons :!:

-kwag

jorel 04-28-2003 04:07 PM

yes to Boulder and Kwag !

from unfilter readme:

The effects are fairly mild but be aware that excessive sharpening makes things
harder to compress and may bring about the dreaded "edge enhancement artifacts"
the people complain about in DVD's from some studios. And while excessive
softness may hide noise it loses detail and generally just looks ugly. So it is
probably best to just try to reverse whatever has already been done to your source.

:!:

girv 04-29-2003 05:17 AM

Heres my latest effort at a xvid-block busting script:

Code:

LoadPlugin("C:\Program_Files\Video\AVISynth\Plugins\MPEG2DEC2.dll")
LoadPlugin("C:\Program_Files\Video\AVISynth\plugins\LegalClip.dll")
LoadPlugin("C:\Program_Files\Video\AVISynth\plugins\Blockbuster.dll")
LoadPlugin("C:\Program_Files\Video\AVISynth\plugins\MSoften.dll")

AVISource("test.avi"))
LegalClip()

LanczosResize(432,544)
AddBorders(0,32,0,32)
Blockbuster(method="dither",detail_min=1,detail_max=10,variance=0.3,seed=0)
MSoften(3,3,4,3,pre=1,post=1,speed=4,showmask=false)
MergeChroma(Blur(0.5))
MergeLuma(Blur(0.1))
Crop(0,32,432,544)

LegalClip()

I tried the above script with a number of xvid and divx encoded sources and it did a good job of removing the blocks on all of them while retaining detail in the picture. Please do try it and tweak it yourselves!

Things to notice:

1) MSoften doesnt seem to process the top and bottom few lines of the input, hence the slightly unusual AddBorders...Crop combination in there. Perhaps this wont be required if youre using GripSize / GripBorders but I'm not sure as I dont use them myself (no reason, I just never bothered to learn how :)

2) No UnFilter. UnFilter seems to really highlight the xvid blocks, so I dropped it. This leads on to...

3) ...LanczosResize and lower MergeChroma/MergeLuma blur factors to retain sharpness.

4) Blockbuster method is "dither" as "noise" seemed to leave blurred blocky areas that changed slowly over time - like xvid blocks in slow motion.

5) No TemporalCleaner or TemporalSmoother - MSoften does enough of this IMHO even with very noisy sources.

I dont know if its just my setup or the combination of filters I was using, but TemporalSmoother() seems to affect the colour balance of the result clip, making it slightly washed out and maybe a little more green. Anyone else notice anything like this? FWIW I was using TemporalSmoother(2,3)

I get an AVISynth error when using certain filters after MSoften - perhaps there is a bug lurking in there so watch out for it. Temporal smoothers seem to be the big problem eg: FluxSmooth, TemporalSmoother, TemporalCleaner etc.


File sizes are interesting also:
Code:

KVCDx3 MPEG1 300-2500kbps CQ 80

Original: 140159571
Optimal: 142891890
Reno  : 151225343
Mine  : 138720543

The "Reno" version was made with the test deblocker script Reno posted in this thread.

It seems removing those flashing xvid blocks really helps compression :)

telemike 04-29-2003 06:41 AM

QUESTION:

Has anyone run time tests for the different filters? I would like to know in the latest optimal script if I can drop one of the filters and gain time?

jorel 04-29-2003 06:46 AM

girv :)

great observations.

you are right,i see it a long time:
temporalSmoother turn
a little more green(more in very dark scenes)
try(2,1)...is better but you see less green problem.

Blockbuster...blurred blocky areas that changed slowly over time - like xvid blocks in slow motion.
yeah i'm with you here too.

lanczos is sharper but give some stranges artefacts
like little waves.

File sizes get hude changes ,depending in the order of the filters.

it all in vobs too,not only in xvid!
:wink:

jorel 04-29-2003 06:50 AM

Quote:

Originally Posted by telemike
QUESTION:

Has anyone run time tests for the different filters? I would like to know in the latest optimal script if I can drop one of the filters and gain time?

yes telemike, :)

i did tests and post somewhere in the forum.... :?
don't remember where i posted it.
:oops:

girv 04-29-2003 08:28 AM

Quote:

Originally Posted by jorel
you are right,i see it a long time:
temporalSmoother turn
a little more green(more in very dark scenes)
try(2,1)...is better but you see less green problem.

Good, I knew it couldnt just have been my old eyes or crappy monitor cable :)

The effect does get less with weaker settings as you say, but I'm not using TemporalSmoother any more anyway...

Quote:

Originally Posted by jorel
Blockbuster...blurred blocky areas that changed slowly over time - like xvid blocks in slow motion.
yeah i'm with you here too.

But "dither" mode fixed (or improved) that right?

Quote:

Originally Posted by jorel
lanczos is sharper but give some stranges artefacts
like little waves.

I didnt notice any artefacts like that, but the source I was using was a particularily bad xvid so it could have been very blurry and in need of agressive sharpening anyway. You could switch to BicubicResize or perhaps increase the Blur factors to reduce the artefacts I guess.

Quote:

Originally Posted by jorel
File sizes get hude changes ,depending in the order of the filters.

The filter order is important, I tried many different orders and this was the best one I found. The idea is to add noise to the xvid blocks, then get MSoften to blend them all together. But this still leaves areas of colour with blocky edges so a slight blur is applied to soften those away.

An improvement might be to apply a detail thresholded smoother to only affect the low-detail blocky areas instead of the picture wide blur Im using now. Feel free to test that idea :wink:

What did you try?

Quote:

Originally Posted by jorel
it all in vobs too,not only in xvid! :wink:

I didnt try the script with any VOBs, I was trying to optimise it for the particular type of noise found in xvid/divx encodes. Are there blocks in VOBs as well? What were the results like?

/girv

Reno 04-29-2003 01:22 PM

Very cool, Girv! I'll try your new method as soon as my current encode finishes!!

girv 04-29-2003 01:39 PM

One thing to note about the script I posted above is that its a bit slower than we're used to :-/ I'm looking at a ~5.5 hour encode for a 1h36m xvid on an XP2000+ machine with fast CL-2 DDR266 memory on an nForce2 mobo. I guess its mainly MSoften as the other filters are quite fast.

On the plus side, work is going to buy me a dual MP2600+, which should come in handy for *something* I'm sure. Though right now I can't think of exactly what I'll use it for ;)

/girv

Reno 04-29-2003 02:24 PM

@Girv,

I'm getting an error message stating 'the variables seed, variance, etc.. are only for use with the "noise" method.'

Am I missing something??

girv 04-29-2003 02:30 PM

Quote:

Originally Posted by Reno
I'm getting an error message stating 'the variables seed, variance, etc.. are only for use with the "noise" method.'

Am I missing something??

The script works as posted on my machine. According to the Blockbuster docs, "dither" takes the same parameters as "noise" except for "cache"...

Quote:

Blockbuster([clip], method="dither", common parameters, float mean, float variance, int seed)

For a description of this method's parameters, see the "noise" method above. Note however that the "dither" method has no cache parameter since it always generates only enough noise for one frame.

Reno 04-29-2003 03:31 PM

Ahhhh....

Updated my Blockbuster.dll (mine was ten days older than the current version), and all is well...

Thx Girv!

Wolfi 04-30-2003 08:49 AM

So you are saying that Girv's script works better and gives a better quality for DivX and Xvid sources :?:

LegalClip()
LanczosResize(432,544)
AddBorders(0,32,0,32)
Blockbuster(method="dither",detail_min=1,detail_ma x=10,variance=0.3,seed=0)
MSoften(3,3,4,3,pre=1,post=1,speed=4,showmask=fals e)
MergeChroma(Blur(0.5))
MergeLuma(Blur(0.1))
Crop(0,32,432,544)
LegalClip()

//Wolfi

girv 04-30-2003 09:25 AM

Quote:

Originally Posted by Wolfi
So you are saying that Girv's script works better and gives a better quality for DivX and Xvid sources ?

It seems to almost completely remove the flashing blocks of solid colour present in most xvid and divx sources (DCT blocks). I think it does cause some temporal blending artefacts but they might not be noticeable.

Code:

LegalClip()
LanczosResize(432,544)
Blockbuster(method="dither",detail_min=1,detail_max=10,variance=0.3,seed=0)
AddBorders(0,32,0,32)
MSoften(3,3,4,3,pre=1,post=1,speed=4,showmask=false)
Crop(0,32,432,544)
MergeChroma(Blur(0.5))
MergeLuma(Blur(0.1))
LegalClip()

You might also want to try changing the MergeChroma / MergeLuma combination for:

Code:

FluxSmooth(MergeLuma(last,1))
"MergeLuma(last,1)" does not affect the picture, but is a workaround for what I think is a bug in MSoften that causes AVISynth errors when FluxSmooth (amongst others) is used directly after it.

This is still highly experimental and I believe there is still room for improvement, so try it for yourself on some different sources, mess around with the script and let us know how you get on :)

Wolfi 04-30-2003 02:02 PM

I have a few more question :oops:

1. If you wanna put a movie on one 80min cd-r, how high can you rise the CQ with your script? For example, My CQ using Kwag's "For DVD and clean material" script lies around 60CQ when encoding a 90min movie. I'm using 224Mhz on audio.

2. If you compare your script with Kwag's when encoding DivX'es, witch picture quality gets best :?:

3. Why dont you use GripCrop? or is "Crop" "GripCrop" or should I write my resolution in LanczosResize? If you dont use GripCrop you wont be able to select what overscan you want, am I right?

4. Why not use DCTFilter :?: I've heard the piture quality wont suffer and the good thing is that the output size will be samller using DCTFilter filter, that means you can rise the CQ value, so isnt it good to use DCTFilter in your script?

Many questions :oops: :oops: :oops:

//Wolfi

Reno 04-30-2003 02:50 PM

Well, I gave it a shot, but IMHO it's too soft. Compression was sweeeeet though...

I grabbed a few elements from the script and tried this
-------------------------------------------------------------------------------------
#============================================#
# -=Mega Supreme AviSynth script by Reno =- #
#============================================#

LoadPlugin("C:\Program Files\MovieStacker\Filters\Mpeg2Dec.dll")
LoadPlugin("C:\Program Files\MovieStacker\Filters\TemporalCleanerOld.dll" )
LoadPlugin("C:\Program Files\MovieStacker\Filters\FluxSmooth.dll")
LoadPlugin("C:\Program Files\MovieStacker\Filters\GripFit_preview.dll")
LoadPlugin("C:\Program Files\MovieStacker\Filters\BlockBuster.dll")
LoadPlugin("C:\Program Files\MovieStacker\Filters\Msoften.dll")
LoadPlugin("C:\Program Files\MovieStacker\Filters\DustV5.dll")
LoadPlugin("C:\Program Files\MovieStacker\Filters\LegalClip.dll")
LoadPlugin("C:\Program Files\MovieStacker\Filters\Sampler.dll")

AviSource("Donnie Darko.avi",false)
ConverttoYUY2
LegalClip()
GripCrop(528, 480, overscan=2, source_anamorphic=false)
GripSize(resizer="LanczosResize")
SpaceDust()
TemporalCleaner(ythresh=1, cthresh=15)
sharpen(0.7)
mergechroma(blur(1.58))
mergeluma(blur(0.1))
Blockbuster(method="dither",detail_min=1,detail_ma x=10,variance=0.3,seed=0)
MSoften(3,3,4,3,pre=1,post=1,speed=4,showmask=fals e)

GripBorders()
LegalClip()

Sampler(length=24)
--------------------------------------------------------------------------------------

Did a great job on macroblocks, and the detail didn't appear to suffer at all...

girv 04-30-2003 03:02 PM

Quote:

Originally Posted by Wolfi
I have a few more question :oops:

Only a few I see ;)

Quote:

Originally Posted by Wolfi
1. If you wanna put a movie on one 80min cd-r, how high can you rise the CQ with your script?

Sorry, I've no idea as I havent encoded a full movie with any variation of this script yet. Anyone else? I posted the file sizes of the same clip encoded at the same settings using different scripts and mine did come out significantly smaller than the current DVD script.

Quote:

Originally Posted by Wolfi
2. If you compare your script with Kwag's when encoding DivX'es, witch picture quality gets best :?:

With my script the flashing DCT blocks you see on flat areas like walls etc. are greatly reduced. I'm not sure if the picture quality is affected much otherwise, but so far I've only been working with a low quality xvid encode so the picture quality is crappy anyway and its hard to tell.

In frame-by-frame analysis in VDub I do see some occasional over-smoothing and temporal ghosting artefacts from my script but I dont think they would be (very) noticeable when watching the movie on a TV.

I need to do test encodes with better quality xvid/divx's and compare them to the current DVD script. Or better yet, EVERYONE needs to do test encodes and report back here :)

Quote:

Originally Posted by Wolfi
3. Why dont you use GripCrop? or is "Crop" "GripCrop" or should I write my resolution in LanczosResize? If you dont use GripCrop you wont be able to select what overscan you want, am I right?

I dont use GripCrop et al simply because I never bothered to learn how! I prefer setting sizes manually and letting TMPGEnc add the overscan borders at encode time. Its just the way I like to work. I dont think it makes a difference, does it?

Perhaps some kind soul could post a GripCrop/GripSize version of my script?

Quote:

Originally Posted by Wolfi
4. Why not use DCTFilter :?: ?

I guess because Im trying to get rid of DCT artefacts, so adding an additional DCT/iDCT is going against what I'm trying to do. Also I dont have a pre-sharpening step (eg: UnFilter) so adding an extra spatial smoother would blur the picture too much I think.

I havent tried DCTFilter though so I could be way off here :)

girv 04-30-2003 03:05 PM

Quote:

Originally Posted by Reno
Well, I gave it a shot, but IMHO it's too soft. Compression was sweeeeet though...

I think you have too many softeners in there Reno. I tried much the same thing and, like you said, it looked too soft.

Quote:

Originally Posted by Reno
Did a great job on macroblocks, and the detail didn't appear to suffer at all...

cool :) thats some progress at least!

Wolfi 04-30-2003 04:55 PM

Girv thank you for answering :P I tried your script with the same movie :? Kwag's script gave me a CQ value of 61.xx but your script was quite different, it gave me a CQ of 53.xx 8O So the quality got poorer :(

//Wolfi

Kane 04-30-2003 05:31 PM

Quote:

Originally Posted by Wolfi
Girv thank you for answering :P I tried your script with the same movie :? Kwag's script gave me a CQ value of 61.xx but your script was quite different, it gave me a CQ of 53.xx 8O So the quality got poorer :(

//Wolfi

it doesn´t have to
i can remember scripts (long time ago), where i got cq 70 , but the quality was a lot poorer than cq 55 with current script (without STM, i hate that filter :twisted: )

kwag 04-30-2003 05:56 PM

Quote:

Originally Posted by Kane
(with STM, i hate that filter :twisted: )

Should I drop that filter completely from the current scripts :?: :roll:

-kwag

Kane 04-30-2003 06:03 PM

Quote:

Originally Posted by kwag
Quote:

Originally Posted by Kane
(without STM, i hate that filter :twisted: )

Should I drop that filter completely from the current scripts :?: :roll:

-kwag

if you ask ME, i would say YES
to make a long story short:
increased cq value, but poorer quality (with STM)

kwag 04-30-2003 06:18 PM

Filter gone!
I've already heard many people complaining about that, so I removed the filter from the script until further tests are done ( or a substitute for a good and fast "Median" filter appears! )

-kwag

ovg64 04-30-2003 06:33 PM

Quote:

Originally Posted by kwag
Filter gone!
I've already heard many people complaining about that, so I removed the filter from the script until further tests are done ( or a substitute for a good and fast "Median" filter appears! )

-kwag

yes k it is a fast filter but, when using it the movie looks almost like you were looking through a thick gass.

muaddib 04-30-2003 07:54 PM

Hi griv,

Just wanna give my 2 cents... because this script makes me really confused. :?

Quote:

Originally Posted by girv
Code:

LegalClip()
LanczosResize(432,544)
Blockbuster(method="dither",detail_min=1,detail_max=10,variance=0.3,seed=0)
AddBorders(0,32,0,32)
MSoften(3,3,4,3,pre=1,post=1,speed=4,showmask=false)
Crop(0,32,432,544)
MergeChroma(Blur(0.5))
MergeLuma(Blur(0.1))
LegalClip()


Look what you are doing:
First you resize to 432x544,
then you add 64 lines of top/bottom borders (32 lines each),
after that you crop all the borders you just added! 8O

So you end up with a final resolution of 432x544 <- that's a strange resolution!

I didn't get what you are trying to do... :roll:
I think that with this "strange" resolution TMPG will have to resize it too, and that's not good.

jorel 05-01-2003 03:57 AM

Quote:

Originally Posted by kwag
Filter gone!
I've already heard many people complaining about that, so I removed the filter from the script until further tests are done ( or a substitute for a good and fast "Median" filter appears! )

-kwag

wait Kwag,not too fast. 8O

you know,i make thousands tests before encode something.
believe me,sometimes i test for 2 months 8O
everything...scripts,the order of the filters in the script,CQ,
matrices,sizers(bilinear,lanczos...)...etc,etc.

not kidding:
i want best results, not lots of movies with poor quality
caused for filters or anything else.

the last script with STM filter is too slow but
testing the same sample with and without STM,
i see a big more details in scenes in the back of the movie.
little details are clean.
is really better and i have samples here.
the only problem was the velocity.
the script is too slow.
unfilter is fantastic and faster than others sharpen filters but
with 50,50 turn the script slow too!!!

then we need another good filter or better
is back with STM or change it all.

of course,it's only my oppinion!
:wink:

ps:
hard testing all:
i don't work no more(thanks GOD)
and stay in the pc all day long and sometimes for
3 nights without sleep!
doing what?
or in the forum,or testing programs and scripts.
and a months ago i posted tons of tested scripts
in the forum,don't remember where is it.
i test all of them and compare the results!!!
doing only one movie,i have only 4gb free space
in my maxtor 60gb.
tons of samples for compare.

hey,what a big ps!!!?!
:D
:)

Wolfi 05-01-2003 04:53 AM

3 nights 8O

"the last script with STM filter is too slow but
testing the same sample with and without STM,
i see a big more details in scenes in the back of the movie.
little details are clean."

You say that you see more details with STM filter :oops: :?:

//Wolfi


All times are GMT -5. The time now is 09:13 PM  —  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.