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. |
25th March 2020, 18:48 | #1 | Link |
Registered User
Join Date: May 2010
Posts: 64
|
Apply filter to specific frame ranges?
I want to filter a specific range of frames on a X-Files Blu-ray episode I have. The non-filtered frames are fine. The filtered frames are essentially missing film they couldn't find for the remaster. So they used the NTSC master tapes instead.
Here's what I have: LoadPlugin("C:\MeGUI 64-bit\tools\dgindexnv\DGDecodeNV.dll") DGSource("G:\Temp\tfarfiov.brm\The Host.dgi") ConvertBits(8) part1=Trim(0,29869) part2=Trim(29870,31002).TemporalDegrain2().FFT3DFilter(sigma=50, plane=3, bt=3) part3=Trim(31003,62599) part4=Trim(62600,63135).TemporalDegrain2().FFT3DFilter(sigma=5, plane=3, bt=3) part5=Trim(63136,63296).TemporalDegrain2().FFT3DFilter(sigma=50, plane=3, bt=3) part6=Trim(63297,65028) return part1++part2++part3++part4++part5++part6 return last Prefetch(8) I wanted to try using the ApplyRange filter for this, because it looks cleaner than all this cutting with Trim. However, whenever I tried to use it, it kept throwing me errors like invalid arguments to ApplyRange, and something like that. |
25th March 2020, 19:09 | #2 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Something like this (Untested)
Code:
/* part1=Trim(0,29869) part2=Trim(29870,31002).TemporalDegrain2().FFT3DFilter(sigma=50, plane=3, bt=3) part3=Trim(31003,62599) part4=Trim(62600,63135).TemporalDegrain2().FFT3DFilter(sigma=5, plane=3, bt=3) part5=Trim(63136,63296).TemporalDegrain2().FFT3DFilter(sigma=50, plane=3, bt=3) part6=Trim(63297,65028) */ Function MyFunc(clip c,Float Sigma,Int Plane,Int bt) { return c.TemporalDegrain2.FFT3DFilter(sigma=Sigma, plane=Plane,bt=bt) } Colorbars(pixel_type="YV12") ApplyRange(29870,31002,"MyFunc",50.0,3,3) ApplyRange(62600,63135,"MyFunc", 5.0,3,3) ApplyRange(63136,63296,"MyFunc",50.0,3,3) Prefetch(8) # Before Return return last Code:
Function MyFunc_1(clip c) { return c.TemporalDegrain2.FFT3DFilter(sigma=50.0, plane=3,bt=3) } Function MyFunc_2(clip c) { return c.TemporalDegrain2.FFT3DFilter(sigma= 5.0, plane=3,bt=3) } Colorbars(pixel_type="YV12") ApplyRange(29870,31002,"MyFunc_1") ApplyRange(62600,63135,"MyFunc_2") ApplyRange(63136,63296,"MyFunc_1") Prefetch(8) # Before Return return last
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 25th March 2020 at 19:17. |
25th March 2020, 21:55 | #4 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
I only did it as separate functions so as to show use of multiple filters applied via ApplyRange [incl the TemporalDegrain2() thing] [EDIT: also see post #5].
You could also use eg ClipClop() or RemapFramesSimple(). EDIT: Again untested (ClipClop):- https://forum.doom9.org/showthread.php?t=162266 Code:
Colorbars(pixel_type="YV12") # Up to 255 FXn clips supported FX1 = TemporalDegrain2.FFT3DFilter(sigma=50.0, plane=3,bt=3) # Replacement clip No 1 FX2 = TemporalDegrain2.FFT3DFilter(sigma= 5.0, plane=3,bt=3) # Replacement clip No 2 Nicks = """ # NickNames used in preference to clip index's Filter_1 = 1 # Pseudonym for clip index 1 ie FX1, can use in SCMD Filter_2 = 2 """ # Below, can use NickNames eg "Filter_1 29870,31002" instead of "1 29870,31002" SCMD = """ Filter_1 29870,31002 # or eg 1 29870,31002 # clip index 1, if not using nicknames, ie FX1 Filter_2 62600,63135 # or eg 2 62600,63135 Filter_1 63136,63296 # or eg 1 63136,63296 """ SHOW=False ClipClop(Last,FX1,FX2,scmd=SCMD,show=SHOW,Nickname=Nicks) Code:
Example usage script using NickNames: ### Avisource("D:\avs\test.avi") ORG=Last V1 = FFT3DFilter(Plane=0,Sigma=1.6) # Light Luma V2 = FFT3DFilter(Plane=0,Sigma=2.0) # Med Luma V3 = FFT3DFilter(Plane=0,Sigma=4.0) # High Luma V4 = FFT3DFilter(Plane=3,Sigma=1.6) # Light Chroma V5 = FFT3DFilter(Plane=3,Sigma=2.0) # Med Chroma V6 = FFT3DFilter(Plane=3,Sigma=4.0) # High Chroma V7 = FFT3DFilter(Plane=4,Sigma=1.6) # Light Luma+Chroma V8 = FFT3DFilter(Plane=4,Sigma=2.0) # Med Luma+Chroma V9 = FFT3DFilter(Plane=4,Sigma=4.0) # High Luma+Chroma V10= FlipHorizontal() # Flip-H V11= FlipVertical() # Flip-V V12= Invert() # Invert NickNames =""" # Psuedonyms for clips (clip index number) L0 = 1 # Light Luma L1 = 2 # Med Luma L2 = 3 # High Luma C0 = 4 # Light Chroma C1 = 5 # Med Chroma C2 = 6 # High Chroma LC0 = 7 # Light Luma + Chroma LC1 = 8 # Med Luma + Chroma LC2 = 9 # High Luma + Chroma FH = 10 # Flip-H FV = 11 # Flip-V INV = 12 # Invert """ SCMD=""" # Clip editing commands in string, can also use commands in file C0 0,99 # Light Chroma frames @ 0 -> 99 L0 100,-200 # Light Luma frames @ 100, 200 frames ie frames 100->299 INV 300,399 # Invert 300->399 L0 400,499 # Light Luma frames 400->499 FH 500,599 # Flip-H 500->599 LC2 600,699 # High Luma + Chroma C1 800 # Med Chroma, Single frame 1 900,999 # Light Luma, We used the clip number instead of a NickName FV 1000,1099 # Flip-V LC1 2000,0 # Med Luma + Chroma, 2000 -> lastframe """ SHOW=True ClipClop(ORG,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,scmd=SCMD,nickname=NickNames,show=SHOW)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 26th March 2020 at 14:07. |
26th March 2020, 13:21 | #5 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
those you are not using, eg Code:
/* FFT3DFilter(clip, float "sigma", float "beta"=1.0, int "plane", int "bw"=48, int "bh"=48, int "bt", int "ow", int "oh", float "kratio", float "sharpen", float "scutoff", \ float "svr", float "smin", float "smax", bool "measure", bool "interlaced", int "wintype", int "pframe", int "px", int "py", bool "pshow", float "pcutoff", \ float "pfactor", float "sigma2", float "sigma3", float "sigma4", float "degrid", float "dehalo", float "hr", float "ht", int "ncpu") */ ApplyRange(29870,31002,"FFT3DFilter",50.0,1.0,3,48,48,3) Using script functions makes it easier to use where you can use named args within script functions, and call script function with only the args you are interested in using. [as in post #2] EDIT: I dont think that I have read above anywhere, was my conclusion after spending some time failing to get named args working with ApplyRange/Animate.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 26th March 2020 at 19:58. |
|
26th March 2020, 19:37 | #7 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Above was intended to mean exactly what you said big G. And you be keeping yourself safe tooooo. You can come back you know, you cant catch the nasty thingy on-line EDIT: Would probably be a good idea to note above on Wiki. Something like below, could probably be worded better. Quote:
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 26th March 2020 at 19:48. |
||
26th March 2020, 19:46 | #8 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
Keep up the good work!!! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|