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 06-06-2003 10:29 AM

Quote:

Originally Posted by Jellygoose
However I'm still searching for a way to get rid of artifacts around objects and DCT Blocks in dark areas...

Hi Jellygoose,

That I'm afraid is something we'll probably never be able to accomplish with any pre-processing filtering :!:
That would be the work of motion estimation internal to the encoder.
Unless we decide to encode with a heavier blur, and then we can design some "sharpen goggles" and put them on to watch TV :mrgreen:

-kwag

Jellygoose 06-06-2003 10:34 AM

Where can I get those goggles man? :lol:
Nevermind, I just go over to the next movie... :)

kwag 06-06-2003 10:38 AM

Quote:

Originally Posted by Jellygoose
Where can I get those goggles man? :lol:

You have to talk to SansGrip, so he can make the "NoMoFluxGripFitOnYourEyes" goggles LOL :mrgreen:

girv 06-06-2003 10:45 AM

Quote:

Originally Posted by kwag
You have to talk to SansGrip, so he can make the "NoMoFluxGripFitOnYourEyes" goggles LOL :mrgreen:

What about a MotionAdaptiveChoppingLumaBlurWithNoBugsThatDoesnt TakeTwoWeeksToEncodeAMovie() plugin while he's at it?

bman 06-06-2003 12:21 PM

Quote:

Originally Posted by girv
Quote:

Originally Posted by kwag
You have to talk to SansGrip, so he can make the "NoMoFluxGripFitOnYourEyes" goggles LOL :mrgreen:

What about a MotionAdaptiveChoppingLumaBlurWithNoBugsThatDoesnt TakeTwoWeeksToEncodeAMovie() plugin while he's at it?

Can u say agin that filter name :lol: :lol: :lol: ?
bman

girv 06-06-2003 01:03 PM

Quote:

Originally Posted by bman
Can u say agin that filter name :lol: :lol: :lol: ?

Sorry, I don't have the bandwidth to transmit it again :wink:

rendalunit 06-06-2003 03:39 PM

Quote:

Originally Posted by girv
What about a MotionAdaptiveChoppingLumaBlurWithNoBugsThatDoesnt TakeTwoWeeksToEncodeAMovie() plugin while he's at it?

Man I can't wait for this MotionAdaptiveChoppingLumaBlurWithNoBugsThatDeosnt TakeTwoWeeksToEncodeAMovie filter :wink:

http://www.digitalfaq.com/archives/i.../2003/06/1.png

:cry: :cry: :cry: :cry:

black prince 06-06-2003 08:43 PM

@Kwag,

Removed all avisynth files and re-installed avisynth 2.52. Performed
system-tune up and tried steps to encode KVCD. This time everything
worked much better and faster. The movie “Abandon” is 96 minutes,
resolution I picked 528x480, audio 128kb @44.1 khz (Headac3he) and
Tok predicated CQ 71.23. Encoding time was 8 hrs, for one 80 minute CD.
This is much better. There were a few problems thought.

1) Picture quality is the best I’ve ever seen for KVCD (near DVD) :D

2) This error message from the avi script appeared:

I don’t know what “nf” means ([ScriptClip], line 1) :?

3) Computer stop responding with Tok at 49% complete :roll:

4) Undot() is suppose to clean-up source with Gibbs Effect and not clean source

5) How do I include “tv-overscan” with this script? :?:

-bp

kwag 06-06-2003 09:22 PM

Hi bp,

Check that you have the latest script. There shouldn't be any errors related to "nf". nf is just a temporary variable. For blocks overscan, I use MovieStacker, and after I set all my values, I copy+paste the mpeg2source, resize, addborders and letterbox lines into the basic skeleton script.

-kwag

black prince 06-06-2003 09:48 PM

@Kwag,

Here's the latest optimal script I'm using:

Quote:

LoadPlugin("E:\DVD BACKUP\1 - DVD2KVCD\3 - MOVIESTACKER\Filters25\MPEG2Dec3.dll")
LoadPlugin("E:\DVD BACKUP\1 - DVD2KVCD\3 - MOVIESTACKER\Filters25\asharp.dll")
LoadPlugin("E:\DVD BACKUP\1 - DVD2KVCD\3 - MOVIESTACKER\Filters25\undot.dll")
LoadPlugin("E:\DVD BACKUP\1 - DVD2KVCD\3 - MOVIESTACKER\Filters25\Unfilter.dll")
LoadPlugin("E:\DVD BACKUP\1 - DVD2KVCD\3 - MOVIESTACKER\Filters25\STMedianFilter.dll")


## Defined Variables and Constants ##
#
MaxTreshold = 1.50
scd_trigger = 15 # Scene change trigger value.
cf = 0 # Current frame.
lf = 0 # Last frame
val = 0 # Dynamic value applied to filters
#
####

## Main section and static filters ###
#

Mpeg2Source("D:\Temp\movie.d2v")

undot()
Limiter()
asharp(2, 4)
BicubicResize(704,480)
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.2))
#
#

## Dynamic Linear Adaptive Filtering and Scene Change Detection ##
#
# ( 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:

ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf > 2.5 ? asharp( -(fmin((nf/35), 1)), 0 ) :
\ TemporalSoften(2,7,7,3,2) ")

#
# Scene change detection ( kwag ) - If a scene change is detected, we
# blur heavily. This affects the scene before and the one after the
# scene change, thus providing a softer transition for the encoder instead
# of a sharp "spike".
# If it's not a scene change, then we just blur dynamically, depending on
# the action.

ScriptClip("nf > scd_trigger ? asharp( -2,0) : asharp( -(fmin((nf/35), 1)), 0) ") #
#
#

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

#
#
## Functions ###

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

#
####
The bold line in the above script is giving me this error. Everytime
I use Moviestacker, it gives a message that the version of avisynth
has to be 2.0x and will not open my d2v file. What am I doing wrong?

-bp

rendalunit 06-06-2003 10:13 PM

Quote:

Originally Posted by black prince
Everytime
I use Moviestacker, it gives a message that the version of avisynth
has to be 2.0x and will not open my d2v file.

MovieStacker will open the .d2v if you hit "ignore" when the error window pops up.

Check to make sure that you've pointed the "Sampler" directory to the Sampler.dll for avisynth 2.5x in ToK.

ren

black prince 06-06-2003 10:27 PM

@ren,

Thanks, I tried ignor and it opened, I still can't figure out why this avs
script statement is causing an error?

Quote:

ScriptClip("nf > scd_trigger ? asharp( -2,0) : asharp( -(fmin((nf/35), 1)), 0) ") #
It's not recognizing "nf" for some reason and this is the latest script
cut and pasted from the Optimal Script Forum :roll: This function will
not execute due to the error :?:

-bp

ovg64 06-06-2003 10:52 PM

Quote:

Originally Posted by black prince
@ren,

Thanks, I tried ignor and it opened, I still can't figure out why this avs
script statement is causing an error?

Quote:

ScriptClip("nf > scd_trigger ? asharp( -2,0) : asharp( -(fmin((nf/35), 1)), 0) ") #
It's not recognizing "nf" for some reason and this is the latest script
cut and pasted from the Optimal Script Forum :roll: This function will
not execute due to the error :?:

-bp

Try this one as the script was updated today :!:

ScriptClip("nf > scd_trigger ? asharp( -2,0) : asharp(0,0) ")

kwag 06-06-2003 11:07 PM

Quote:

Originally Posted by ovg64

Try this one as the script was updated today :!:

ScriptClip("nf > scd_trigger ? asharp( -2,0) : asharp(0,0) ")

Thanks ovg :!:
I was going to mention that too :)

@Black Prince,
Update your complete script, your script is ancient.
"Ancient = >1 day" in KVCD terms :mrgreen:
Hopefully, the script is now very stable, and we can start doing some encodes 8)
At least for me it is :!:

-kwag

black prince 06-07-2003 11:11 AM

@Kwag,

Finished a complete backup of "Abandon". Movie time 98 minutes,
resolution 528x480, audio 128kb @44.1 khz, target size one 80 min CD.
Time to encode was ~11 hrs. Results, WOOOOOoooooooooWWWW 8O
Picture quality near DVD. :mrgreen: Filesize 776MB, Tok file prediction was perfect. :D
Small problems though, from 2 to 3 feet viewing 23" standard screen, Gibbs
visible and distracting. From 5 to 8+ feet, Gibbs barely noticable. Picture
is sharp and very clear. Color is vivid with no bleeding. In short, if you
didn't know it was KVCD, you would think it was DVD. I'm glad I switched
to avisynth 2.52 and hope a solution can be found for DCT and Gibbs
problems. :)

-bp

BTW, I did update my script and still kept getting the same error message
in the same line. My next step will be to delete the script and write the
same script from scratch. Some characters may be unprintable but are
being scaned as invalid.

kwag 06-07-2003 11:29 AM

Quote:

Originally Posted by black prince
Small problems though, from 2 to 3 feet viewing 23" standard screen, Gibbs
visible and distracting.

Hi bp,

It could be this particular source :!:
Have you tried another movie :?:
Maybe going to 704x480 reduces the Gibbs :idea:
On my "Red Planet" encode, there are barely any Gibbs", and that movie is ~1:46 long 8O :D

-kwag

jorel 06-07-2003 12:38 PM

:)

after prediction,i got CQ 61,54 in 480x480,
and got only CQ 40,61 in 704x480.

of course is the new wonderfull script that give
the better quality in all my samples..... :wink:

after read some posts here,i see that everyone got
more or less CQ66 with 704x480. 8O

my source is dvd with 88 minutes and i never
got more than CQ 40 with 704x480 size! :(

can anyone help me to find what is wrong,
if have some wrong?
i can't believe why i got few CQ from this resolutions.
:?:

the quality in 480x480 is good and i try to make the first
with 704 but with this little prediction,i can't.

all help will be fantastic,i see all samples from Kwag and
want to got the same.... :wink:

i did thousands times the prediction and got
all CQs under 40 or 42 max for full movie 88 minutes,
audio 128 source Resolution (fps):704x480 (29,970 fps)

h e l p ... :(
thanks.

ps:
athlon xp+2000,512mbram,60gb maxtor 7200,
avisynth252,all new filters and last new script.

kwag 06-07-2003 12:57 PM

@Black Prince ( and all! ),

I just did a quick test, by changing the motion estimation to "Fast" in TMPEG, and there are CLEARLY less Gibbs. Maybe with the new adaptive method of filtering, we can use this motion estimation, and even though the CQ might be slightly smaller than with "High Quality" estimation, the final quality will be better :idea:

Edit: I just did two encodes with ToK. One with "High quality" and another with "Fast"

Here are the results:

http://www.kvcd.net/red-planet-sampl...on-cq62.70.mpg
http://www.kvcd.net/red-planet-sampl...y-cq63.031.mpg

I can clearly see less Gibbs with motion estimation set to "Fast".
If you want to try this with ToK, change the line in the file "video.en1" that reads:

Job.MPEG.Video.MotionSearchSpeed=MPEGVideoEncoder_ MotionSearchSpeed_Slow

To:
Job.MPEG.Video.MotionSearchSpeed=MPEGVideoEncoder_MotionSearchSpeed_MotionEstimate

Not to mention that the encoding speed is now a rocket :)

-kwag

kwag 06-07-2003 01:00 PM

Hi jorel,

Are you using ToK or DVD2SVCD to calculate your CQ :?:

-kwag

jorel 06-07-2003 01:09 PM

Quote:

Originally Posted by kwag
Hi jorel,

Are you using ToK or DVD2SVCD to calculate your CQ :?:

-kwag

i'm using the best dear friend,
ToK of course :!:


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