Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LoadPlugin("D:\VB-Projekte\Batch VB\VB6\Plugins\FFMS2.dll")
- Global achannel = 1
- Global arate = 44100
- Global abit = 16
- AVIload("E:\Premiere-Dateien\portal 2 coop\portal.avi", "Auto", 0, 0)
- last.Trim(0, 60852)
- last
- Function AVIload(string file, string afps, int fpsn, int fpsd) {
- FFIndex (file)
- Clip0 = FFVideoSource(file, threads = 1).ConvertToRGB24().PointResize(640, 360)
- blank = clip0.BlankClip(audio_rate = arate, channels = achannel, sample_type = string(abit) + "bit").KillVideo()
- clip1 = AutoAudio(Clip0, blank, 1, file).AutoFPS(afps, fpsn, fpsd)
- Track1 = clip1.KillVideo()
- Track1 = Track1 + Tone(Float(Round(Float(clip1.Framecount / (clip1.framerate)) * Track1.audiorate - Track1.audiolength)) / Track1.audiorate, 0, Track1.audiorate, Track1.audiochannels, "Silence")
- Track1 = Track1.StereoOrMono().SSRC(arate, False).ConvertAudioToxxBit()
- return Audiodub(clip1, Track1)
- }
- Function AutoFPS (Clip clip0, string afps, int fpsn, int fpsd) {
- rate1 = (afps == "Auto") ? (Round(Float(clip0.framerate * 1000)) / 1000) / 2 : nop()
- rate2 = (afps == "Auto") ? Round(clip0.framerate) / 2 : nop()
- rate = (afps == "Auto") ? (rate1 == rate2) ? 1 : 1001 : (afps == "Igno.") ? clip0.frameratedenominator : fpsd
- ratefaktor = (afps == "Auto") ? (rate == 1001) ? 1000 : 1 : nop()
- clip0 = (afps == "Auto") ? (rate == 1001) ? clip0.AssumeFPS(Round(clip0.Framerate) * 1000, rate) : clip0.AssumeFPS(round(clip0.framerate), rate) : (afps == "Igno.") ? clip0.AssumeFPS(clip0.frameratenumerator, rate) : clip0.AssumeFPS(fpsn, rate)
- Return clip0
- }
- Function AutoAudio(clip clip0, clip track, int index, string file) {
- Try { Return AutoAudio(clip0, MixAudio(track, FFAudioSource(file, track=index).SSRC(arate, false).StereoOrMono()), index + 1, file) }
- Catch (Load_Error) { Return AudioDub(clip0.Subtitle("Intern: All found Tracks are " + string(index - 1)), track) }
- }
- Function StereoOrMono(clip audio) {
- return (achannel == 2) ? (audio.AudioChannels >=2) ? audio.GetChannel(1,2) : audio.GetChannel(1,1) : audio.ConvertToMono()
- }
- Function ConvertAudioToxxBit(Clip clip1) {
- return (abit == 8) ? clip1.ConvertAudioTo8bit() : (abit == 16) ? clip1.ConvertAudioTo16bit() : (abit == 24) ? clip1.ConvertAudioTo24bit() : clip1.ConvertAudioTo32bit()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement