View Single Post
Old 30th July 2010, 16:34   #8  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
for aspect ratio corrected image clip only or with joined image and video clip - this is extended Gavino script - if You wish You can go further and improve script by Your self

Code:
picsrc="yyy.jpg"
vidsrc="test.avi"

t=10.0 #[time in sec]
vd=DirectShowSource(vidsrc)
fc=Round(t*FrameRate(vd))

fv=ImageSource(picsrc).AssumeFPS(vd).Loop().Trim(0,fc-1).ConvertToRGB32()
fa=Tone(length=t, type="Silence", samplerate=AudioRate(vd), channels=AudioChannels(vd))
AudioDubEx(fv,fa)

vasr=float(vd.Height)/float(vd.Width)
pasr=float(fv.Height)/float(fv.Width)
nW=INT(fv.Width*(pasr*vasr))
xx=(vd.Width-nW)
Spline36Resize(nW, vd.Height).AddBorders(xx/2,0,xx/2,0)

#ConvertToYV12()

#last ++ vd #joining both clips
last #only for picture clip
pandy is offline   Reply With Quote