Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
5th April 2020, 14:16 | #1 | Link | |
Registered User
Join Date: Dec 2017
Posts: 4
|
Append a still image respecting aspect ratio and possibly adding borders
I'm looking to append a still image to a video clip.
I found an old thread that deals with this issue. Unfortunately I'm facing distortion problems and can't adapt the script. Gavino mentioned at the time that this script should be improved... Quote:
Can someone show me the way because abstraction is not my strong point? (such scripts probably already exist) Code:
v=DirectShowSource("F:\Vidéos\Enfants\Minuscule\gay-minus.avi") pic="D:\pic\screenshot_395.png" t=10 #[time in sec] fc=Round(t*FrameRate(v)) #frame count #################################################### # Option Zoom d=20 # start zooming n = 50 # no of frames for still endzoom = 4.0 #################################################### ImageSource(pic).ConvertToRGB32() AssumeFPS(v).Loop().Trim(0,fc-1) #~ Animate(last, d, 119, "SimpleZoomBox", 1.0, 0, 0, endzoom, (endzoom * -0.10), (endzoom * 0.9)) # Option Zoom AudioDub(BlankClip(v, length=t)) fv=last # frozen vid vasr=float(v.Height)/float(v.Width) #video aspect ratio pasr=float(fv.Height)/float(fv.Width) #picture aspect ratio nW=INT(fv.Width*(pasr*vasr)) #new Width xx=(v.Width-nW) #sum of the lateral borders Spline36Resize(nW, v.Height).AddBorders(xx/2,0,xx/2,0) #~ ConvertToYV12() #~ v ++ last #joining both clips last #only for picture clip |
|
Tags |
aspect ratio, avisynth, still image |
|
|