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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th December 2010, 23:47   #81  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
New Filter: Glitch Analyzer (detect dropped frames)

Updated to 1.02 Dec 18/2010

Capture Glitch Analyzer Ver. 1.02 by jmac698 (glitchanalyzer.avs)
A video with pseudo-timecode is generated then analyzed to detect temporal capture problems such as duplicated, missing, or field-reversed frames

Why: Some capture cards drop or dupe frames with no other indication. This will interrupt pulldown sequences making IVTC impossible. It also affects various multicap techniques.

Update: I found the solution to the original problem; VirtualDub drops frames by default (and my last 5 years of captures are all ruined). Only the following should be checked:
correct timing
auto disable sync

Requirements: ColorMatrix (optional), only tested on AviSynth 2.58 (in some of my other scripts, 2.6 caused problems)

Code:
#Capture Glitch Analyzer Ver. 1.02 by jmac698 (glitchanalyzer.avs)
#A video with pseudo-timecode is generated then analyzed to detect temporal capture problems such as duplicated, missing, or field-reversed frames
#1.01: Bug Fixes; DarkBlue wouldn't join with Colourbars due to differing fps, undefined variable sep, more convenient video sources
#1.02: Proper fix for CreateSolidBackground fps (need 30000.0 to assume float)

#Why: Some capture cards drop or dupe frames with no other indication.  This will interrupt pulldown sequences making IVTC impossible.  It also affects various multicap techniques.

#Requirements: ColorMatrix (optional)

#Useful tools: AvsP, HCEncoder, VirtualDub

#Usage level: Diagnosis probably requires an intermediate level user familiar with encoding, capturing videos and script setup, and some data analysis skills.
#  However, fixing diagnosed capture problems automatically may require advanced scripting knowledge

#Use: 
#1. Modify this script to set mode to generate and type to "NTSC" or "PAL" then encode the resulting diagnostic video
#  If encoding to mpeg2 use interlaced, top field first (e.g. in HCencoder)
#2. Capture the diagnostic video (e.g. in VirtualDub)
#3. Set mode to analyze, set the captured video filename and the timecode log output filename
#4. Run the analysis by playing back this script once (i.e., load the modified glitchanalyzer.avs into MediaPlayer and play)
#Load the resulting timecode.txt into a spreadsheet and
#  note where the timecode skips or duplicates numbers (a perfect capture will count from 0 to 15 repeatedly).  It is up to you to interpret this.
#The darkblue intro will read as constant 0, the lightblue outtro will read ideally as constant 15, but in reality will may be random, 0's or 15's.  Adjust slicelevel in readtimecode or the value of lightblue or ignore.

#Problems:
#The timecode may not be decoded if the video is horizontally or vertically shifted beyond tolerance, and/or the video levels are beyond tolerance.
#It is up to you to shift, crop, and adjust levels as necessary.
#Glitches spanning more than about 4 frames should be double-checked with the labels contained on the video, because of ambiguity in the sequence (I haven't thought this out further).
#Bluescreens typically generated by a VCR due to loss of signal may lead to unreliable timecodes.  Adjust slicelevel in readtimecode so that a constant timecode is decoded.

#Results
#Some capture cards/software/driver combinations will drop frames
#  with no indication.  One example: duplicate a frame (freezeframe), next frame, skip frame, 
#  then back to proper frame.  This 'hiccup' repeats every 13-15 frames.  The dupe is numerically exact.
#This sequence would look like: 0,1 0,1 2,3 6,7... (when it should be: 0,1 2,3 4,5 6,7)
#The next step is to find a way to deal with the missing frames.
#Restoring missing frames could be done by capturing twice, and merging the two videos together (which is easier said than done).  Interpolation is another approach to restoring missing frames.
#It's also possible that you don't need the missing frames anyhow, because the video is anime or silent film which cotains many duplicates due to the low frame rate.

#Other uses: Changes in field parity can also be detected.  The colourbars can verify levels.  The 'darkblue' can help measure noise. The script is educational.  Other codes like Closed Captioning could be decoded.

#How it works: First some backgrounds are generated, frame/field count is added, then a call to AddTimecode inserts a test signal
#  into the last 6 lines of video.  Although only two lines are needed, another problem with
#  capture cards is de-centred capturing.  An analog signal has 486 lines, but capture cards
#  only record 480 of them.  They should be centred.  Mine is two lines too high, thus
#  cropping the first two lnes.  Therefore, 6 lines gives some leeway.
#The background 'darkblue' is meant to give time for "Play" (on your playback device) and other symbols to disappear
#  before the timecode part appears.  For VHS this also gives time for the transport/tape
#  to stabilize.  And it gives you time to start the capture! 
#The analyze function decodes two lines of pseudo-timecode into a 4 bit number,
#  which counts from 0 to 15 and repeats.  This is enough to detect several combinations
#  of duplicated, missing, parity reversed, or rearranged frames.  An absolute timecode would be more difficult to program.
#With glitches affecting more than about 4 frames, you should look at the actual video
#  to verify the absolute timecode, which is written in text.

#Functions:
#CreateColourbars(string type, string colourspace, float length) Creates colourbars with type as NTSC or PAL, colourspace as REC709 or REC601, length in seconds
#CreateSolidBackground(string type, string colourspace, float length, int c) Creates a solid background with type as NTSC or PAL, colourspace as REC709 or REC601, length in seconds, colour as YUV in c
#LabelVideoWithCounts(clip v) Labels a video with frame and field counts
#whiteline(clip template) Creates a white line using template for video properties
#blackline(clip template) Creates a black line using template for video properties
#createcode(clip template,int code) Creates a video representing a 4bit timecode using template for video properties
#createcodefields(clip template,int code) Creates a video representing a 4bit timecode using template for video properties.  The video has two time codes on two lines, for use in interlaced video.
#AddTimecode(v) Overlays a timecode onto the supplied video, using createcodefields for generation.
#readtimecode(clip videoin) Extracts the video lines representing a timecode and decodes it, labeling the results on the returned video and also writing the results to the timecode file
#ShiftVideo(clip v, int hshift, int vshift) Shifts a video in any direction, where hshift<0 means left and vshift<0 means up.  Use only multiples of 2.
#ShowTimeCode(clip v) Extracts the video lines representing a timecode.

videoindrive="C:\"#You may find this useful if you use external hard drives
videoindir="project001\multicap\"
videoinname="glitchdiagnostic.avi"
videoinfilename=videoindrive+videoindir+videoinname
#You may find it easier to just uncomment the line below:
#videoinfilename="C:\MyVideos\glitchdiagnostic.avi"
dataoutdrive="C:\"
dataoutdir="project001\multicap\"
dataoutname="timecode.txt"
dataoutfilename=dataoutdrive+dataoutdir+dataoutname
#videoinfilename="C:\project001\multicap\framedrops.txt"
#Various test videos
v1=AviSource("C:\project001\multicap\svideo-source-glitch.avi").trim(209+117,0)
v2=MPEG2Source("C:\project001\multicap\Pinnacle PCTV 800i.0.SVideoInput.d2v", cpu=0).trim(51,0)
vid=v1

generate=1#Used to set mode to create the diagnostic video
analyze=2#Analyze a supplied video
demo=3#Both generate and analyze a virtual video and generate a timecode file
mode=demo
type="NTSC"#Set to NTSC or PAL.  You definitely need to set this.
#Important: if you don't have the optional ColorMatrix plugin installed, please set REC601 below!
colourspace="REC709"#Choose REC709 when encoding to mpeg2, REC601 for divx.  It is only for creating correct colourbars.
DarkBlue=CreateSolidBackground(type,colourspace,15,$10B848)#Specify video system, colourspace, time in seconds, and colour in YUV (directly in the colourspace of your choosing, i.e., it's not converted).
LightBlue=CreateSolidBackground(type,colourspace,15,$7EB848)#Joke: Booktree 848 is a nice colour!
CreateColourbars(type,colourspace,60)
mode==analyze?vid:last
mode==analyze?nop:LabelVideoWithCounts#Label the last video with frame and field counts
mode==analyze?nop:AddTimecode#Add computer readable timecode to last video (this is not related to the timecode in professional VCRs)
mode==analyze?nop:darkblue.assumefps(last.framerate)+last+darkblue.assumefps(last.framerate)
sep=","
WriteFileStart(dataoutfilename, """ "Current_Frame"+sep+"Top_Timecode"+sep+"Bot_Timecode" """)
WriteFileEnd(dataoutfilename, """ "End of Timecode for the file "+videoinfilename """)
mode==generate?last:readtimecode#Decode timecode embedded in video and log timecodes
#ShiftVideo(0,0)#Used for development; can be used to align incoming diagnostic video
#ShowTimeCode#Show only the extracted timecode video lines for debugging

#--- Functions are defined below.  You may want to split this out to another file and Import. ---
function CreateColourbars(string type, string colourspace, float length) {
  fps=type=="NTSC"?30000/1001:250000/1001
  colorbars(width=720,pixel_type="YV12").trim(0,length*fps/2-1).ConvertAudioTo16bit#weave'd down to half the time
  colourspace=="REC709"?ColorMatrix(mode="Rec.601->Rec.709"):last#If you get an error message here, set colourspace to REC601
}

function CreateSolidBackground(string type, string colourspace, float length, int c) {
  fps=(type=="NTSC")?30000.0/1001:25000.0/1001
  blankclip(Round(5*fps),width=720,pixel_type="YV12",fps=fps,audio_rate=48000,stereo=true,color_yuv=c)
}

function LabelVideoWithCounts(clip v) {
  #Add framecount and field counts to a video
  v
  assumetff
  separatefields
  top=last.selecteven
  bot=last.selectodd
  #all this is to remove color shadows; where the text overlays, color is desaturated, due to YV12
  tu=top.utoy
  tv=top.vtoy
  bu=bot.utoy
  bv=bot.vtoy
  top1=top.ScriptClip("""subtitle("top field = " + string(current_frame*2),x=-1,y=100,size=20,text_color=$00FFFFFF,font_width=17)""")
  bot1=bot.ScriptClip("""subtitle("bot field = " + string(current_frame*2+1),x=-1,y=120,size=20,text_color=$00FFFFFF,font_width=17)""")
  top=ytouv(tu,tv,top1)
  bot=ytouv(bu,bv,bot1)
  interleave(top,bot)
  weave
  ScriptClip("""subtitle("frame = " + string(current_frame),x=-1,y=140,size=40,text_color=$00FFFFFF)""")
  assumefps("ntsc_video")
  assumetff
}

#creates a 2 pixel high white line, quarter width, with the same video properties as the template
function whiteline(clip template) {
  template.crop(0,0,template.width/4,-(template.height-2)).tweak(sat=0,bright=255)
}

function blackline(clip template) {
  template.crop(0,0,template.width/4,-(template.height-2)).tweak(sat=0,bright=-255)
}

function createcode(clip template,int code) {
  #make 4 bit code from 4 quarter width horizontal lines
  code=code % 16
  b3=code/8
  code=code-b3*8
  b2=code/4
  code=code-b2*4
  b1=code/2
  code=code-b1*2
  b0=code
  template
  stackhorizontal(b3==1?whiteline:blackline,b2==1?whiteline:blackline,b1==1?whiteline:blackline,b0==1?whiteline:blackline)
}

function createcodefields(clip template,int code) {
  code=code*2
  interleave(createcode(template,code),createcode(template,code+1))
  pointresize(template.width,4)
  assumefieldbased.assumetff.weave
  crop(0,0,0,-2)
}

function AddTimecode(v) {
  #adds a 4bit timecode on the last 6 lines of video
  #e.g. frame 0, top field reads 0000, bot field reads 0001
  ScriptClip(v,"""
    overlay(last,createcodefields(last,current_frame),y=last.height-6)
  """)
}

function readtimecode(clip videoin) {
  ScriptClip(videoin,"""
    t=last
    w=last.width
    q=w/4#this is used to divide a video line into 4 horizontal parts to locate bits in the timecode
    h=last.height#this is used to locate the timecode lines, and should compensate for NTSC or PAL
    slicelevel=126#this luma video level is used to distinguish between 1 and 0 bits in the timecode ('data slicer' is a common term in electronics for this purpose)
    sep=","#the separator character used for the output data
    pointresize(last.width,last.height*2)
    b3tv=crop(0,(h-4)*2,-3*q,-3*2)#the leftmost 1/4 of a horizontal video line contains the highest bit value of the timecode
    b2tv=crop(q,(h-4)*2,-2*q,-3*2)
    b1tv=crop(2*q,(h-4)*2,-q,-3*2)
    b0tv=crop(3*q,(h-4)*2,0,-3*2)
    b3bv=crop(0,(h-3)*2,-3*q,-2*2)
    b2bv=crop(q,(h-3)*2,-2*q,-2*2)
    b1bv=crop(2*q,(h-3)*2,-q,-2*2)
    b0bv=crop(3*q,(h-3)*2,0,-2*2) 
    b3t=b3tv.averageluma>=slicelevel?1:0#a 'white' line (i.e., luma>=slicelevel) represents a 1 bit
    b2t=b2tv.averageluma>=slicelevel?1:0
    b1t=b1tv.averageluma>=slicelevel?1:0
    b0t=b0tv.averageluma>=slicelevel?1:0
    b3b=b3bv.averageluma>=slicelevel?1:0
    b2b=b2bv.averageluma>=slicelevel?1:0
    b1b=b1bv.averageluma>=slicelevel?1:0
    b0b=b0bv.averageluma>=slicelevel?1:0
    tc=b3t*8+b2t*4+b1t*2+b0t#top timecode
    bc=b3b*8+b2b*4+b1b*2+b0b#bot timecode
    t
    subtitle("decoded top field timecode="+string(tc))
    subtitle("decoded bot field timecode="+string(bc),y=16)
    WriteFile(dataoutfilename, "string(current_frame)+sep+string(tc)+sep+string(bc)")
  """)#tip: this could be potentially modified into a closed caption decoder as well
}

function ShiftVideo(clip v, int hshift, int vshift) {#Shift a video in any direction, hshift>0 shifts right, vshift>0 shifts down, use multiples of 2
  v
  l=hshift<0?-hshift:0
  r=hshift<0?0:hshift
  up=vshift<0?-vshift:0
  dn=vshift<0?0:vshift
  crop(l,up,0,0).addborders(0,0,l,up)
  crop(0,0,-r,-dn).addborders(r,dn,0,0)
}

function ShowTimeCode(clip v) {#Show only the extracted timecode video lines for debugging
  v
  w=last.width
  q=w/4#this is used to divide a video line into 4 horizontal parts to locate bits in the timecode
  h=last.height#this is used to locate the timecode lines, and should compensate for NTSC or PAL
  crop(0,h-4,0,2)
}

Last edited by jmac698; 18th December 2010 at 22:47. Reason: Warning about AviSynth Compatibility
jmac698 is offline   Reply With Quote
Old 29th December 2010, 06:00   #82  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
New Filter: Pan Scan Utilities

Pan Scan Utilities Ver. 0.1 by jmac698
Utilties for pan, zoom, and aspect ratio conversion of video

Shift - will pan a video in any x,y direction
Zoom - will zoom into the center of a video without resizing it
Aspectconvert - can pillar box or letterbox

Can be used with Animate to do a Ken Burns effect (panning over stills to add action to a documentary video, zooming in on a person your talking about).

Code:
function shift(clip v, int sx, int sy) {
  v#shift a video sx, sy pixels, sx<0 is left, sy<0 is down
  pointresize(width*2,height*2)#to allow 1 pixel shifts in YV12
  sx=sx*2
  sy=sy*2
  l=(sx<0)?-sx:0
  r=(sx<0)?0:sx
  t=(sy<0)?0:sy
  b=(sy<0)?-sy:0
  crop(l,t,-r,-b)
  addborders(r,b,l,t)
  bilinearresize(v.width,v.height)
}

function zoom(clip v, float zx, float zy) {
  v#Zoom but cropping to original size
  pointresize(width*2,height*2)#to allow 1 pixel increments in YV12
  w=int(zx*width/4+.5)*4
  h=int(zy*height/4+.5)*4
  addleft=(zx<1)?(width-w)/2:0
  addtop=(zy<1)?(height-h)/2:0
  bilinearresize(w,h)#zoom
  left=(zx>1)?int((w-v.width*2)/2):0
  top=(zy>1)?int((h-v.height*2)/2):0
  crop(left,top,-left,-top)#Keep only centered portion of zoomed video
  addborders(addleft,addtop,addleft,addtop) 
  bilinearresize(width/2,height/2)#back to normal size
}

function aspectconvert(clip v, int w, int h) {
  v#Extract a wxh video from original, e.g. a square cut out of a rectangle, centered
  #If source is smaller than dest, center source in dest
  #If source is less wide than dest, center crop source (i.e. pan scan)
  #If source is taller than dest, center crop source
  #a square (dest) on a widescreen (in) does a center cut.  A widescreen on a square does a letterbox.
  pointresize(width*2,height*2)
  w=w*2
  h=h*2
  left=(w<width)?(width-w)/2:0
  addleft=(w>width)?(w-width)/2:0
  top=(h<height)?(height-h)/2:0
  addtop=(h>height)?(h-height)/2:0
  addborders(addleft,addtop,addleft,addtop)
  crop(left,top,-left,-top)
  pointresize(w/2,h/2)
}
jmac698 is offline   Reply With Quote
Old 2nd January 2011, 08:31   #83  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
New Filter: Deep Color Tools Ver 0.3a by jmac698
Scripted functions to manipulate 48bit color video. Reads 10bit mov files. These are the first Avisynth functions to support 10 bit and above video. Ver 0.3, bugs fixed. Tested to work with v210 file.
Code:
#Deep Color Tools Ver 0.3 by jmac698
#Scripted functions to manipulate 48bit color video.  Reads 10bit mov files. These are the first Avisynth functions to support 10 bit video.
#Bugs: Only 9 bits of 10bit files are used.  Tweak only supports cont and bright and calculates like coloryuv, there's some small numerical errors (rounding in mt?)
#Ver 0.3a: renamed to Deep Color Tools (from Deep Color Utilities) since this was the only name I can remember :)  Updated documentation.
#Ver 0.3: fixed bug in clamprange, deepgreyscale, code cleanup (thanks Gavino from Doom9!)
#Ver 0.2: Fixed bugs with deeplastlo in all functions, successfully tested with a v210 file, added compatibility with yuy2, 
#  order of operations in tweak, chroma bug in tweak
#  new functions: deepramp, deepcrop, deepgreyscale
#  cleaned up code
#Requires masktools 2.0a48 (http://manao4.free.fr/masktools-v2.0a48.zip), qtsource (http://www.tateu.net/software/dl.php?f=QTSource), Quicktime 6+ or QT Lite (http://www.free-codecs.com/download/QT_Lite.htm)
#Uses an internal format with two videos for the high and low bytes, audio in low is ignored, format tracks the pixel format
#Functions:
#deepread(string fn) - reads a v210 mov file and saves to deeplast
#deepgreyclip(int "luma",string "pixel_type") - sets deeplast to luma (a 16 bit number), defaults to YV12
#deeptweak(float "hue", float "sat", float "bright", float "cont", bool "coring") - adjusts brightness and contrast in 16bit, including coring
#deepcrop(l,t,a,b)- crops deeplast
#deepramp(string "pixel_type",int "bits") - creates a luma ramp of bits, defaults to 10 bit yv12.  The range is unrestricted.
#deepgreyscale - converts deeplast to greyscale
#The high byte is always displayed as a preview.  There is no dithering or rounding.
#To come: more downcolor options, color correction, colorbars, more functions, resizing
Global deeplasthi=blankclip(pixel_type="YV12").tweak(bright=-255,coring=false).tweak(bright=16,coring=false)
Global deeplastlo=blankclip(pixel_type="YV12").tweak(bright=-255,coring=false).tweak(bright=0,coring=false)
Global format=0#0=YV12, 1=YUY2, 2=RGB

fn="G:\project001a\deepcolor\v210.mov"
deepramp
#deepread(fn)
deeplastlo#this line shows if you have data in the lower bits

function add16k(float n) {
  string(n)+" x y 256 * + +"
}

function mult16k(float n) {
  string(n)+" x y 256 * + *"
}

function multadd16k(float m, float a) {#multiply by m then add a
  string(a)+" "+string(m)+" x y 256 * + * +"
}

function clamphi(string s, int n) {
  s+" "+string(n)+" > "+string(n)+" "+s+" ?"
}

function clamplo(string s, int n) {
  s+" "+string(n)+" < "+string(n)+" "+s+" ?"
}

function clamprange(string s, int low, int high) {
  clamplow(s,low).clamphi(high)
}

function b0(string s) {
  s+" 255 &u"
}

function b1(string s) {
  s+" 65280 &u 8 >>"
}

function b2(string s) {
  s+" 16711680 &u 16 >>"
}

function b3(string s) {
  s+" 4278190080 &u 24 >>"
}

function deeptweak(float "hue", float "sat", float "bright", float "cont", bool "coring") {
  coring=default(coring,true)
  bright=default(bright,0)
  cont=default(cont,1)
  clamplower=coring?16*256:0
  clampupper=coring?235*256:65535
  #Make sure deeplast is yv12 before using masktools (yuy2 is stored as yv12 double height to preserve color)
  preprocess
  #do Contrast then Brightness, then clamp.  -bright can bring a cont value back in range, ie 162*2=328, -100=228
  #Note: this is operating like coloryuv gain,off because tweak takes into account tv levels (ie (y-16)*cont+bright+16)
  tweakloexpr=b0(clamprange(multadd16k(cont,bright),clamplower,clampupper))
  tweakhiexpr=b1(clamprange(multadd16k(cont,bright),clamplower,clampupper))
  newlo=mt_lutxy(deeplastlo,deeplasthi,yexpr=tweakloexpr,chroma="copy second")
  newhi=mt_lutxy(deeplastlo,deeplasthi,yexpr=tweakhiexpr,chroma="copy second")
  global deeplastlo=newlo
  global deeplasthi=newhi
  postprocess
  deeplasthi
}

function deepgreyclip(int "luma",string "pixel_type") {
  pixel_type=default(pixel_type,"YV12")
  global deeplasthi=blankclip(pixel_type=pixel_type).tweak(bright=-255,coring=false).tweak(bright=luma/256,coring=false)
  global deeplastlo=blankclip(pixel_type=pixel_type).tweak(bright=-255,coring=false).tweak(bright=luma%256,coring=false)
  Global format=pixel_type=="YV12"?0:pixel_type=="YUY2"?1:2
  deeplasthi
}

function deepread(string fn) {
  global deeplasthi=qtinput(fn,color=2,audio=true,mode=1,raw="v210")
  global format=IsYUY2(deeplasthi)?1:0
  qtinput(fn,color=2,audio=true,mode=1,raw="v210",dither=1)#9th bit
  #low bit to high bit
  getlowbyte(last,deeplasthi)
  global deeplastlo=last
  deeplasthi
}

function deepcrop(l,t,a,b) {
  global deeplasthi=crop(deeplasthi,l,t,a,b)
  global deeplastlo=crop(deeplastlo,l,t,a,b)
  deeplasthi
}

function preprocess {#work around limitations of masktools
  global deeplasthi=format==1?deeplasthi.pointresize(deeplasthi.width,deeplasthi.height*2).converttoyv12:deeplasthi
  global deeplastlo=format==1?deeplastlo.pointresize(deeplastlo.width,deeplastlo.height*2).converttoyv12:deeplastlo
}

function postprocess {#undo temporary format
  global deeplasthi=format==1?deeplasthi.converttoyuy2.pointresize(deeplasthi.width,deeplasthi.height/2):deeplasthi
  global deeplastlo=format==1?deeplastlo.converttoyuy2.pointresize(deeplastlo.width,deeplastlo.height/2):deeplastlo
}

function deepramp(string "pixel_type",int "bits") {#Create an increasing luma ramp in 10bit deepcolor, full range
  #more useful as an internal diagnostic than a video test pattern
  pixel_type=default(pixel_type,"YV12")
  bits=default(bits,10)
  global deeplasthi=blankclip(pixel_type=pixel_type)
  global deeplastlo=blankclip(pixel_type=pixel_type)
  Global format=pixel_type=="YV12"?0:pixel_type=="YUY2"?1:2
  n=int(pow(2,bits))
  lowbits=bits>8?bits-8:0
  vlowbits=int(pow(2,lowbits))
  v1=n-vlowbits
  v2=vlowbits-1
  v3=vlowbits<8?8-lowbits:0
  ramphiexpr="x "+string(v1)+" &u "+string(lowbits)+" >>u"
  ramploexpr="x "+string(v2)+" &u "+string(v3)+" <<u"
  #How this works: for 10 bits, you count as: 00000000 00, 00000000 01, 00000000 10, 0000000 11, 00000001 00
  #the low 2 bits we put into the low byte, high 2 bits, or shift up 6 times, or (8-2) times, this is value v3
  #now we have 0,64,128,192... for the low byte
  #In the high byte, you can see a pattern of repeating values, 0,0,0,0,1...
  #so we could just /4 to get this but if the video width were 1024 we'd reach 256
  #so we & with (1023-3), this is v1.  Now we can divide by 4 or shift right 2.  This is lowbits.
  preprocess
  global deeplasthi=mt_lutspa(deeplasthi,mode="absolute",yexpr=ramphiexpr)
  global deeplastlo=mt_lutspa(deeplastlo,mode="absolute",yexpr=ramploexpr)
  postprocess
  deeplasthi
}

function deepgreyscale {
  global deeplasthi=greyscale(deeplasthi)
  global deeplastlo=greyscale(deeplastlo)
  deeplasthi
}

function getlowbyte(clip vround, clip vtrunc) {#vround may have some pixels +1 compared to vtrunc; put the difference in the high bit
  Overlay(vround,vtrunc, mode="Subtract", pc_range=true)#e.g. y:129-128=1, 128-128=0. u,v are 128 or 129
  coloryuv(gain_y=127*256,off_u=-128,off_v=-128)
  coloryuv(gain_u=127*256,gain_v=127*256)
}

function notdeeptweak(clip v,float "cont", float "bright") {#just for a quick demo
  v
  coloryuv(gain_y=(cont-1)*256,off_y=bright)
}

Last edited by jmac698; 19th September 2011 at 17:52. Reason: Update to 0.3a
jmac698 is offline   Reply With Quote
Old 8th January 2011, 22:24   #84  |  Link
frustum
Registered User
 
Join Date: Sep 2010
Location: Austin, TX
Posts: 40
jmac698 --

Very nice! I just had an hour to kick the tires and haven't done much testing yet. One roadblock is I don't have quicktime on my PC and don't want it on my PC. So I set up a virtual machine, installed quicktime, your script, and its dependencies. Here is my simple script:

Code:
film = "z:\original-uncompressed\01.avi"

loadplugin(".\mt_masktools-25.dll")
loadplugin(".\QTSource.dll")
import(".\deepcolor.avs")

deepread(film)
#deeplastlo
Running this script under virtualdub, I do see the video. If I uncomment the last line to see the lsbs, I see black, confirming that my "10b video" is really 8b video in a 10b format.

What is weird is that the film has 5023 frames, but if I view deeplastlo, virtualdub says that I have 240 frames.
frustum is offline   Reply With Quote
Old 12th January 2011, 16:10   #85  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
New Filter: VCR Simulator ver. 0.2 by jmac698
Simulates an old recording by introducing line jitter and reduced frequency response. Besides being an interesting special effect, this modelling can be used to test various filters for cleaning up analog recordings.
Code:
#VCR line jitter simulator Ver. 0.2 by jmac698 - with special thanks to Gavino :)
#requires both gscript and grunt, and noise generator (see Warpsharp web page)
#Ver 0.2: add noise, more realistic jitter, minor fixes
colorbars(pixel_type="YUY2").trim(0,10)
pointresize(width,height*4)#get line resolution by working around min height 4 limitations
h=height
splitlines(4)#split to lines of height 4 - note the jitter function requires height>=4
jitter
#return last
MergeLines(h)#merge until height=h
noisegenerator(true,55)
blur(1).blur(1).blur(1)
pointresize(width,height/4)
temp=last
u=temp.utoy
v=temp.vtoy
u=u.bilinearresize(30,height).bilinearresize(320,height)#it's actually better than this, placement of transitions is finer
v=v.bilinearresize(30,height).bilinearresize(320,height)
ytouv(u,v,temp)

function SplitLines(clip c, int n) {
  Assert(c.height%n == 0, "Clip height not a multiple of 'n'")
  Assert(!(c.IsYV12() && n%2==1), "'n' must be even for YV12 clips")
  nStrips = c.height/n
  c = c.ChangeFPS(nStrips*Framerate(c)).AssumeFPS(c) # Repeat each frame 'nStrips' times
  BlankClip(c, height=n) # template for ScriptClip result
  GScriptClip("c.Crop(0, (current_frame%nStrips)*n, 0, n)", args="c, nStrips, n")
}

function MergeLines(clip c, int h) {
  n=h/c.height #n is number of frames to merge, e.g. 480 split to 4line has n=120
  c.SelectEvery(n)
  GScript("""
    for (i=1, n-1) {
      stackvertical(c.SelectEvery(n, i))
    }
  """)
}

function shift(clip v, int sx, int sy) {
  v#shift a video sx, sy pixels, sx<0 is left, sy<0 is down
  pointresize(width*2,height*2)#to allow 1 pixel shifts in YV12
  sx=sx*2
  sy=sy*2
  l=(sx<0)?-sx:0
  r=(sx<0)?0:sx
  t=(sy<0)?0:sy
  b=(sy<0)?-sy:0
  crop(l,t,-r,-b)
  addborders(r,b,l,t)
  bilinearresize(v.width,v.height)
}

function jitter(clip v) {#note: a good tape could typically be +-3 without a TBC, distribution is not realistic
  ScriptClip(v,"""
    shift(rand(2)+rand(2)+rand(2)+4,0)
  """)
}
VHS simulator, VHS emulator, VHS effect

Last edited by jmac698; 14th August 2014 at 06:22. Reason: add keywords so I can find it
jmac698 is offline   Reply With Quote
Old 12th January 2011, 17:48   #86  |  Link
pbristow
Registered User
 
pbristow's Avatar
 
Join Date: Jun 2009
Location: UK
Posts: 263
Nice one, jmac698! (I haven't tested it, but it the idea is a good one and the implementation looks OK to me).

For a more realistic distribution of the jitter, try changing:
rand(6)
to:
rand(2)+rand(2)+rand(2)

That should give a roughly gaussian distribution over the the range 0 to 6 (average 3, standard devation around 1-ish).


Last edited by pbristow; 12th January 2011 at 17:50.
pbristow is offline   Reply With Quote
Old 12th January 2011, 20:06   #87  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
Try it now - I can't believe how much it looks like a VCR, I could swear I just capped it - try a movie.
jmac698 is offline   Reply With Quote
Old 27th June 2011, 22:45   #88  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
New Filter: RGB<=>YCgCo Ver. 1 by jmac
Requirements: masktools v2a38+
Description: Converts between RGB and YCgCo. YCgCo is a low correlation colorspace used in H.264 for better compression efficiency.
Usage: Load your source, convert to RGB, call RGB2YCgCo, convert to YV12, compress. Should encode well.
To playback, use the Avisynth filter in FFDShow and enter converttorgb.YCgCo2RGB
Code:
#RGB<=>YCgCo demo by jmac, requires masktools v2a38+, tested in avisynth 2.58
#The demo just shows colorbars, but what is happening is a conversion back and forth between colorspaces
#Theoretically you would convert to YCgCo and compress, this will compress about 10% better than YUV
#However, it's unclear how to send this to an h.264 encoder.  There's probably a way to arrange the pixels to make it work.
#To test compression, just feed as YUV to a compressor.  The Cg/Co channels will be subsampled.  Playback the result as YUV, the script will decode it.
#Ver 1.0 - Does correct, full range conversion both ways, in 8bit
#Testing...
RGB2YCgCo
#for realtime playback in ffdshow, from h.264 with YCgCo, erase all lines above
#except I don't know the format return from ffdshow
YCgCo2RGB

function RGB2YCgCo(clip v) {
#convert an assumed RGB clip into Co,Y,Cg
#~ Y = 0.25 * R + 0.5 * G + 0.25 * B 
#~ Cg = -0.25 * R + 0.5 * G - 0.25 * B + 0.5
#~ Co = 0.5 * R - 0.5 * B + 0.5
v
#put planes into yuv for masktools (awkward)
#RGBintoYV12
r1=ShowRed.converttoyv12(matrix="PC.709")#R->Y
g1=ShowGreen.converttoyv12(matrix="PC.709")#G->Y
b1=ShowBlue.converttoyv12(matrix="PC.709")#B->y
r=YtoUV(r1,r1,r1.pointresize(r1.width*2,r1.height*2))#y->y, y->u, y->v
g=YtoUV(g1,g1,g1.pointresize(g1.width*2,g1.height*2))#y->y, y->u, y->v
b=YtoUV(b1,b1,b1.pointresize(b1.width*2,b1.height*2))#y->y, y->u, y->v
#Note: remember b=u=Cg=z, r=v=Co=x, g=y=y=y
mt_lutxyz(r,g,b,yexpr="x 4 / y 2 / + z 4 / +",uexpr="y 2 / x 4 / - z 4 / - 128 +",vexpr="x 2 / z 2 / - 128 +",chroma="process")
YV12intoRGB
}

function YCgCo2RGB(clip v) {
#convert an assumed  Co,Y,Cg clip into RGB
#~ R = Y - Cg + Co
#~ G = Y + Cg
#~ B = Y - Cg - Co + 1
v
#put planes into yuv for masktools (awkward)
r1=ShowRed.converttoyv12(matrix="PC.709")#R->Y
g1=ShowGreen.converttoyv12(matrix="PC.709")#G->Y
b1=ShowBlue.converttoyv12(matrix="PC.709")#B->y
r=YtoUV(r1,r1,r1.pointresize(r1.width*2,r1.height*2))#y->y, y->u, y->v
g=YtoUV(g1,g1,g1.pointresize(g1.width*2,g1.height*2))#y->y, y->u, y->v
b=YtoUV(b1,b1,b1.pointresize(b1.width*2,b1.height*2))#y->y, y->u, y->v
#Note: remember b=u=Cg=z, r=v=Co=x, g=y=y=y
mt_lutxyz(r,g,b,yexpr="y z + 128 -",uexpr="y z - x - 256 +",vexpr="y z - x +",chroma="process")
YV12intoRGB
}

function YV12intoRGB(clip v) {
#place v,y,u data into r,g,b planes
#this result has no visual meaning (however, closest approximation) but is only for performing arithmetic on the data
v
r=vtoy.converttorgb(matrix="PC.709")
g=greyscale.converttorgb(matrix="PC.709")
g=g.pointresize(width/2,height/2)#Y was doublesized
b=utoy.converttorgb(matrix="PC.709")
MergeRGB(r,g,b)#u->b, v->r, y->g
}

Last edited by jmac698; 27th June 2011 at 22:48.
jmac698 is offline   Reply With Quote
Old 18th August 2011, 04:25   #89  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ClipClop, New Plugin for range/frame editing of clips, see here:-

http://forum.doom9.org/showthread.php?t=162266

Planar, YUY2, RGB32, RGB24.

Does NOT affect Audio (as source clip).

Clipclop is a simple plugin to replace ranges in a source clip with the same range, from a replacement clip.
Supports up to 255 replacement clips, with unlimited number of replacements into output clip.
__________________
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; 5th November 2011 at 08:48.
StainlessS is offline   Reply With Quote
Old 20th August 2011, 15:46   #90  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
There is a great little utility that I thought deserved another mention here on-site, I did a search and
AMP WinOFF has not had mention since 2004. AMP WinOFF is a utility whose best attribute is
that it can shut down/hibernate etc, the computer under various conditions, mainly that where the CPU
usage falls below a user selected level of activity. Most similar type programs pretend they do this, but what
they measure is "User Activity" rather than CPU activity, not quite the same, and probably of limited use
to Doom9 members. I have been using WinOFF since about 2004, perhaps earlier and have always
been very happy with it. I noticed recently that a number of threads were concerned with adding shutdown
type capability into eg Encoder GUI's, with AMP WinOFF, this becomes completely un-necessary,
especially if doing several jobs simultaneouly, you would not want to shutdown just because one of those
jobs has completed, that type of utility function should be implemented at a machine level.

However, having multiple shutdown options are quite ofter handy, and the Hibernation options
are always a good idea (goes to sleep, wakes up and continues as if nothing had happened).

This is typical of how I used to use WinOFF using TMPGEnc (dont use TMPGEnc anymore).
Encode in TMPGEnc, Hibernate after 1 hour of processing, auto boot at a certain time in the
morning (Bios Setup), Auto Logon to system, continue encode in TMPGEnc, use TMPGEnc
implemented ShutDown On Completion. All automated.

Anyway, have just visited WinOFF website and found that a new version was released in Nov 2010,
(not updated mine for several years) and thought I should let you all in on the secret.

Below from AMP WinOFF Website:-

AMP WinOFF 5.0.1

Description

AMP WinOFF is an utility for scheduling the shutdown of Windows computers,
with several shutdown conditions and fully configurable. Some of its features are:

Several modes/conditions for shutdown planification:
At certain date/time (e.g. 12:00 AM).
After a period of time (e.g. 1 hour and 15 minutes).
When there isn't user activity (i.e. no mouse/keyboard input).
When there isn't CPU activity.
When there isn't network activity.

Option of set several conditions at the same time for the planification. Examples:
Shut down at 08:00 PM or when there is no user activity for 15 minutes.
Shut down when the CPU load is below than 1% and the network transfer is below than 1Kb/s.
Several types of shutdown: power off, restart, close session, lock session, administrative shutdown/restart, sleep and hibernate.
Immediate shutdown and session lock from the taskbar icon menu.
Several security options including anti-close protection and password protected access to the configuration.
Option of showing a display with the active shutdown planification.
Option of executing a program, capturing the desktop, and/or hang up the modem before the shutdown.
Command line support for batch processing.
Dual English/Spanish version.

http://www.ampsoft.net/utilities/WinOFF.php
__________________
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; 5th November 2011 at 01:32. Reason: spelling
StainlessS is offline   Reply With Quote
Old 27th August 2011, 18:47   #91  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
From Previous post above:

Quote:
Originally Posted by StainlessS View Post
This is typical of how I used to use WinOFF using TMPGEnc (dont use TMPGEnc anymore).
Encode in TMPGEnc, Hibernate after 1 hour of processing, auto boot at a certain time in the
morning (Bios Setup), Auto Logon to system, continue encode in TMPGEnc, use TMPGEnc
implemented ShutDown On Completion. All automated.
You can "Auto Logon" to the system using AutoLogon tool from
SysInternals (Microsoft). here: (EDIT: Updated Feb 2011)

http://technet.microsoft.com/en-gb/s...rnals/bb545027
__________________
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; 28th August 2011 at 04:59.
StainlessS is offline   Reply With Quote
Old 5th September 2011, 10:57   #92  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Prune(), New plugin for Trim & Splice.

Prune is a simple plugin to trim() multiple source clips and splice the results into a new clip.
Supports up to 256 source clips, with unlimited number of trims/splices into output clip.

Video:- Planar, YUY2, RGB32, RGB24.

http://forum.doom9.org/showthread.php?t=162446
__________________
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; 5th November 2011 at 08:51.
StainlessS is offline   Reply With Quote
Old 1st November 2011, 20:02   #93  |  Link
vampiredom
Registered User
 
Join Date: Aug 2008
Posts: 233
MpegAutoIndex

New Utility and Function: MpegAutoIndex and MpegAutoIndexSource()

http://forum.doom9.org/forumdisplay.php?f=69

All requirements are included in the distribution.

MpegAutoIndex provides easy script-controlled indexing for MPEG2, h264/MPEG4 and VC1 sources via Donald Graft's indexing tools. As of 2011/11/01, h264 .mkv files are also supported. [note: .mkv containers, VC1 formats and interlaced h264 require a license from neuron2.net]

The package includes the indexers - and expands h264 support to include .mp4 and .mov containers via the included mp4box and faad executables. Likewise, it now includes ASF2VC1 to enable accurate indexing of VC1 in .wmv containers.

MpegAutoIndexSource() uses NicAudio for sourcing a large variety of audio formats. It also includes SoundOut for easy exporting of AC3 and WAV formats, which can be particularly helpful for 5.1 channel encodings, etc. The function provides many options for audio input/processing/output.

When opening .VOB files, MpegAutoIndexSource() automatically detects and indexes the entire set.

Code:
# MPEGAutoIndexSource(filename [, options])

# Open an MPEG4 file
MpegAutoIndexSource("foo.mp4")

# Open an AVC stream using DGIndexNV and hardware double-rate deinterlacing
MpegAutoIndexSource("foo.mts", NV=true, args="deinterlacing=2")

# Open an AVC stream using DiAVC and hardware double-rate deinterlacing
MpegAutoIndexSource("foo.mts", DI=true, args="deinterlacing=2")

# Open an NTSC MPEG2 DVD stream using DGIndex, force it to 24P (film)
# Downmix the multichannel audio to stereo, Normalize the audio to 99%
MpegAutoIndexSource("VTS_01_1.VOB", FieldOperation=1, Downmix=true, PeakAudioLevel=0.99)

# Open an AVC stream from BluRay using DGIndexNV, forcing 24p
# Downmix the multichannel audio to stereo, normalize it to 100%
# Output the audio as a 256kbps AC3 file
MpegAutoIndexSource(
\     "12345.m2ts",
\     NV=true,
\     args="fieldop=1",
\     Downmix=true,
\     PeakAudioLevel=1.00,
\     AC3Out=true, AC3Bitrate=256
\ )

# Open an VC-1 .wmv file
MpegAutoIndexSource("vc1.wmv", NV=true)

# Open a .mkv file with h264 video
MpegAutoIndexSource("vc1.wmv", NV=true)

Last edited by vampiredom; 2nd November 2011 at 03:38. Reason: new version, new functionality
vampiredom is offline   Reply With Quote
Old 4th December 2011, 21:59   #94  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
New utility, MeGUI AutoEncode Batcher

Utility to allow group selection of *.AVS files for batching to MeGUI AutoEncode.

Here:-
http://forum.doom9.org/showthread.php?t=163343
__________________
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; 5th December 2011 at 04:31.
StainlessS is offline   Reply With Quote
Old 12th December 2011, 04:42   #95  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
New utility, DGIndex Batcher v0.01 (Previous post for MeGUI AutoEncode Batcher is new also, v0.12).

Utility to allow group selection of files for batching to DGIndex.

EDIT: Can call above previously posted "MeGUI AutoEncode Batcher" to pass generated AVS files
for it to AutoEncode batch to MeGUI.

EDIT: Both utilites are now updated.

Here:-
http://forum.doom9.org/showthread.php?t=163369
__________________
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; 17th March 2012 at 03:08.
StainlessS is offline   Reply With Quote
Old 16th December 2011, 16:25   #96  |  Link
redfordxx
Registered User
 
Join Date: Jan 2005
Location: Praha (not that one in Texas)
Posts: 863
New plugin, RedAverage.

Set of filters to sum, average and merge "unlimited" number of clips.
Input and output can be independently 8bit or 16bit (for higher precission).
redfordxx is offline   Reply With Quote
Old 16th January 2012, 18:33   #97  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ShowChannels() v0.1

Plugin for Avisynth 2.5+.

Planar, YUY2 and RGB.

Simple plugin whose only function is to display the average Y,U and V
values for a YUV frame or R,G, and B for an RGB frame.
Also shows accumulated average for all frames visited so far.

Typical output for a YUV clip:-

Code:
347 ] Frames Visited = 348

          This Frame           Accumulated
       Y     U      V        Y     U      V
 Ave  77.00 125.52 125.42   70.91 125.87 125.78
 Min   4     80     95       0     69     83
 Max 255    177    165     255    190    174
~Min  14     95    101      12     92    101
~Max 234    167    148     235    167    151
See here:-
http://forum.doom9.org/showthread.php?t=163829
__________________
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; 17th March 2012 at 03:03.
StainlessS is offline   Reply With Quote
Old 27th January 2012, 14:55   #98  |  Link
DrPhill
Registered User
 
Join Date: Dec 2011
Location: West Somerset, UK
Posts: 130
I have created a new plugin in C. It adds a 'watermark' to a video.

A 'watermark' deforms the image as if it were 'embossed' into it. Teh watermark is defined by the user as a black and white image (still or moving). The intensity of the effect is controllable through parameters.

This filter currently only works in RGB32, and has not been exhaustively tested, though it is known to work on at least three machines.

I would dearly like someone with real C skills to check the code for obvious bugs, portability issues and general silliness.......

The source and release are available from SourceForge.

Any and all comments, feedback and suggestions are welcome, but preferably to this thread as I have email notification on it.

Example of output

Thanks

Last edited by DrPhill; 27th January 2012 at 15:06. Reason: Added link to an example
DrPhill is offline   Reply With Quote
Old 31st January 2012, 10:45   #99  |  Link
panzerboy
Registered User
 
Join Date: Nov 2010
Posts: 2
GIMP style layer merge plugin

http://sourceforge.net/projects/avisynthgmplyr/files/?

This is an implementation of GIMPs layers as AVIsynth merge filters.
See the GIMP docs for the types of merges.
http://docs.gimp.org/2.6/en/gimp-con...ayer-modes.htm

I've cribbed the code from the GIMP source (mostly the pixel arithmetic) and inserted it into the SDK example 1.7.
Amazingly, it all seems to work!

So there's 20 merge filters in AvisynthGimpLayer.dll (must think of a better name).

Normal(clip, clip, opacity=float)
Multiply(clip, clip, opacity=float)
Divide(clip, clip, opacity=float)
Screen(clip, clip, opacity=float)
GimpOverlay(clip, clip, opacity=float)
Burn(clip, clip, opacity=float)
Dodge(clip, clip, opacity=float)
Hardlight(clip, clip, opacity=float)
Softlight(clip, clip, opacity=float)
GrainExtract(clip, clip, opacity=float)
GrainMerge(clip, clip, opacity=float)
Difference(clip, clip, opacity=float)
Addition(clip, clip, opacity=float)
Subtract(clip, clip, opacity=float)
DarkenOnly(clip, clip, opacity=float)
LightenOnly(clip, clip, opacity=float)
Hue(clip, clip, opacity=float)
Saturation(clip, clip, opacity=float)
Colour(clip, clip, opacity=float)
Value(clip, clip, opacity=float)

They work on RGB or RGBA clips only.
The last four Hue, Saturation, Colour and Value have a RGB-HSV conversion and back.
So they will probably run extra slow.

So why?
I play with mandelbrots with the Fractal Extreme program.
I started off with static pictures now I tend to do zoom movies.
With the static pictures I often generate multiple copies of the mandelbrot with different colour palettes and mappings.
These get layered in GIMP.
Lately I've been doing similar with the movies using Merge, Mergechroma and MergeLuma.
I wanted to do a movie of a older static picture
http://www.flickr.com/photos/panzerboy/6233908023/
, to get an match I needed the same layering that GIMP provides.
http://youtu.be/Nk5aeJi22bg
panzerboy is offline   Reply With Quote
Old 26th February 2012, 01:25   #100  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,492
I had a need of this simple filter - there may be a better way to implement it, but the work's done now so I thought I may as well share it.

http://horman.net/simpleselect.zip

Code:
simpleselect(clip, f1 [,f2...,fn])
Return only frames f1, f2,...,fn of the source clip, e.g.

Code:
simpleselect(clip, 2, 3, 5, 7, 9, 13) # return a 6-frame clip comprising frames 2,3,5,7,9,13 of clip
David
wonkey_monkey is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:36.


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