Advertisement
TheCoreyBurton

Mupen 64 Preparation Sample Script

Feb 12th, 2019
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Specify The Input File
  2. File = "dump_5k"
  3. Proxy = "dump_5k_proxy_240p"
  4.  
  5. # Variables
  6. UseProxy = True
  7. FullscreenCapture = True
  8. GameFPS = 30
  9. Pass = 0
  10.  
  11. # Load the source
  12. UseProxy && (Pass > 4) ? AVISource(Proxy + ".avi") : AVISource(File + ".avi")
  13.  
  14. # Pad the clip to ensure no frames are misaligned
  15. Last.Blankclip(Length=Int(Last.FrameRate * 4)) ++ Last ++ Last.Blankclip(Length=Int(Last.FrameRate * 4))
  16.  
  17. # Ensure the clip's FrameCount is divisible down to the game FPS
  18. Rounding = Int(Last.FrameRate / GameFPS)
  19. FrameCount = Last.FrameCount
  20. While (FrameCount % Rounding > 0) {
  21.   FrameCount = FrameCount - 1
  22. }
  23. Trim(0, FrameCount)
  24.  
  25. # Perform FixFPS incrementally
  26. (Pass == 1) ? ExactDedup(FirstPass=True, DupInfo=File + "-info480.txt", Times=File + "-times480.txt", MaxDupCount=FrameCount) : (Pass > 1) ? ExactDedup(FirstPass=False, DupInfo=File + "-info480.txt") : Last
  27. (Pass > 1) ? FixFPS(Times=File + "-times480.txt", Frames=FrameCount/2, Div=2, Mul=1).Trim(0, -FrameCount/2) : Last
  28. (Pass == 2) ? ExactDedup(FirstPass=True, DupInfo=File + "-info240.txt", Times=File + "-times240.txt", MaxDupCount=FrameCount) : (Pass > 2) ? ExactDedup(FirstPass=False, DupInfo=File + "-info240.txt") : Last
  29. (Pass > 2) ? FixFPS(Times=File + "-times240.txt", Frames=FrameCount/4, Div=2, Mul=1).Trim(0, -FrameCount/4) : Last
  30. (Pass == 3) ? ExactDedup(FirstPass=True, DupInfo=File + "-info120.txt", Times=File + "-times120.txt", MaxDupCount=FrameCount) : (Pass > 3) ? ExactDedup(FirstPass=False, DupInfo=File + "-info120.txt") : Last
  31. (Pass > 3) ? FixFPS(Times=File + "-times120.txt", Frames=FrameCount/8, Div=2, Mul=1).Trim(0, -FrameCount/8) : Last
  32. (Pass == 4) ? ExactDedup(FirstPass=True, DupInfo=File + "-info60.txt", Times=File + "-times60.txt", MaxDupCount=FrameCount) : (Pass > 4) ? ExactDedup(FirstPass=False, DupInfo=File + "-info60.txt") : Last
  33. (Pass == 5) ? FixFPS(Times=File + "-times60.txt", Frames=FrameCount/8, Div=Int(60 / GameFPS), Mul=Int(60 / GameFPS)).Trim(0, -FrameCount/8) : Last
  34.  
  35. # Crop the clip
  36. (Pass == 5) ? FullscreenCapture ? Crop(((Last.Width - (Last.Height * 4 / 3)) / 2), 0, -((Last.Width - (Last.Height * 4 / 3)) / 2), 0) : Crop(0, 0, 0, -24) : Last
  37.  
  38. # Fix the audio delay and resample
  39. (Pass == 0) || (Pass == 5) ? DelayAudio(-0.192).ResampleAudio(48000) : Last
  40.  
  41. # Trim the clip (specify these values on the 5th pass)
  42. (Pass == 5) ? Trim(0, 0) : Last
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement