Advertisement
Guest User

SSM Audioexport mit FFMS2

a guest
Oct 9th, 2015
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. LoadPlugin("D:\VB-Projekte\Batch VB\VB6\Plugins\FFMS2.dll")
  2.  
  3. Global achannel = 1
  4. Global arate = 44100
  5. Global abit = 16
  6.  
  7. AVIload("E:\Premiere-Dateien\portal 2 coop\portal.avi", "Auto", 0, 0)
  8. last.Trim(0, 60852)
  9. last
  10.  
  11.  
  12. Function AVIload(string file, string afps, int fpsn, int fpsd) {
  13. FFIndex (file)
  14. Clip0 = FFVideoSource(file, threads = 1).ConvertToRGB24().PointResize(640, 360)
  15. blank = clip0.BlankClip(audio_rate = arate, channels = achannel, sample_type = string(abit) + "bit").KillVideo()
  16. clip1 = AutoAudio(Clip0, blank, 1, file).AutoFPS(afps, fpsn, fpsd)
  17. Track1 = clip1.KillVideo()
  18. Track1 = Track1 + Tone(Float(Round(Float(clip1.Framecount / (clip1.framerate)) * Track1.audiorate - Track1.audiolength)) / Track1.audiorate, 0, Track1.audiorate, Track1.audiochannels, "Silence")
  19. Track1 = Track1.StereoOrMono().SSRC(arate, False).ConvertAudioToxxBit()
  20. return Audiodub(clip1, Track1)
  21. }
  22.  
  23. Function AutoFPS (Clip clip0, string afps, int fpsn, int fpsd) {
  24. rate1 = (afps == "Auto") ? (Round(Float(clip0.framerate * 1000)) / 1000) / 2 : nop()
  25. rate2 = (afps == "Auto") ? Round(clip0.framerate) / 2 : nop()
  26. rate = (afps == "Auto") ? (rate1 == rate2) ? 1 : 1001 : (afps == "Igno.") ? clip0.frameratedenominator : fpsd
  27. ratefaktor = (afps == "Auto") ? (rate == 1001) ? 1000 : 1 : nop()
  28. 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)
  29. Return clip0
  30. }
  31.  
  32. Function AutoAudio(clip clip0, clip track, int index, string file) {
  33. Try { Return AutoAudio(clip0, MixAudio(track, FFAudioSource(file, track=index).SSRC(arate, false).StereoOrMono()), index + 1, file) }
  34. Catch (Load_Error) { Return AudioDub(clip0.Subtitle("Intern: All found Tracks are " + string(index - 1)), track) }
  35. }
  36.  
  37. Function StereoOrMono(clip audio) {
  38. return (achannel == 2) ? (audio.AudioChannels >=2) ? audio.GetChannel(1,2) : audio.GetChannel(1,1) : audio.ConvertToMono()
  39. }
  40.  
  41. Function ConvertAudioToxxBit(Clip clip1) {
  42. return (abit == 8) ? clip1.ConvertAudioTo8bit() : (abit == 16) ? clip1.ConvertAudioTo16bit() : (abit == 24) ? clip1.ConvertAudioTo24bit() : clip1.ConvertAudioTo32bit()
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement