digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Motion adaptive filtering now possible? (http://www.digitalfaq.com/archives/avisynth/3594-avisynth-motion-adaptive.html)

kwag 05-31-2003 11:30 PM

Hi jorel,

The sample was encoded with a CQ of 66, which is about right for the movie on two CDs at 704x480. That's a full screen version, so on one CD, I would have gone 528x480 and not 704x480. But on two CDs, it will look just like the DVD :D

-kwag

kwag 05-31-2003 11:56 PM

Yesterday, I encoded "The Foreigner" with the script that was posted without scene change detection. The CQ that ToK calculated was CQ=63.65. I just fed the new script to ToK, and the new CQ is 63.974 :!:
Not that much, but obviously it's a small increase in CQ :)

-kwag

jorel 06-01-2003 12:12 AM

Quote:

Originally Posted by kwag
Hi jorel,

The sample was encoded with a CQ of 66, which is about right for the movie on two CDs at 704x480. That's a full screen version, so on one CD, I would have gone 528x480 and not 704x480. But on two CDs, it will look just like the DVD :D

-kwag

Kwag,
:D
again:
Resolution (fps):480x480 (29,970 fps)
Total Frames: 5001
Total Time : 00:02:47

Encoding... CQ : 71,867
Final Encoded Size: 27.415.408
Total Time (all operations): 00:07:42

results:
clear like :sun:
colors like :umbrella:
quality :yippie:

i can imagine the result with two CDs in 528x480,
...it will look just like the DVD 8O

you will update the script or i wait a little more?
your brain don't stop!
:lol:

syk2c11 06-01-2003 12:28 AM

Hi Kwag,
What is the function of "Limiter()"?

kwag 06-01-2003 12:34 AM

Current script was just updated :)
Here's a sample with the new script with scene change detection.
TRY to find macroblocks in the sample :!:
Sample is 18 seconds @704x480, CQ=63.97 (target for one CD-R) MIN=300, MAX=2,500.
www.kvcd.net/Foreigner-scd.mpg

I know I won't be doing any more 352x480 resolution encodes :mrgreen:
With this stuff, there's no need to go below 528x480, and we haven't even finished tweaking this yet :!:
Can't wait to get some 90 minute CD-Rs in my hands 8)

-kwag

kwag 06-01-2003 12:34 AM

Quote:

Originally Posted by syk2c11
Hi Kwag,
What is the function of "Limiter()"?

Same as LegalClip().

-kwag

bman 06-01-2003 01:41 AM

Hi all !
Kwag - as always u are surprising us with new achievements :!: :!: :!:
Clip looks great and there is nothing new in what I sead :lol: :lol: :lol:
I have few questions or maybe requests to U or sh0dan or any others too :
1 . What about VobSub or TextSub for avs2.52 :?: :?: :?:
any chanse to get it soon ???
2. I have to encode my doughters wedding and I need to make a standard VCD . I tryed both of scripts in avs 2.08 and avs 2.5* and I'm disappointed with result :
Encoder is just going creasy when he gets to dancing scenes : I see ugly noticable blockiness .
I tryed to add some noise with blockbuster but no success .
I can do that in higher resolution but there is compatibility prob with another players , So I'm stucked .
Any suggestions ????
bman

TBO 06-01-2003 04:51 AM

wow,Great!
the samples looks great, Kwag :D

TBO

Jellygoose 06-01-2003 06:54 AM

Quote:

Originally Posted by kwag
Current script was just updated :)
Here's a sample with the new script with scene change detection.
TRY to find macroblocks in the sample :!:
Sample is 18 seconds @704x480, CQ=63.97 (target for one CD-R) MIN=300, MAX=2,500.
www.kvcd.net/Foreigner-scd.mpg

I know I won't be doing any more 352x480 resolution encodes :mrgreen:
With this stuff, there's no need to go below 528x480, and we haven't even finished tweaking this yet :!:
Can't wait to get some 90 minute CD-Rs in my hands 8)

-kwag

You're so right kwag... There's still lots of work to do. I'm going to benchmark some Temporal Filters against each other, and will let you know the results... great work, all of you!

TBO 06-01-2003 07:50 AM

I have a problem here:

Code:

## DLL Section ##
#
LoadPlugin("C:\01 - KVCD TESTS\filters\MPEG2Dec3.dll")
LoadPlugin("C:\01 - KVCD TESTS\filters\UnFilter.dll")
LoadPlugin("C:\01 - KVCD TESTS\filters\STMedianFilter.dll")
LoadPlugin("C:\01 - KVCD TESTS\filters\BlockBuster.dll")
LoadPlugin("C:\01 - KVCD TESTS\filters\Sampler-2.5.dll")
#
####

## Defined Variables and Constants ##
#
MaxTreshold = 1.58
scd_trigger = 1.0 # Scene change trigger value.
cf = 0 # Current frame.
lf = 0 # Last frame
#
####

## Main section and static filters ###
#
Mpeg2Source("C:\Dvd\We were soldiers\we were soldiers.d2v")
Limiter()
UnFilter(50, 50)
BicubicResize(512, 414, 1/3, 1/3, 4, 0, 712, 576)
STMedianFilter(8, 32, 0, 0 )
TemporalSoften(2,7,7,3,2) # Experimental!
MergeChroma(blur(1.50)) 
MergeLuma(blur( 0.1))
#
####

## Dynamic Linear Adaptive filtering and Scene Change Detection ##
#
FrameEvaluate("lf = YDifferenceFromPrevious()/16")
FrameEvaluate("cf = YDifferenceToNext()/16")
ScriptClip("(cf - lf) < scd_trigger && cf < MaxTreshold ? MergeLuma(blur(cf)) : MergeLuma(blur( 0.1 ))")
ScriptClip("(cf - lf) < scd_trigger && cf >= MaxTreshold ? MergeLuma(blur(MaxTreshold)) : MergeLuma(blur( 0.1 ))")
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
#AddBorders( Your_Values_Here ) # Depends on situation. Use MovieStacker!
AddBorders(16, 81, 16, 81)
Limiter()
Sampler(100, length=24)
#
####

Im getting this message:
Evaluate Division by zero.

I dont know whats wrong,please help.

TBO

jorel 06-01-2003 08:12 AM

:idea:

Jellygoose,

i read some about the new filter from sh0dan called MipSmooth.
i don't test it but seems good.

do you know this filter?

from sh0dan:
MipSmoother is an attempt at reinventing SmoothHiQ and Convolution3D. For now this is a proof of concept, and the first versions are for evalutation of quality and speed. MipSmooth was made to enable smoothing of larger pixel areas than 3x3(x3), to remove blocks and smoothing out low-frequency noise.
It is my hope that when this filter has been tweaked it will be better than C3D at smoothing out flat surfaces and gradients. This should be good for cartoons/anime, but it actually also helps film footage quite nicely.

:!:

Red-M 06-01-2003 10:02 AM

Good stuff
 
Enjoying testing this, but I was testing encoding a 4:3 fullscreen Episode of Red-Dwarf. Im still getting a "Slight" burst of lightness on some scenes, but looks nice to say the orignal DVD looks, well below average.
but still testing :wink:

kwag 06-01-2003 10:04 AM

Quote:

Originally Posted by TBO
I have a problem here:



Im getting this message:
Evaluate Division by zero.

I dont know whats wrong,please help.

TBO

Make sure you are using the new AviSynth 2.52. If that doesn't do it, remove the lines:
Code:

LoadPlugin("C:\01 - KVCD TESTS\filters\BlockBuster.dll")
LoadPlugin("C:\01 - KVCD TESTS\filters\Sampler-2.5.dll")

and Sampler(100, length=24)

See if the error goes away.

-kwag

Jellygoose 06-01-2003 10:07 AM

Hi kwag...

Hmmm just tested the newest script with scene change detection... The flashing is completely gone for me know, but I noticed that the whole movie looks a lot blurrier now... :roll:
What do I have to change to remove the static MergeLuma of 0.1 from the script, as I think that this is the case...
Can I just comment it out? or do I also have to alter these lines here:

Code:

ScriptClip("(cf - lf) < scd_trigger && cf < MaxTreshold ? MergeLuma(blur(cf)) : MergeLuma(blur( 0.1 ))")
ScriptClip("(cf - lf) < scd_trigger && cf >= MaxTreshold ? MergeLuma(blur(MaxTreshold)) : MergeLuma(blur( 0.1 ))")

:?:
I'd like to use maybe a static MergeLuma of 0.05 or 0.025...

kwag 06-01-2003 10:14 AM

Re: Good stuff
 
Quote:

Originally Posted by Red-M
Im still getting a "Slight" burst of lightness on some scenes,

Hi Red-M,

Try that same scene without the filters. There shouldn't be a problem. I might be that those conditions are present on the original DVD :!:
Also, did you encode at 704x480(576) or another resolution :?:
If it was lower than that, we're probably going to have to play with the scd_trigger value :idea: The value I selected look optimal for 704x480(576), but I have to try at other resolutions.
If you want to see what values are being returned on each frame, look at the script I posted here earlier, that has the "Subtitle" lines added for debugging, and then you can see the value changed dynamically as you play your .avs in WMP or even in Vdub :)

-kwag

kwag 06-01-2003 10:19 AM

Quote:

Originally Posted by Jellygoose
Hi kwag...

Hmmm just tested the newest script with scene change detection... The flashing is completely gone for me know, but I noticed that the whole movie looks a lot blurrier now... :roll:
What do I have to change to remove the static MergeLuma of 0.1 from the script, as I think that this is the case...
Can I just comment it out? or do I also have to alter these lines here:

Code:

ScriptClip("(cf - lf) < scd_trigger && cf < MaxTreshold ? MergeLuma(blur(cf)) : MergeLuma(blur( 0.1 ))")
ScriptClip("(cf - lf) < scd_trigger && cf >= MaxTreshold ? MergeLuma(blur(MaxTreshold)) : MergeLuma(blur( 0.1 ))")

:?:
I'd like to use maybe a static MergeLuma of 0.05 or 0.025...

There are two places. Change this to read:
Code:

ScriptClip("(cf - lf) < scd_trigger && cf < MaxTreshold ? MergeLuma(blur(cf)) : MergeLuma(blur( 0 ))")
ScriptClip("(cf - lf) < scd_trigger && cf >= MaxTreshold ? MergeLuma(blur(MaxTreshold)) : MergeLuma(blur( 0 ))")

And remove the line:
Code:

MergeLuma(blur( 0.1))
from the main section.

That will kill the MIN mergeluma of 0.1 completely on scene changes and throughout the picture, and only apply the dynamic value returned, which can go way below 0.1 throughout the picture :)

-kwag

ovg64 06-01-2003 10:47 AM

Hey Kwag is there a way to lower the Briteness in a movie with avs 2.5
i know in 2.0 we had the tweak filter for that, or you could change the luminance when doing the d2v but this doen't work with 2.5 and i dont know of any filter for this problem. This movie is too brite and file size is too big, i want to up CQ a bit more. :!:

rendalunit 06-01-2003 11:28 AM

Quote:

Originally Posted by TBO
I have a problem here:

Code:
## DLL Section ##
#
LoadPlugin("C:\01 - KVCD TESTS\filters\MPEG2Dec3.dll")
LoadPlugin("C:\01 - KVCD TESTS\filters\UnFilter.dll")
LoadPlugin("C:\01 - KVCD TESTS\filters\STMedianFilter.dll")
LoadPlugin("C:\01 - KVCD TESTS\filters\BlockBuster.dll")
LoadPlugin("C:\01 - KVCD TESTS\filters\Sampler-2.5.dll")
#
####

## Defined Variables and Constants ##
#
MaxTreshold = 1.58
scd_trigger = 1.0 # Scene change trigger value.
cf = 0 # Current frame.
lf = 0 # Last frame
#
####

## Main section and static filters ###
#
Mpeg2Source("C:\Dvd\We were soldiers\we were soldiers.d2v")
Limiter()
UnFilter(50, 50)
BicubicResize(512, 414, 1/3, 1/3, 4, 0, 712, 576)
STMedianFilter(8, 32, 0, 0 )
TemporalSoften(2,7,7,3,2) # Experimental!
MergeChroma(blur(1.50))
MergeLuma(blur( 0.1))
#
####

## Dynamic Linear Adaptive filtering and Scene Change Detection ##
#
FrameEvaluate("lf = YDifferenceFromPrevious()/16")
FrameEvaluate("cf = YDifferenceToNext()/16")
ScriptClip("(cf - lf) < scd_trigger && cf < MaxTreshold ? MergeLuma(blur(cf)) : MergeLuma(blur( 0.1 ))")
ScriptClip("(cf - lf) < scd_trigger && cf >= MaxTreshold ? MergeLuma(blur(MaxTreshold)) : MergeLuma(blur( 0.1 ))")
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
#AddBorders( Your_Values_Here ) # Depends on situation. Use MovieStacker!
AddBorders(16, 81, 16, 81)
Limiter()
Sampler(100, length=24)
#
####


Im getting this message:
Evaluate Division by zero.

I dont know whats wrong,please help.

TBO

the problem is definetely this line:
Code:

Sampler(100, length=24)
use Sampler-2.5.dll and change the line to
Code:

Sampler()
but if you're using ToK don't have any Sampler() in there

-ren

rendalunit 06-01-2003 11:32 AM

Hey kwag,

Your scene detection algorithm is working beautifully! Great job :buzzmile:

ren

kwag 06-01-2003 11:38 AM

Quote:

Originally Posted by rendalunit
Hey kwag,

Your scene detection algorithm is working beautifully! Great job :buzzmile:

ren

:mrgreen:
I finished encoding "The Foreigner" (again!) and just watched some key areas that had "flashes" before, and they're all gone :!: Scene change transitions are completely smooth now 8)
Did you run the script with the debugging subs turned on, to see the scene changes in action :?:

-kwag


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