Quantcast Avisynth: Motion Adaptive Filtering Now Possible? - Page 22 - digitalFAQ.com Forums [Archives]
Go Back    digitalFAQ.com Forums [Archives] > Video Production Forums > Avisynth Scripting

Reply
 
LinkBack Thread Tools
  #421  
06-07-2003, 01:24 PM
vhelp vhelp is offline
Free Member
 
Join Date: Jan 2003
Posts: 1,009
Thanks: 0
Thanked 0 Times in 0 Posts
Hi all..

Ok, I'm finally bustin in here.. ben quiet for far too long hehe.. So, let me
start w/ an request if I may

@ BP..

Quote:
Picture quality near DVD. Filesize 776MB, Tok file prediction was perfect.
Small problems though, from 2 to 3 feet viewing 23" standard screen, Gibbs
Any chance on see those GIBs you were talking about on page 26 dude ??
A small 2 mb should do it, else maybe Kwag can do it for ya w/ your
script and movie.

I'm asking because I got an NEW monitor and I'm seeing things that I never
rally saw, in my encodes. So, it's an enlightment really. And, an aid or tool
too, cause I can fine-tune even more, certain areas in my encodes.

Basically, my LCD monitor is like a mini HDTV. Like, I've ben playing some
of my DVD's in PDVD, and am noticing things I can never see on a regular
CRT monitor (and TV set)

So, I'd like to use my LCD as a guage (maybe help you all out too) or tool
in fine-tuning encodes and things - pretty anal but a great idea if we are
serious in our altimate encoding quality !!

Hope you can help.
-vhelp
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #422  
06-07-2003, 01:27 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by vhelp
Any chance on see those GIBs you were talking about on page 26 dude ??
I just posted two samples
Reply With Quote
  #423  
06-07-2003, 01:43 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
@ Kwag


after my last post i try to find the prediction in ToK again using:

LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
LoadPlugin("C:\Filters25\undot.dll")
LoadPlugin("C:\Filters25\asharp.dll")
LoadPlugin("C:\Filters25\decomb.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")

MaxTreshold=1.50
scd_trigger=15
nf=0

Mpeg2Source("D:\La Luna\Segment2\DVD2AVI_PROJECT_FILE.d2v")
undot()
Limiter()
asharp(2,4)
FieldDeinterlace()
BicubicResize(688,464,0,0.6,0,0,712,480)
STMedianFilter(8,32,0,0)
MergeChroma(blur(MaxTreshold))
MergeChroma(blur(0.2))

ScriptClip("nf=YDifferenceToNext()"+chr(13)+"nf>2. 5?asharp(-(fmin((nf/35),1)),0):\
TemporalSoften(2,7,7,3,2)")
ScriptClip("nf>scd_trigger?asharp(-2,0):asharp(0,0)")
AddBorders(8,8,8,
Limiter()
function fmin(float f1,float f2){return(f1<f2)?f1:f2}

and got:
================================================== ===========
ToK Log: C:\Delete\01last.avs
================================================== ===========

Resolution (fps):704x480 (29,970 fps)
Total Frames: 159614
Total Time : 01:28:46
-------------------------------------------------------------

Audio Size: 85.216.000
Required Video Size: 726.644.160

Factor: 59,940
Desired Sample Size: 12.122.858

-------------------------------------------------------------
New Faster Prediction
-------------------------------------------------------------

Full Sample
Next CQ: 60,000. Sample Size: 16.971.001
Small Sample
Next CQ: 60,000. Sample Size: 1.648.270
Predicting...
Next CQ: 42,860. Sample Size: 13.055.615
Next CQ: 30,899. Sample Size: 11.562.205
Next CQ: 36,135. Sample Size: 12.610.961
Next CQ: 33,608. Sample Size: 11.766.030
Next CQ: 34,773. Sample Size: 11.770.684
Next CQ: 35,399. Sample Size: 12.132.690

Exit Condition: 1,000 % reached ! yahoo !
Tries : 7


Final CQ: 35,399
Total Time For Predicition: 00:13:50

Total Time (all operations): 00:13:50

Finished


do you see something wrong in the script?
i don't see,for me is perfect!
all the filters are new and avisynth252...


thanks for the hint ... "ToK MotionEstimate".
Reply With Quote
  #424  
06-07-2003, 01:52 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Hi jorel,

Maybe it's your 29.97fps movie you're trying to encode
Have you tried the script on a 23.976 Force FILM .d2v

-kwag
Reply With Quote
  #425  
06-07-2003, 02:01 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Here's a 19 second sample with motion estimation set to "Fast" and CQ set to 62.7 ( target for one CD, predicted with ToK ):
www.kvcd.net/red-planet-19second.mpg

-kwag
Reply With Quote
  #426  
06-07-2003, 02:25 PM
ovg64 ovg64 is offline
Free Member
 
Join Date: Jan 2003
Location: Puerto Rico
Posts: 423
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ovg64
Quote:
Originally Posted by kwag
Here's a 19 second sample with motion estimation set to "Fast" and CQ set to 62.7 ( target for one CD, predicted with ToK ):
www.kvcd.net/red-planet-19second.mpg

-kwag
Hey Kwag is that 704 or 528 cause i got that movie to encode,
I know it should fit in 1 cd sence is Letter Box and the hole movie is Dark.

Yes it brakes up Doesn't it Vhelp
Reply With Quote
  #427  
06-07-2003, 02:27 PM
vhelp vhelp is offline
Free Member
 
Join Date: Jan 2003
Posts: 1,009
Thanks: 0
Thanked 0 Times in 0 Posts
@ Kwag..

Sorry for late reply.

Yes, I D/L'ed both those sample

What I observed...
* http://www.kvcd.net/red-planet-sampl...on-cq62.70.mpg
your GIBS and patchy blocks.

What I liked...
* http://www.kvcd.net/red-planet-sampl...y-cq63.031.mpg
MUCH less gibs, but some patchy blocks*** still.

*** I have some things to talk about on this - short followup
comming.

Both clips looked much good, but the 2nd looked much better

-vhelp
PS: sorry, but my image fallups and your server got my timing wrong w/
each post - I've correct it w/ right order.
Reply With Quote
  #428  
06-07-2003, 02:34 PM
vhelp vhelp is offline
Free Member
 
Join Date: Jan 2003
Posts: 1,009
Thanks: 0
Thanked 0 Times in 0 Posts
@ Kwag..

warning..
Something happend to your clip (below) ..it's mostly garbled w/ artifacts.

* http://www.kvcd.net/red-planet-19second.mpg



I use paint-shop w/ Gamma set to 2.0 to give a better visual of what's
being seen. Sorry for the fallups w/ the image.

-vhelp
Reply With Quote
  #429  
06-07-2003, 02:52 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by vhelp
@ Kwag..

warning..
Something happend to your clip (below) ..it's mostly garbled w/ artifacts.
Thanks vhelp
I'm re-uploading now

Edit:
Done!. Just downloaded it to check it. It's ok now


-kwag
Reply With Quote
  #430  
06-07-2003, 03:03 PM
vhelp vhelp is offline
Free Member
 
Join Date: Jan 2003
Posts: 1,009
Thanks: 0
Thanked 0 Times in 0 Posts
@ Kwag..

it's raining very heavily here in NY (all day) So, we'll see how it comes out.
D/L'ing now.

I just love this new toy, LCD monitor. Some minor CONS about it, but
other than that, it's great - - yeah, my mini HDTV hehe..


-vhelp
PS: oh, i need a new keyboard.
Reply With Quote
  #431  
06-07-2003, 03:18 PM
Sagittaire Sagittaire is offline
Free Member
 
Join Date: May 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Ca makes a long time that I did not come on this forum and thus I does not know too much or are to you... But I post the new versions of my scripts

Script Detect Motion Filter

Quote:
################################################## ##############################

# AviSynth 2.52 #

# Script Motion Detection Filter YV12 02/06/03 #

################################################## ##############################


################################## Faq ... ##################################


# Plugin MPEG2Dec3.dll #
# Plugin Convolution3DYV12.dll #
# Plugin FluxSmooth.dll #

# Source : Path projet .d2v of DVD2AVI 1.76 #
# CPU_type : you will choose 5 for Pentium IV and 6 for the other processors #

# Threshold : adjustment of the threshold of detection of the scenes #

# Top : Crop top of the image #
# Left : Crop left of the image #
# Right : Crop right of the image #
# Bottom : Crop bottom of the image #

# DimX : Width of the image #
# DimY : Height of the image #

# Start : Start Frame #
# End : End Frame #



################################## Variables ###################################


Source = "C:\Stock\azerty.d2v"
CPU_type = 6

threshold_sm = 5
threshold_hm = 15

Left = 16
Top = 76
Right = 16
Bottom = 74

DimX = 640
DimY = 272

Start = 0
End = 0



############################### Script Principal ###############################


clip = Mpeg2Source( Source, idct = CPU_type)
clip = Trim( clip, Start, End)
clip = Crop( clip, Left, Top, -Right, -Bottom)
clip = DMF( clip, DimX, DimY, threshold_sm, threshold_hm)
clip = FluxSmooth( clip, 5, 3)
Return clip



################################## Fonctions ###################################


# Motion_Hight : function of filtering of fast scenes #

function Motion_Hight( clip Hight, float X, float Y)

{

Hight = Convolution3D( Hight, 0, 12, 16, 3, 4, 3, 0)
Hight = BicubicResize( Hight, X, Y, 0.33, 0.33)
Return Hight

}



# Motion_Medium : function of filtering of Mediums scenes #

function Motion_Medium( clip Medium, float X, float Y)

{

Medium = Convolution3D( Medium, 0, 6, 8, 6, 8, 3, 0)
Medium = BicubicResize( Medium, X, Y, 0, 0.5)
Return Medium

}



# Motion_Slow : function of filtering of Slow scenes #

function Motion_Slow( clip Slow, float X, float Y)

{

Slow = Convolution3D( Slow, 0, 3, 4, 12, 16, 3, 0)
Slow = BicubicResize( Slow, X, Y, 0, 0.7)
Return Slow

}



# Detect_Motion : function of detection of scenes slow, medium and rapid #

function Detect_Motion( clip detect, clip Slow, clip Medium, clip Hight, float threshold_sm, float threshold_hm)

{

global detect = detect

output1 = Conditionalfilter( detect , Slow, Medium, "diff_Previous", "<", "threshold_sm", false)

output2 = Conditionalfilter( detect , output1, Medium, "diff_Next", "<", "threshold_sm", false)

output3 = Conditionalfilter( detect , Hight, output2, "diff_Previous", ">", "threshold_hm", false)

output4 = Conditionalfilter( detect , output3, output2, "diff_Next", ">", "threshold_hm", false)

output4 = frameevaluate( output4, "diff_Previous = YDifferenceFromPrevious( detect ) + UDifferenceFromPrevious( detect ) + VDifferenceFromPrevious( detect )")

output4 = frameevaluate( output4, "diff_Next = YDifferenceToNext( detect ) + UDifferenceToNext( detect ) + VDifferenceToNext( detect )")


return output4

}



# DMF : function of filtage of scenes slow, medium and rapid #

function DMF( clip filter, float X, float Y, float threshold_sm, float threshold_hm)

{

filter = ConvertToYV12( filter)

Slow = Motion_Slow( filter, X, Y)
Medium = Motion_Medium( filter, X, Y)
Hight = Motion_Hight( filter, X, Y)

output = Detect_Motion( filter, Slow, Medium, Hight, threshold_sm, threshold_hm)

return output

}

################################################## ##############################
Script ZodiaqueSoften


Quote:
################################################## ##############################

# AviSynth 2.52 #

# Script ZodiaqueSoften YV12 2/06/03 #

################################################## ##############################


################################## Faq ... ##################################


# MPEG2Dec3.dll #

# Source : Path projet .d2v of DVD2AVI 1.76 #
# CPU_type : you will choose 5 for Pentium IV and 6 for the other processors #
# Motion_Type : choose 1 for light, 2 for medium and 4 for strong filtering #

# Top : Crop top of the image #
# Left : Crop left of the image #
# Right : Crop right of the image #
# Bottom : Crop bottom of the image #

# DimX : Width of the image #
# DimY : Height of the image #

# Start : Start Frame #
# End : End Frame #



################################## Variables ###################################


Source = "C:\Stock\azerty.d2v"
global CPU_type = 6

global Motion_Type = 1

global Left = 16
global Top = 76
global Right = 16
global Bottom = 74

global DimX = 640
global DimY = 272

global Start = 0
global End = 0


############################### Script Principal ###############################


clip = Mpeg2Source( Source, idct = CPU_type)
clip = Trim( clip, Start, End)
clip = crop( clip, Left,Top, -Right, -Bottom)
clip = ZodiaqueSoften( clip)
clip = bicubicResize( clip, DimX, DimY, 0, 0.5)
Return clip



################################## Fonctions ###################################


# ZodiaqueSoften : function of adaptatif motion filter #

function ZodiaqueSoften( clip video)

{

global video = ConvertToYV12( video)

video = scriptclip( video,"filter_Motion( video, Threshold_Y, Threshold_UV)")

video = frameevaluate( video, "Threshold_Y = ( 0.5*YDifferenceFromPrevious( video.trim( 1, 0)) + 0.5*YDifferenceToNext( video.trim( 1, 0)))")

video = frameevaluate( video, "Threshold_UV = ( 0.25*UDifferenceFromPrevious( video.trim( 1, 0)) + 0.25*VDifferenceFromPrevious( video.trim( 1, 0)) + 0.25*UDifferenceToNext( video.trim( 1, 0)) + 0.25*VDifferenceToNext( video.trim( 1, 0)))")

return video

}


function filter_Motion( clip filter, float Threshold_Y, float Threshold_UV)

{

Temporel_Y = Int( 10* Exp( -0.30* Threshold_Y))

Temporel_UV = Int( 15* Exp( -0.90* Threshold_UV))

Spacial_Y = Int( 20*( 1 - Exp( -0.050* Threshold_Y)))

Spacial_UV = Int( 25*( 1 - Exp( -0.150* Threshold_UV)))

filter = ConvertToYUY2( filter)
filter = TemporalSoften( filter, Motion_Type, Temporel_Y, Temporel_UV, mode=2)
filter = SpatialSoften( filter, Motion_Type, Spacial_Y, Spacial_UV)
filter = ConvertToYV12( filter)

return filter

}


################################################## ##############################
__________________
Le Sagittaire
--------------------
Inutile de discuter avec moi ... j'ai toujours raison ... en tous cas j'en suis convaincu et c'est le principal ...
Reply With Quote
  #432  
06-07-2003, 03:18 PM
vhelp vhelp is offline
Free Member
 
Join Date: Jan 2003
Posts: 1,009
Thanks: 0
Thanked 0 Times in 0 Posts
@ Kwag..

clip.. A.OK. Much better !!

Ok, some things to note (or theories)...

* When clip(s) are played under vdub, quality is outstanding. I theorise that
it's either playing these MPEG clips in YV12 color space, OR, 4:2:2 space.

* When clip(s) are played under PDVD, quality is ok.. probably due to
the 4:2:0 space and monitor (weather LCD or CRT, as it doesn't matter in
this case) I do think that it does play w/ better quality once burned to CDR
and played DVD and TV.

Now, I recall reading a discussion on DVD's MPEG color space.. that it's
sampled at YV12 natively or something. I don't recall the exact explanaa,
but to that effect.

Now, give the above, theories, I think that once we re-encode these to
MPEG's, we up obviously changing the color space. Somehow, these soft.
encoders are altering the color space OR, the software players are at fault,
hence vdub's great quality vs. PDVD's poorer or not-so-great

It would be interesting to note how vdub is using color space per say.. and
how come, PDVD does not use this same codec during play. Perhaps, it's
something to do w/ how PDVD utilizes the OVERLAY vs. vdub use of RGB.
Would be nice if you could set PDVD to use RGB and NOT OVERLAY.

Any thoughts ?? anyone ??
-vhelp
Reply With Quote
  #433  
06-07-2003, 03:20 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
I believe most of the dream I proposed back in February became a reality with this script
http://www.kvcd.net/forum/viewtopic.php?t=2834

-kwag
Reply With Quote
  #434  
06-07-2003, 07:39 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
@jorel,

I had the same problem with low CQ for any resolution from Tok until
I removed all avisynth versions and their registry links. I re-installed
avisynth v2.52 by itself and Tok started giving me CQ's in the 60 to
70+ range. Of course, picture quality jumped to execellent. Give this
a try

-bp
Reply With Quote
  #435  
06-07-2003, 09:48 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by black prince
@jorel,

I had the same problem with low CQ for any resolution from Tok until
I removed all avisynth versions and their registry links. I re-installed
avisynth v2.52 by itself and Tok started giving me CQ's in the 60 to
70+ range. Of course, picture quality jumped to execellent. Give this
a try

-bp


@ black prince!
did you only deinstall and install again or some more like
edit the registry,give me the hints my friend.
i remember in this thread you talking about this problem.

i'm unistall and reinstall again the 252 to see what happen.
some more hints please bp.
thanks in advance!
Reply With Quote
  #436  
06-07-2003, 11:36 PM
ovg64 ovg64 is offline
Free Member
 
Join Date: Jan 2003
Location: Puerto Rico
Posts: 423
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ovg64
Hey Jo editing the register is a becarefull thing, I suggest you use
a program like Norton Win Doctor if you going to do that Unless
you are a pro, but it does help when you clean the sucker from
programs you dont have anymore.
Reply With Quote
  #437  
06-08-2003, 08:36 AM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by ovg64
Hey Jo editing the register is a becarefull thing, I suggest you use
a program like Norton Win Doctor if you going to do that Unless
you are a pro, but it does help when you clean the sucker from
programs you dont have anymore.
ok ovg64,

a few months ago i was using norton system works and cleansweep,
now i'm using evidence eliminator.
after unistall, i search trying to find avisynth.dll
in the system and the file isn't found no more.
now i'm installing again and finding a new prediction.
maybe i can get more CQ, if don't i call for
my secret weapon..... black prince help and you all.



edited:
i got with 704x480 Final CQ: 31,768
and with 480x480 Final CQ: 56,656

bp,Kwag and all... help me please.
still got low CQ.
Reply With Quote
  #438  
06-08-2003, 09:04 AM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
@jorel,

I use ace utilities to clean the registry for links that remain after uninstalling
programs, deleting files, etc. This utility has 5 small programs that do
do a great job cleaning your HD of temp files, recycle bin, registry, etc.
Your can find a trial version (30 days) of ace utilities at download.com. Next, I
compress or defrag the registry using a batch file with the command
"scanreg /fix" written in it. This is a windows 9x/me program that creates
a backup of the registry and then compresses it. This program will restart
you computer. I defrag my HD with Diskeeper 7.0. It's fast and very good.
I also us a free anti-virus program, AVG anti-virus, at grisoft.com that has
automatic updates free and protect your HD in DOS and/or Windows. That
means if a virus won't allow you to enter Windows, it has a DOS program
to remove it. Both DOS and Windows are automatically updated. My
system runs like the first install after I perform these tune-ups

-bp

BTW, If anyone has some great system-tune programs, let us know.
Reply With Quote
  #439  
06-08-2003, 09:18 AM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
@Kwag,

Changing Tmpgenc's motion search to fast made a much better improve-
ment in Gibbs and picture quality. I'm doing some more testing for how
well this script acts when the target filesize is one CD (80 minute) and
the movie is 2+ hours long. I also want to see if UnDot() is really making
a difference in picture quality. It's suppose to improve Gibbs if the source
has this problem to begin with. More testing with this script and we can
determine some reasonable limits for which resolutions are recommended
for movie lengths, type of movie (action vs drama, etc). There will be
more tweaks and enhancements with this for sometime to come

-bp
Reply With Quote
  #440  
06-08-2003, 09:42 AM
vhelp vhelp is offline
Free Member
 
Join Date: Jan 2003
Posts: 1,009
Thanks: 0
Thanked 0 Times in 0 Posts
@ all..

Hi guys !! I'm back, and I got my IVTC (via new decomb for AVIsynth v2.52) working in my finally installed AVIsynth v2.52 machine hehe
I haven't fully tested it, but I'm going to assume that I will have similar
results w/ my prevous decomb for v2x. It took a full days sillyness to get
where I am today Anyways..

@ bp..
can you elaborate on what Gibbs actaully look like. I have a feeling I know
what you are talking about, but to be quite honest w/ ya, I missed the boat
when this was started. Can you provide a picture detailing these Gibbs ??
I would really appreciate it, so that I can better refer to scenes w/ Gibbs
more accurately.

Now, if I think I know what you are talking about in Gibbs, and what I have
ben working on this weekend, IS in fact Gibbs, I may or may not have a
working (requires tweaking per Movie) few steps. I ran lots of tests last
night, and finally burned a cdrw and tested it on my 13" tv. And, they seemed
to look ok, however, on my mini HDTV (I mean) LCD screen, I did notice
the quality (less Gibbs) during play via PDVD (color set to "0")

Thanks for your help.
-vhelp
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Dynamic Linear Adaptive Filtering and Scene Change Detection supermule Avisynth Scripting 3 09-15-2006 01:45 AM
Avisynth: Message from linear motion adaptive filtering? holgerschlegel Avisynth Scripting 7 08-27-2003 04:08 AM
Avisynth: Help with Linear Motion Adaptive Filtering pitoman Avisynth Scripting 2 08-05-2003 12:51 PM
Avisynth: Motion adaptive filtering good enough? bicho_visacoso Avisynth Scripting 6 06-15-2003 06:30 AM
Avisynth: AVS 2.5x Script, Motion Adaptive Filtering problems? Bchteam Avisynth Scripting 15 05-31-2003 12:38 PM




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