Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. picturepath = "d:\Users\Georg\Videos\VGMusic\MM3-001117.png"
  2. picturepath2 = "d:\Users\Georg\Videos\VGMusic\MM3-001801.png"
  3. picturepath3 = "d:\Users\Georg\Videos\VGMusic\MM3-003702.png"
  4. picturepath4 = "d:\Users\Georg\Videos\VGMusic\MM3-011125.png"
  5. picturepath5 = "d:\Users\Georg\Videos\VGMusic\MM3-016453.png"
  6. picturecount = 5
  7. audiopath = "C:\Users\Georg\Documents\_MUSICQUIZ\audio\megaman3-snakeman.wav"
  8.  
  9. #video = ImageSource(picturepath, 0, int(30*frames)+31, 30).Crop(0,0,0,-16)
  10.  
  11. LoadPlugin("C:\HD PVR\AvsPmod\NicAudio\NicAudio.dll")
  12.  
  13. # don't edit below this line
  14. extension = rightstr(audiopath, 4)
  15. audio = 0
  16. audio = extension == ".wav" ? WAVSource(audiopath) : audio
  17. audio = extension == ".ac3" ? NicAC3Source(audiopath) : audio
  18. audio = extension == ".mp3" ? NicMPG123Source(audiopath) : audio
  19. audio = extension == "flac" ? DirectShowSource(audiopath) : audio
  20.  
  21. # upsample if neccessary (ie. snes rip)
  22. audio = audio.SSRC(44100)
  23.  
  24. samplerate = AudioRate(audio)
  25. samples = AudioLength(audio)
  26. frames = samples/float(samplerate)
  27. video = ImageSource(picturepath, fps=30).Trim(0, -1).Loop(-1).Trim(0, (int(30*frames)+41)/picturecount)
  28. video = picturecount >= 2 ? video.Dissolve(ImageSource(picturepath2, fps=30).Trim(0, -1).Loop(-1).Trim(0, ((int(30*frames)+41)/picturecount) + 30), 30) : video
  29. video = picturecount >= 3 ? video.Dissolve(ImageSource(picturepath3, fps=30).Trim(0, -1).Loop(-1).Trim(0, ((int(30*frames)+41)/picturecount) + 30), 30) : video
  30. video = picturecount >= 4 ? video.Dissolve(ImageSource(picturepath4, fps=30).Trim(0, -1).Loop(-1).Trim(0, ((int(30*frames)+41)/picturecount) + 30), 30) : video
  31. video = picturecount >= 5 ? video.Dissolve(ImageSource(picturepath5, fps=30).Trim(0, -1).Loop(-1).Trim(0, ((int(30*frames)+41)/picturecount) + 30), 30) : video
  32. fullvideo = AudioDub(video, audio)#.BilinearResize(video.width/4, video.height/4)
  33.  
  34. # if NES resolution
  35. width = Width(fullvideo)
  36. height = Height(fullvideo)
  37. fullvideo = width == 256 && height == 224 ? fullvideo.PointResize(256*6, 224*6) : fullvideo
  38.  
  39. # enlarge to 1080p or whatever if smaller
  40. minverticalresolution = 720
  41. width = Width(fullvideo)
  42. height = Height(fullvideo)
  43. #fullvideo = height < minverticalresolution ? PointResize(fullvideo, (minverticalresolution*width)/height, minverticalresolution) : fullvideo
  44. fullvideo = height < minverticalresolution ? Lanczos4Resize(fullvideo, (minverticalresolution*width)/height, minverticalresolution) : fullvideo
  45.  
  46. # crop to valid YV12
  47. width = Width(fullvideo)
  48. height = Height(fullvideo)
  49. fullvideo = width%4 != 0 ? Crop(fullvideo, 0, 0, -(width%4), 0) : fullvideo
  50. fullvideo = height%2 != 0 ? Crop(fullvideo, 0, 0, 0, -1) : fullvideo
  51.  
  52. fullvideo = ConvertToYV12(fullvideo)
  53.  
  54. return fullvideo#.info#.Lanczos4Resize((minverticalresolution*width)/height, minverticalresolution).Crop(0, 0, -1, 0).ConvertToYV12()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement