View Full Version : Can anybodyhelp me with my script?
dimtim
3rd April 2004, 03:54
Hey I am a complete newb and I am just starting out scipting. What I wanted to do was load 3 videos in a row, and then add and delay a wav file. Here is my script:
video = Killaudio(UnalignedSplice(DirectShowSource("c:\myvideos\black.mpg"),DirectShowSource("c:\myvideos\ki2.mpg"),DirectShowSource("c:\myvideos\black.mpg")))
audio = Wavsource("c:\myvideos\ki.wav")
Delayaudio(2)
It doesn't load can anybody help?
stickboy
3rd April 2004, 05:58
Your problem is that you didn't do anything with the "video" and "audio" clips. You didn't tell DelayAudio which clip to act on, nor did you return a clip at the end of the script.
A fixed (and reformatted) version should look something like:
video = Killaudio( DirectShowSource("c:\myvideos\black.mpg")
\ + DirectShowSource("c:\myvideos\ki2.mpg"),
\ + DirectShowSource("c:\myvideos\black.mpg"))
audio = Wavsource("c:\myvideos\ki.wav")
AudioDub(video, audio)
Delayaudio(2)(+ is shorthand for UnalignedSplice.)
(If you're wondering, those last two lines are short for:
last = AudioDub(video, audio)
last = last.DelayAudio(2)
return last)
Another improvement is that you don't need to load black.mpg twice:
black = DirectShowSource("c:\myvideos\black.mpg")
video = Killaudio( black
\ + DirectShowSource("c:\myvideos\ki2.mpg"),
\ + black)
audio = Wavsource("c:\myvideos\ki.wav")
AudioDub(video, audio)
Delayaudio(2)
dimtim
3rd April 2004, 06:13
Hey thanks a lot. I got another question though. What the movie black really is is just black frames, but I learned that you can add black frames to the begginning and end of videos through blankclip, or blackness. If I wanted to add about 2 seconds of blackness to the begginning of my video, and 2 seconds on the end and also delay the audio 2 seconds in the begginning so its sycronized with the video what would my code look like? Here is my current code:
ki = Trim(DirectShowSource("c:\myvideos\gi.mpg"),7490,8368)
video = ki
audio = Wavsource("c:\myvideos\ki1.wav")
Audiodub(video,audio)
Any suggestions?
dimtim
4th April 2004, 08:47
hahah sorry guys forget my last clip I got another problem. Here is my current script. If I open it it says:
Splice: video formats don't match line 4
Here is my script:
black = BlankClip(length=40, width=720, height=480, pixel_type ="RGB32", fps=29, color=$000000)
espn = Trim(Directshowsource("c:/myvideos/espn/espn1.mpg"),7487,8373)
espn1 = Trim(Directshowsource("c:/myvideos/espn/espn2.mpg"),2250,3150)
Alignedsplice(black,espn,black,espn1,black)
stickboy
4th April 2004, 09:57
Your espn/espn2 clips use YUY2 pixel data, not RGB32. Plus, their frame rates are probably 29.97, not 29.
If you want to combine BlankClip with another source, it's easiest to create that other source first and then use it as a template to BlankClip. That way, BlankClip sets all that stuff for you:
espn = Trim(Directshowsource("c:/myvideos/espn/espn1.mpg"),7487,8373)
espn1 = Trim(Directshowsource("c:/myvideos/espn/espn2.mpg"),2250,3150)
black = BlankClip(espn, length=40, color=$000000)
Alignedsplice(black,espn,black,espn1,black)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.