Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 8th September 2003, 00:16   #1  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Sep 3 build and QMF - Problem Report

Sh0dan, The sep03 build seems to be interacting with the QMF script by HomiE FR and producing what seems
to be multiple scriptclip error lines overlayed upon themselves. Because of this I can not give you
the exact overlay error message. But, this simple example below (top script) will import the QMF script (bottom script)
and should provide you with a replicatable example.

Code:
mpeg2source("YourPath\yours.d2v")
Import("YourPath\qmf15b1.avs")
function Low_Motion_Filter(clip c) { c = FluxSmooth(c,14,0) c = UnFilter(c,-10,-10) return c }
function Medium_Motion_Filter(clip c) { c = FluxSmooth(c,7,7) c = UnFilter(c,-20,-20) return c }
function High_Motion_Filter(clip c) { c = FluxSmooth(c,0,14) c = UnFilter(c,-30,-30) return c }
QMF()
Code:
# QUANTIFIED MOTION FILTER v1.5 b1 (10/07/2003) by HomiE FR (homie.fr@wanadoo.fr)

# MOTION ESTIMATION FUNCTION
function ME()
{
  # SETTING SCENE CHANGE THRESHOLD ACCORDING TO MOTION LEVEL
  global threshold_sc = (motion_level == 0) ? threshold_sc_lm : threshold_sc
  global threshold_sc = (motion_level == 1) ? threshold_sc_mm : threshold_sc
  global threshold_sc = (motion_level == 2) ? threshold_sc_hm : threshold_sc

  # UPDATING SCENE CHANGE POSITION
  global pos_sc = (pos_sc > 0 && pos_sc < distance_sc_min) ? (pos_sc + 1) : 0
  global pos_sc = (diff_f2 > threshold_sc && pos_sc == 0) ? 1 : pos_sc

  # SELECTING USELESS FRAMES
  global ok_p2 = (pos_sc == 5 || pos_sc == 4 || pos_sc == 3) ? 0 : 1
  global ok_p1 = (pos_sc == 4 || pos_sc == 3) ? 0 : 1
  global ok = (pos_sc == 3) ? 0 : 1
  global ok_f1 = (pos_sc == 2) ? 0 : 1
  global ok_f2 = (pos_sc == 2 || pos_sc == 1) ? 0 : 1

  # DISCARDING USELESS FRAMES FROM AVERAGE DIFFERENCE COMPUTATION
  diff_p2_ok = diff_p2*ok_p2
  diff_p1_ok = diff_p1*ok_p1
  diff_ok = diff*ok
  diff_f1_ok = diff_f1*ok_f1
  diff_f2_ok = diff_f2*ok_f2

  # COMPUTING AVERAGE DIFFERENCE
  global diff_avg = (diff_ok + ti1*(diff_p1_ok+diff_f1_ok) + ti2*(diff_p2_ok+diff_f2_ok))/(ok + ti1*(ok_p1+ok_f1) + ti2*(ok_p2+ok_f2))

  # SETTING MOTION LEVEL ACCORDING TO AVERAGE DIFFERENCE
  global motion_level = (diff_avg < threshold_lm) ? 0 : motion_level
  global motion_level = (diff_avg >= threshold_lm && diff_avg <= threshold_hm) ? 1 : motion_level
  global motion_level = (diff_avg > threshold_hm) ? 2 : motion_level
}

# QUANTIFIED MOTION FILTER FUNCTION
function QMF(clip c,
           \ float "threshold_lm",float "threshold_hm",
           \ float "threshold_sc_lm",float "threshold_sc_mm",float "threshold_sc_hm",int "distance_sc_min",
           \ float "temporal_influence",bool "chroma",bool "debug")
{
  # SETTING CHROMA MOTION ESTIMATION
  chroma = default(chroma,false)
  global chroma = chroma

  # SETTING MOTION LEVELS THRESHOLDS
  threshold_lm = default(threshold_lm,(chroma == true) ? 4.0 : 5.0)
  threshold_hm = default(threshold_hm,(chroma == true) ? 12.0 : 15.0)
  global threshold_lm = threshold_lm
  global threshold_hm = threshold_hm

  # SETTING MIN/MAX SCENE CHANGE THRESHOLDS
  threshold_sc_lm = default(threshold_sc_lm,(chroma == true) ? 20.0 : 30.0)
  threshold_sc_mm = default(threshold_sc_mm,(chroma == true) ? 30.0 : 45.0)
  threshold_sc_hm = default(threshold_sc_hm,(chroma == true) ? 40.0 : 60.0)
  global threshold_sc_lm = threshold_sc_lm
  global threshold_sc_mm = threshold_sc_mm
  global threshold_sc_hm = threshold_sc_hm

  # SETTING MIN DISTANCE BETWEEN SCENE CHANGES
  distance_sc_min = default(distance_sc_min,10)
  global distance_sc_min = distance_sc_min

  # SETTING TEMPORAL INFLUENCE
  temporal_influence = default(temporal_influence,50.0)
  global temporal_influence = temporal_influence

  # ENABLING/DISABLING DEBUG INFORMATION
  debug = default(debug,false)
  global debug = debug

  # INITIALIZING MOTION LEVEL
  global motion_level = 0

  # INITIALIZING SCENE CHANGE THRESHOLD/SCENE CHANGE POSITION
  global threshold_sc = threshold_sc_lm
  global pos_sc = 0

  # INITIALIZING AVERAGE DIFFERENCE
  global diff_avg = 0.0

  # SETTING TEMPORAL RATIOS ACCORDING TO TEMPORAL INFLUENCE
  global ti1 = Pow(temporal_influence/100,0.50)
  global ti2 = Pow(temporal_influence/100,2.00)

  # ENABLING/DISABLING CHROMA DIFFERENCE INFORMATION
  global y_ratio = (chroma == true) ? 0.50 : 1.00
  global uv_ratio = (chroma == true) ? 0.50 : 0.00

  # SETTING PAST/PRESENT/FUTURE CLIPS
  global clip_p2 = Trim(c,0,-2)+c
  global clip_p1 = Trim(c,0,-1)+c
  global clip = c
  global clip_f1 = Trim(c,1,0)
  global clip_f2 = Trim(c,2,0)

  # GETTING OUTPUT RESOLUTION
  width = Width(Low_Motion_Filter(clip))
  height = Height(Low_Motion_Filter(clip))
  global clip_resized = PointResize(clip,width,height)

  # APPLYING MOTION FILTER ACCORDING TO MOTION LEVEL
  c = ConditionalFilter(c,Low_Motion_Filter(clip),clip_resized,"motion_level","=","0")
  c = ConditionalFilter(c,Medium_Motion_Filter(clip),c,"motion_level","=","1")
  c = ConditionalFilter(c,High_Motion_Filter(clip),c,"motion_level","=","2")

  # PRINTING DEBUG INFORMATION
  c = (debug == true) ? ScriptClip(c,"Debug()") : c

  # GETTING MOTION LEVEL THROUGH MOTION ESTIMATION
  c = FrameEvaluate(c,"ME()")

  # GETTING DIFFERENCES BETWEEN PAST/PRESENT/FUTURE FRAMES
  c = FrameEvaluate(c,"global diff_f2 = y_ratio*YDifferenceFromPrevious(clip_f2) + uv_ratio*UDifferenceFromPrevious(clip_f2) + uv_ratio*VDifferenceFromPrevious(clip_f2)")
  c = FrameEvaluate(c,"global diff_f1 = y_ratio*YDifferenceFromPrevious(clip_f1) + uv_ratio*UDifferenceFromPrevious(clip_f1) + uv_ratio*VDifferenceFromPrevious(clip_f1)")
  c = FrameEvaluate(c,"global diff = y_ratio*YDifferenceFromPrevious(clip) + uv_ratio*UDifferenceFromPrevious(clip) + uv_ratio*VDifferenceFromPrevious(clip)")
  c = FrameEvaluate(c,"global diff_p1 = y_ratio*YDifferenceFromPrevious(clip_p1) + uv_ratio*UDifferenceFromPrevious(clip_p1) + uv_ratio*VDifferenceFromPrevious(clip_p1)")
  c = FrameEvaluate(c,"global diff_p2 = y_ratio*YDifferenceFromPrevious(clip_p2) + uv_ratio*UDifferenceFromPrevious(clip_p2) + uv_ratio*VDifferenceFromPrevious(clip_p2)")

  return c
}

# DEBUG INFORMATION FUNCTION
function Debug(clip c)
{
  # PRINTING VERSION INFORMATION
  c = Subtitle(c,"Quantified Motion Filter v1.5 b1",x=20,y=30,font="lucida console",size=18,text_color=$FFFFFF)
  c = Subtitle(c,"by HomiE FR (homie.fr@wanadoo.fr)",x=20,y=45,font="lucida console",size=14,text_color=$FFFFFF)

  # PRINTING MOTION ESTIMATION INFORMATION
  c = Subtitle(c,"motion estimation",x=20,y=75,font="lucida console",size=18,text_color=$FFFFFF)
  c = Subtitle(c,"diff_p2  = "+string(diff_p2),x=20,y=95,font="lucida console",size=16,text_color=$FFCCCC)
  c = (ok_p2 == 0) ? Subtitle(c,"[discarded]",x=230,y=95,font="lucida console",size=16,text_color=$FFFF66) : c
  c = Subtitle(c,"diff_p1  = "+string(diff_p1),x=20,y=110,font="lucida console",size=16,text_color=$FFCCCC)
  c = (ok_p1 == 0) ? Subtitle(c,"[discarded]",x=230,y=110,font="lucida console",size=16,text_color=$FFFF66) : c
  c = Subtitle(c,"diff     = "+string(diff),x=20,y=125,font="lucida console",size=16,text_color=$FFCCCC)
  c = (ok == 0)    ? Subtitle(c,"[discarded]",x=230,y=125,font="lucida console",size=16,text_color=$FFFF66) : c
  c = Subtitle(c,"diff_f1  = "+string(diff_f1),x=20,y=140,font="lucida console",size=16,text_color=$FFCCCC)
  c = (ok_f1 == 0) ? Subtitle(c,"[discarded]",x=230,y=140,font="lucida console",size=16,text_color=$FFFF66) : c
  c = Subtitle(c,"diff_f2  = "+string(diff_f2),x=20,y=155,font="lucida console",size=16,text_color=$FFCCCC)
  c = (ok_f2 == 0) ? Subtitle(c,"[discarded]",x=230,y=155,font="lucida console",size=16,text_color=$FFFF66) : c
  c = Subtitle(c,"diff_avg = "+string(diff_avg),x=20,y=170,font="lucida console",size=16,text_color=$FF6666)

  # PRINTING SCENE CHANGE DETECTION INFORMATION
  c = Subtitle(c,"scene change detection",x=20,y=200,font="lucida console",size=18,text_color=$FFFFFF)
  c = Subtitle(c,"threshold_sc = "+string(threshold_sc),x=20,y=220,font="lucida console",size=16,text_color=$CCCCFF)
  c = (pos_sc == 0) ? Subtitle(c,"detection    = enabled",x=20,y=235,font="lucida console",size=16,text_color=$CCCCFF) : Subtitle(c,"detection    = disabled",x=20,y=235,font="lucida console",size=16,text_color=$CCCCFF)
  c = (ok_p2+ok_p1+ok+ok_f1+ok_f2 == 5) ? Subtitle(c,"information  = scanning...",x=20,y=250,font="lucida console",size=16,text_color=$9999FF) : Subtitle(c,"information  = scene change !",x=20,y=250,font="lucida console",size=16,text_color=$9999FF)

  # PRINTING QUANTIFIED MOTION FILTER INFORMATION
  c = Subtitle(c,"quantified motion filter",x=20,y=280,font="lucida console",size=18,text_color=$FFFFFF)
  c = (motion_level == 0) ? Subtitle(c,"scene type = low motion",x=20,y=300,font="lucida console",size=16,text_color=$66FF66) : c
  c = (motion_level == 1) ? Subtitle(c,"scene type = medium motion",x=20,y=300,font="lucida console",size=16,text_color=$66FF66) : c
  c = (motion_level == 2) ? Subtitle(c,"scene type = high motion",x=20,y=300,font="lucida console",size=16,text_color=$66FF66) : c

  return c
}

Last edited by DDogg; 8th September 2003 at 22:08.
DDogg is offline   Reply With Quote
Old 8th September 2003, 06:55   #2  |  Link
HomiE FR
Registered User
 
Join Date: Jul 2002
Location: France
Posts: 140
Hi DDogg!

No, I didn't abandon this topic, but I have to look deeper at the scripts since I have forgotten some of the details of FMF.

I haven't installed Sept 3rd Avisynth build yet. I'll do some tests today and I'll post the results this evening. Thanks again for showing your interest!
HomiE FR is offline   Reply With Quote
Old 8th September 2003, 21:22   #3  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
HomiE FR, Sh0dan, the reason I reported this is because it did work fine with the August 20 build so I think that ruled out the math changes as the culprit. This script is just too complex for me to debug.

Sh0dan, speaking of reports of this type in the future, would you prefer them in devel or user?
DDogg is offline   Reply With Quote
Old 8th September 2003, 21:38   #4  |  Link
Wilbert
Super Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,375
Two remarks (maybe of no use):

1) FluxSmooth(14,0) still smooths temporally. If you want to disable that, use: FluxSmooth(14,-1). Likewise use FluxSmooth(-1,14) instead of FluxSmooth(0,14).

2) I hope your script looked like this:

mpeg2source("YourPath/yours.d2v")
Import("YourPath/qmf15b1.avs")
function Low_Motion_Filter(clip c)
{
c = FluxSmooth(c,14,0)
c = UnFilter(c,-10,-10)
return c
}
function Medium_Motion_Filter(clip c)
{
c = FluxSmooth(c,7,7)
c = UnFilter(c,-20,-20)
return c
}
function High_Motion_Filter(clip c)
{
c = FluxSmooth(c,0,14)
c = UnFilter(c,-30,-30)
return c
}
QMF()
Wilbert is offline   Reply With Quote
Old 8th September 2003, 22:21   #5  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
1> Thanks for that correction. I am using the HomiE FR's example script so perhaps he might need to change it.
2> Yes, the original example did look like that so I suppose you mean that functions can not exist on one line? I was under the impression a function could be on one line as I have seen other examples of this.

Certainly no errors are thrown and it seemed to be working correctly with the Aug 20 build, although there is a lot of assuming happening on my part, but will not as soon as I flip my avisynth.dll to the sep03 version. Did I misunderstand your meaning?

Wilbert, you know that I know diddle all about functions except to copy and paste them :-)
DDogg is offline   Reply With Quote
Old 8th September 2003, 22:29   #6  |  Link
Wilbert
Super Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,375
Quote:
2> Yes, the original example did look like that so I suppose you mean that functions can not exist on one line? I was under the impression a function could be on one line as I have seen other examples of this.
No, that doesn't work. Are you saying that works with the 20 Aug. build?

I tried the simple variant of Homie's script: http://www.avisynth.org/index.php?pa...ditionalFilter (last example, without resizing). I don't have problems with that example, and the 3 Sept. build of AviSynth. Does that one work for you?
Wilbert is offline   Reply With Quote
Old 8th September 2003, 22:34   #7  |  Link
AlphaDivxMovies
Registered User
 
Join Date: Sep 2002
Posts: 34
This is the script i usually use for medium noise sources,
it seems to work with the latest avisynth build.

#SET FUNCTION VALUES
SetMemoryMax(40)
PluginPath ="C:\MAINUS~1\MULTIM~1\Video\GKnot\"

#SET PLUGINS
LoadPlugin("C:\MAINUS~1\MULTIM~1\Video\GKnot\MPEG2Dec3.dll")
LoadPlugin("C:\MAINUS~1\MULTIM~1\Video\GKnot\Fluxsmooth.dll")
LoadPlugin("C:\MAINUS~1\MULTIM~1\Video\GKnot\UNDOT.dll")
LoadPlugin("C:\MAINUS~1\MULTIM~1\Video\GKnot\Asharp.dll")
LoadPlugin("C:\MAINUS~1\MULTIM~1\Video\GKnot\Blockbuster.dll")
LoadPlugin("C:\MAINUS~1\MULTIM~1\Video\GKnot\Mipsmooth.dll")

# LOADING QMF SCRIPT
Import("C:\MAINUS~1\MULTIM~1\Video\GKnot\qmf-1.5b1.avs")

# LOW MOTION FILTER FUNCTION
# -> STRONG TEMPORAL SMOOTHING (USING FLUXSMOOTH)
function Low_Motion_Filter(clip c)
{

c = Fluxsmooth(c,7,-1)

return c
}

# MEDIUM MOTION FILTER FUNCTION
# -> MEDIUM TEMPORAL SMOOTHING (USING FLUXSMOOTH)
# -> MEDIUM SPATIAL SMOOTHING (USING FLUXSMOOTH)
function Medium_Motion_Filter(clip c)
{

c = Fluxsmooth(c,5,3)

return c
}

# HIGH MOTION FILTER FUNCTION
# -> NO TEMPORAL SMOOTHING
# -> STRONG SPATIAL SMOOTHING (USING FLUXSMOOTH)
function High_Motion_Filter(clip c)
{

c = Fluxsmooth(c,-1,7)

return c
}

# OPENING VIDEO SOURCE
MPEG2Source("E:\DVD Ripping Layouts\The Deep End\THE_DEEP_END\DeepEnd.d2v",cpu=4,iDCT=7)

# TWEAKING IMAGE PROPERTIES
Lumafilter()

# CROPPING AND CUTTING THE VIDEO SOURCE
crop(0,74,718,432,align=true)

# APPLY STRAY PIXEL REMOVAL USING UNDOT
Undot()

# APPLYING MOTION BASED ADAPTATIVE SPATIO-TEMPORAL SMOOTHER (USING QMF WITH FLUXSMOOTH)
QMF()
MIPSMOOTH()

# SHARPENING OR BLURING
Asharp(1,2,-1,true)
Blockbuster(method="noise",detail_min=1,detail_max=10,variance=0.5,seed=5823)

# RESIZING VIDEO CLIP
LanczosResize(672,272)


# TWEAKING BRIGHTNESS AND OTHER PROPERPTIES
limiter(16,235)

Last edited by AlphaDivxMovies; 8th September 2003 at 22:37.
AlphaDivxMovies is offline   Reply With Quote
Old 8th September 2003, 22:38   #8  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Quote:
No, that doesn't work. Are you saying that works with the 20 Aug. build?
Yes it did seem to work, or at least it did not throw any errors, either red on blacks or scriptclip overlay errors. I'll go back and double check with your corrections on the Sep 3 build.

This exact script does not have any errors generated with the Aug20 build:
Code:
mpeg2source("C:\rings\DVD2AVI_PROJECT_FILE.d2v")
Import("C:\Program Files\AviSynth 2.5\plugins\QMF\qmf15b1.avs")
function Low_Motion_Filter(clip c) { c = FluxSmooth(c,14,-1) c = UnFilter(c,-10,-10) return c }
function Medium_Motion_Filter(clip c) { c = FluxSmooth(c,7,7) c = UnFilter(c,-20,-20) return c }
function High_Motion_Filter(clip c) { c = FluxSmooth(c,-1,14) c = UnFilter(c,-30,-30) return c }
QMF()
With the Sep3 build, both the script above and yours, below, have the same errors.
Code:
mpeg2source("C:\rings\DVD2AVI_PROJECT_FILE.d2v")
Import("C:\Program Files\AviSynth 2.5\plugins\QMF\qmf15b1.avs")
function Low_Motion_Filter(clip c) 
{ 
c = FluxSmooth(c,14,-1) 
c = UnFilter(c,-10,-10) 
return c
}
function Medium_Motion_Filter(clip c) 
{
c = FluxSmooth(c,7,7) 
c = UnFilter(c,-20,-20) 
return c 
}
function High_Motion_Filter(clip c) 
{ 
c = FluxSmooth(c,-1,14) 
c = UnFilter(c,-30,-30) 
return c 
}
QMF()

Last edited by DDogg; 8th September 2003 at 22:56.
DDogg is offline   Reply With Quote
Old 8th September 2003, 22:45   #9  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Quote:
Originally posted by DDogg
Sh0dan, speaking of reports of this type in the future, would you prefer them in devel or user?
Since this could be development related it's fine to post it here - this is probably also where it would get most developer/superuser attention (due to the higher traffic in usage). I wont move borderline topics around since they are so closely related.

Haven't had a chance to look at it yet. Since the math change there hasn't been anything generic changed, so it's probably a "trivial" bug. But I'll look into it ASAP.

I have however experienced some strange behaviour with the latest binary in some cases, so you might want to stick with your older version anyway.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 8th September 2003, 23:38   #10  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Wilbert, yes, I did try the versions from the doc with minimal changes and they also generated the errors.
Code:
# LOADING QUANTIFIED MOTION FILTER SCRIPT
Import("C:\rings\wilbertqmf.avs")

# LOW MOTION FILTER FUNCTION
# -> SHARP RESIZING + TEMPORAL ONLY
function Low_Motion_Filter(clip c)
{
  c = TemporalCleaner(c, 5, 10)
  c = LanczosResize(c, 512, 272)
  return c
}

# MEDIUM MOTION FILTER FUNCTION
# -> NEUTRAL BICUBIC RESIZING + TEMPORAL & SPATIAL
function Medium_Motion_Filter(clip c)
{
  c = FluxSmooth(c, 7, 7)
  c = BicubicResize(c, 512, 272, 0.00, 0.50)
  return c
}

# HIGH MOTION FILTER FUNCTION
# -> SOFT RESIZING + SPATIAL ONLY
function High_Motion_Filter(clip c)
{
  c = FluxSmooth(c, -1, 14)
  c = UnFilter(c, -30, -30)
  c = BilinearResize(c, 512, 272)
  return c
}

# OPENING VIDEO SOURCE
mpeg2source("C:\rings\DVD2AVI_PROJECT_FILE.d2v")
ConvertToYV12(interlaced=false)

# APPLYING ADAPTATIVE RESIZING FILTER (USING QMF)
QMF()
Code:
# QUANTIFIED MOTION FILTER (17/08/2003) by HomiE FR (homie.fr@wanadoo.fr)
# MOTION ESTIMATION FUNCTION
function ME()
{
  # SETTING MOTION LEVEL ACCORDING TO AVERAGE DIFFERENCE [1]
  global motion_level = (diff < threshold_lm) ? 0 : motion_level
  global motion_level = (diff >= threshold_lm && diff <= threshold_hm) ? 1 : motion_level
  global motion_level = (diff > threshold_hm) ? 2 : motion_level
}

# QUANTIFIED MOTION FILTER FUNCTION
function QMF(clip c, float "threshold_lm", float "threshold_hm", bool "debug")
{
  # SETTING MOTION LEVELS THRESHOLDS [2]
  threshold_lm = default(threshold_lm, 4.0)
  threshold_hm = default(threshold_hm, 12.0)
  global threshold_lm = threshold_lm
  global threshold_hm = threshold_hm
  # ENABLING/DISABLING DEBUG INFORMATION [3]
  debug = default(debug, false)

  # SETTING PRESENT CLIP [4]
  global clip = c
  # GETTING OUTPUT RESOLUTION [5]
  width = Width(Low_Motion_Filter(c))
  height = Height(Low_Motion_Filter(c))
  global c_resized = PointResize(c, width, height)
  # APPLYING MOTION FILTER ACCORDING TO MOTION LEVEL [6]
  c = ConditionalFilter(c, Low_Motion_Filter(c), c_resized, "motion_level", "=", "0")  # [6a]
  c = ConditionalFilter(c, Medium_Motion_Filter(c), c, "motion_level", "=", "1")       # [6b]
  c = ConditionalFilter(c, High_Motion_Filter(c), c, "motion_level", "=", "2")         # [6c]
  # PRINTING DEBUG INFORMATION [7]
  c = (debug == true) ? ScriptClip(c, "Debug()") : c
  # GETTING MOTION LEVEL THROUGH MOTION ESTIMATION [8]
  c = FrameEvaluate(c, "ME()")
  # GETTING DIFFERENCES BETWEEN PAST/PRESENT FRAMES [9]
  c = FrameEvaluate(c, "global diff = 0.50*YDifferenceFromPrevious(clip) + 0.25*UDifferenceFromPrevious(clip) + 0.25*VDifferenceFromPrevious(clip)")
  return c
}

# DEBUG INFORMATION FUNCTION
function Debug(clip c)
{
  # PRINTING VERSION INFORMATION [10]
  c = Subtitle(c, "Quantified Motion Filter", x=20, y=30, font="lucida console", size=18, text_color=$FFFFFF)
  c = Subtitle(c, "by HomiE FR (homie.fr@wanadoo.fr)", x=20, y=45, font="lucida console", size=14, text_color=$FFFFFF)
  # PRINTING MOTION ESTIMATION INFORMATION [11]
  c = Subtitle(c, "motion estimation", x=20, y=85, font="lucida console", size=18, text_color=$FFFFFF)
  c = Subtitle(c, "diff = "+string(diff), x=20,y=110, font="lucida console", size=16, text_color=$FFCCCC)
  # PRINTING QUANTIFIED MOTION FILTER INFORMATION [12]
  c = Subtitle(c, "quantified motion filter", x=20, y=135, font="lucida console", size=18, text_color=$FFFFFF)
  c = (motion_level == 0) ? Subtitle(c, "scene type = low motion", x=20, y=160, font="lucida console", size=16, text_color=$66FF66) : c
  c = (motion_level == 1) ? Subtitle(c, "scene type = medium motion", x=20, y=160, font="lucida console", size=16, text_color=$66FF66) : c
  c = (motion_level == 2) ? Subtitle(c, "scene type = high motion", x=20, y=160, font="lucida console", size=16, text_color=$66FF66) : c
  return c
}
DDogg is offline   Reply With Quote
Old 9th September 2003, 09:58   #11  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
The script above works fine on my system, with Aug. 3rd build.
__________________
Regards, sh0dan // VoxPod

Last edited by sh0dan; 9th September 2003 at 10:02.
sh0dan is offline   Reply With Quote
Old 9th September 2003, 11:12   #12  |  Link
Wilbert
Super Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,375
@DDogg,

Could you remove the lines [6b], [6c], and

c = (debug == true) ? ScriptClip(c, "Debug()") : c

and post the exact error message?
Wilbert is offline   Reply With Quote
Old 9th September 2003, 17:16   #13  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Sh0dan, I emailed a screen shot of the error and I am awaiting a reply from Wilbert with more instructions on what he wants. I was not able to successfully follow his instructions above.

Also, could you verify it is correct that functions canNOT be all on one line? I can't imagine that all the scripts I did with functions on one line were not actually operating and did so without throwing any errors.
DDogg is offline   Reply With Quote
Old 9th September 2003, 23:23   #14  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Sh0dan,

The replicatable example I posted at the start of this thread is only replicatable in Mplayer. With the Aug20 build they show. With the Sept03 build they do not show.

However, the errors do not show in VDub, or more importantly to me since I don't use VDub, the CCE preview window. I actually reported because I had the errors output in a CCE encode, but I cannot replicate that again.

I would still be interested to at least know if you can replicate in MPlayer or whether it has something to do with certain filters specific to my machine. One thing for sure, there was some change between the builds that causes an error in mplayer, at least on my machine, so I do hope that may have some value to you as data. But, as you said, it now sounds more like something trivial.

Thanks to Wilbert for his help and thanks to you for your time.
DDogg is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.