Advertisement
Guest User

Script HD & SD

a guest
Jan 28th, 2011
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #The SD and HD encoding script
  2. #Modifed by mmarks
  3. #I added parts of Mister Epic scripts and others than are mine
  4. function Logo (clip orig, string image, int start, int length, int "fadein", int "fadeout", int "trans", int "x", int "y", int "threshold" )
  5. {
  6. trans = Default(trans, 0)
  7. fadein = Default(fadein, 0)
  8. fadeout = Default(fadeout, 0)
  9. x = Default(x, 0)
  10. y = Default(y, 0)
  11. threshold = Default(threshold, 0)
  12. framerate = orig.framerate()
  13. overlay = ImageReader(image, 0, length-1, framerate, false)
  14. mask= overlay.ConvertToRGB32().ColorKeyMask(trans, threshold).ShowAlpha().FadeIO(fadein,fadeout)
  15. numframes = overlay.framecount()
  16. origclip = orig.Trim(start, start+length-1)
  17. newclip = Overlay(origclip,overlay,x=x, y=y, mask=mask)
  18. return orig.Trim(0, start - 1) + newclip + orig.Trim(start + numframes, 0)
  19. }
  20.  
  21. a = AVISource("movie.avi").ConvertToRGB24()
  22.  
  23. #This sets the start time for the subtitles to start displaying, this is set as a frame number
  24. subff = 905
  25.  
  26. #Set this to false for SD encodes, set this to true for HD encodes
  27. isthishd = true
  28.  
  29. #Set this to true if this is a handheld console to disable aspect correction
  30. #This setting has no affect on the aspect of SD encodes, but is still needed to change the logo
  31. handheld = true
  32.  
  33. #High Definition
  34. isthishd ? Eval("""
  35. factor = (a.height > 540) ? 1 : \
  36.         (a.height > 270) ? 2 : \
  37.         (a.height > 180) ? 3 : 4
  38. b = a.PointResize(a.width * factor, a.height * factor)
  39.  
  40. c = handheld ? b : ((b.width < b.height * 4 / 3) ? b.PointResize(b.height * 4 / 3, b.height) : b.PointResize(b.width, b.width * 3 / 4))
  41. g = c.PointResize(c.width * 2, c.height * 2)
  42.  
  43. multi = (factor * 2)
  44.  
  45. #Standard Definition
  46. """) : Eval("""
  47. g = a.PointResize(a.width * 1, a.height * 1)
  48. multi = 1
  49. """)
  50.  
  51. #Logo stuffs
  52. #Note that if this is a handheld console, you will need to change the .png filename to the corrosponding consoles
  53. #logo image, this is so that you don't end up with a distorted logo
  54. handheld ? Eval("""
  55. d = ImageSource(file="logoHD.png", start=0, end=119, fps=a.FrameRate).ConvertToRGB24()
  56. """) : Eval("""
  57. d = ImageSource(file="logoHD.png", start=0, end=119, fps=a.FrameRate).ConvertToRGB24()
  58. """)
  59. logoaudio = WAVSource("logoaudio.wav")
  60. muxedlogo = AudioDub(d, logoaudio).Lanczos4Resize(g.width, g.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
  61. e = BlankClip(d, audio_rate=a.AudioRate, channels=a.AudioChannels)
  62. f = AudioDub(d, e).Lanczos4Resize(g.width, g.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
  63. last = f + g
  64.  
  65. LoadPlugin("SubtitleEx.dll")
  66. SubtitleEx("Robocop Interactive Game|Played by AKheon|Playing time: 11:04.78|Rerecord count: 9701", x = -3, y = -15, firstframe = 830, lastframe = 1100, size = 95, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  67. SubtitleEx("Robocop Interactive Game|Played by AKheon|Playing time: 11:04.78|Rerecord count: 9701", x = -4, y = -16, firstframe = 830, lastframe = 1100, size = 95, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  68. SubtitleEx("Robocop Interactive Game|Played by AKheon|Playing time: 11:04.78|Rerecord count: 9701", x = -5, y = -17, firstframe = 830, lastframe = 1100, size = 95, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  69. SubtitleEx("Robocop Interactive Game|Played by AKheon|Playing time: 11:04.78|Rerecord count: 9701", x = -6, y = -18, firstframe = 830, lastframe = 1100, size = 95, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  70. SubtitleEx("Robocop Interactive Game|Played by AKheon|Playing time: 11:04.78|Rerecord count: 9701", x = -7, y = -19, firstframe = 830, lastframe = 1100, size = 95, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  71. SubtitleEx("Robocop Interactive Game|Played by AKheon|Playing time: 11:04.78|Rerecord count: 9701", x = -8, y = -20, firstframe = 830, lastframe = 1100, size = 95, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  72. SubtitleEx("This is a tool-assisted recording.|For details, see http://TASVideos.org/", x = -3, y = -30, firstframe = 1101, lastframe = 1330, size = 85, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  73. SubtitleEx("This is a tool-assisted recording.|For details, see http://TASVideos.org/", x = -4, y = -31, firstframe = 1101, lastframe = 1330, size = 85, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  74. SubtitleEx("This is a tool-assisted recording.|For details, see http://TASVideos.org/", x = -5, y = -32, firstframe = 1101, lastframe = 1330, size = 85, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  75. SubtitleEx("This is a tool-assisted recording.|For details, see http://TASVideos.org/", x = -6, y = -33, firstframe = 1101, lastframe = 1330, size = 85, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  76. SubtitleEx("This is a tool-assisted recording.|For details, see http://TASVideos.org/", x = -7, y = -34, firstframe = 1101, lastframe = 1330, size = 85, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  77. SubtitleEx("This is a tool-assisted recording.|For details, see http://TASVideos.org/", x = -8, y = -35, firstframe = 1101, lastframe = 1330, size = 85, effects = "f(50,50)", textcolor = $00FFFFFF, halocolor = $80000000)
  78.  
  79. #This activates the frame dropper for HD encodes, set to either 30fps or 25fps
  80. #This depends on if the game simulates transperancy with alternating frame flicker
  81. #The frame dropper saves filesize without image loss, because YouTube caps at 30fps
  82. isthishd ? Eval("""
  83. ChangeFPS(30)
  84. """) : Eval("""
  85. """)
  86.  
  87. #SD encodes need a resizing filter for the colourspace reduction
  88. #HD encodes need to be point resized to keep the colour information faithful
  89. ConvertToYV24(matrix="PC.601", chromaresample="point")
  90. isthishd ? Eval("""
  91. ConvertToYV12(matrix="PC.601", chromaresample="point")
  92. """) : Eval("""
  93. ConvertToYV12(matrix="PC.601", chromaresample="lanczos4")
  94. """)
  95. return last
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement