Advertisement
AzraelNewtype

Timeranger Helpers v2

Oct 16th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function DupFrame(clip c, int f) {
  2.     return c.Trim(f,f).assumefps("ntsc_video")
  3. }
  4.  
  5. function Zoom(clip c, int left, int top, int right, int bottom) {
  6.     return(c.spline36resize(c.width(),c.height(),left,top,right,bottom))
  7. }
  8.  
  9. #It's more convenient to start with select60 and edit to 24/30 than a trim,
  10. function Select60(clip in, int start, int end, int "a", int "b", int "c", int "d") {
  11.     return(in.trim(start,end))
  12. }
  13.  
  14. function Select30(clip c, int start, int end, int "w", int "x", int "y", int "z") {
  15.     return(c.trim(start,end).selecteven())
  16. }
  17.  
  18. function Select24(clip in, int start, int end, int a, int b, int c, int d, bool "show") {
  19.     show = default(show, false)
  20.     if (show == true) {
  21.         trimmed = in.trim(start,end)
  22.         return Show10(trimmed,a,b,c,d)
  23.     } else {
  24.     return in.trim(start,end).selectevery(10,a,b,c,d,d)
  25.     }
  26. }
  27.  
  28. function Show10(clip in, int "first", int "second", int "third", int "fourth") {
  29.     for (n = 0, 10) {
  30.         m = string(n)
  31.         w = round(in.width * 0.75)
  32.         h = round(in.height * 0.75)
  33.         dim = "(" + string(w) + "," + string(h) + ")"
  34.         eval("frame" + m + "=in.selectevery(10," + m + ")")
  35.         eval("frame" + m + "=frame" + m + ".bicubicresize" + dim)
  36.         eval("frame" + m + "=frame" + m + """.subtitle("""" + m + """",x=10,y=6)""")
  37.     }
  38.  
  39.     if (defined(first)) {
  40.         eval(highlightStr(first))
  41.     }
  42.     if (defined(second)) {
  43.         eval(highlightStr(second))
  44.     }
  45.     if (defined(third)) {
  46.         eval(highlightStr(third))
  47.     }
  48.     if (defined(fourth)) {
  49.         eval(highlightStr(fourth))
  50.     }
  51.  
  52.     k = blankclip(frame0,1)
  53.     t = stackhorizontal(frame0,frame1,frame2,frame3)
  54.     m = stackhorizontal(frame4,frame5,frame6,k)
  55.     b = stackhorizontal(frame7,frame8,frame9,k)
  56.     return stackvertical(t,m,b)
  57. }
  58.  
  59. function highlightStr(int n) {
  60.     m = string(n)
  61.     return "frame" + m + "=highlightEdge(frame" + m + ")"
  62. }
  63.  
  64.  
  65. function highlightEdge(clip in)
  66. {
  67.     return(in.crop(4,4,-4,-2).addborders(4,4,4,2,color=color_red))
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement