Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- picturepath = "d:\Users\Georg\Videos\VGMusic\MM3-001117.png"
- picturepath2 = "d:\Users\Georg\Videos\VGMusic\MM3-001801.png"
- picturepath3 = "d:\Users\Georg\Videos\VGMusic\MM3-003702.png"
- picturepath4 = "d:\Users\Georg\Videos\VGMusic\MM3-011125.png"
- picturepath5 = "d:\Users\Georg\Videos\VGMusic\MM3-016453.png"
- picturecount = 5
- audiopath = "C:\Users\Georg\Documents\_MUSICQUIZ\audio\megaman3-snakeman.wav"
- #video = ImageSource(picturepath, 0, int(30*frames)+31, 30).Crop(0,0,0,-16)
- LoadPlugin("C:\HD PVR\AvsPmod\NicAudio\NicAudio.dll")
- # don't edit below this line
- extension = rightstr(audiopath, 4)
- audio = 0
- audio = extension == ".wav" ? WAVSource(audiopath) : audio
- audio = extension == ".ac3" ? NicAC3Source(audiopath) : audio
- audio = extension == ".mp3" ? NicMPG123Source(audiopath) : audio
- audio = extension == "flac" ? DirectShowSource(audiopath) : audio
- # upsample if neccessary (ie. snes rip)
- audio = audio.SSRC(44100)
- samplerate = AudioRate(audio)
- samples = AudioLength(audio)
- frames = samples/float(samplerate)
- video = ImageSource(picturepath, fps=30).Trim(0, -1).Loop(-1).Trim(0, (int(30*frames)+41)/picturecount)
- video = picturecount >= 2 ? video.Dissolve(ImageSource(picturepath2, fps=30).Trim(0, -1).Loop(-1).Trim(0, ((int(30*frames)+41)/picturecount) + 30), 30) : video
- video = picturecount >= 3 ? video.Dissolve(ImageSource(picturepath3, fps=30).Trim(0, -1).Loop(-1).Trim(0, ((int(30*frames)+41)/picturecount) + 30), 30) : video
- video = picturecount >= 4 ? video.Dissolve(ImageSource(picturepath4, fps=30).Trim(0, -1).Loop(-1).Trim(0, ((int(30*frames)+41)/picturecount) + 30), 30) : video
- video = picturecount >= 5 ? video.Dissolve(ImageSource(picturepath5, fps=30).Trim(0, -1).Loop(-1).Trim(0, ((int(30*frames)+41)/picturecount) + 30), 30) : video
- fullvideo = AudioDub(video, audio)#.BilinearResize(video.width/4, video.height/4)
- # if NES resolution
- width = Width(fullvideo)
- height = Height(fullvideo)
- fullvideo = width == 256 && height == 224 ? fullvideo.PointResize(256*6, 224*6) : fullvideo
- # enlarge to 1080p or whatever if smaller
- minverticalresolution = 720
- width = Width(fullvideo)
- height = Height(fullvideo)
- #fullvideo = height < minverticalresolution ? PointResize(fullvideo, (minverticalresolution*width)/height, minverticalresolution) : fullvideo
- fullvideo = height < minverticalresolution ? Lanczos4Resize(fullvideo, (minverticalresolution*width)/height, minverticalresolution) : fullvideo
- # crop to valid YV12
- width = Width(fullvideo)
- height = Height(fullvideo)
- fullvideo = width%4 != 0 ? Crop(fullvideo, 0, 0, -(width%4), 0) : fullvideo
- fullvideo = height%2 != 0 ? Crop(fullvideo, 0, 0, 0, -1) : fullvideo
- fullvideo = ConvertToYV12(fullvideo)
- return fullvideo#.info#.Lanczos4Resize((minverticalresolution*width)/height, minverticalresolution).Crop(0, 0, -1, 0).ConvertToYV12()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement