View Full Version : Making Videos with Background
jay123210599
18th October 2024, 19:28
How do I make these types of videos where the actual video is surrounded by the background? Like these, for example.
https://www.youtube.com/watch?v=QaGh_YOCytQ
https://www.youtube.com/watch?v=liQA8Suu4GA
StainlessS
19th October 2024, 12:13
This any good for a starter,
A=Colorbars().Killaudio.ShowFrameNumber
W=A.Width
H=A.Height
B=A.Invert.FlipHorizontal.Spline36Resize(W/2,H/2)
A.Overlay(B,x=W/4,y=H/4,Opacity=1.0)
https://i.postimg.cc/XZtjBtg9/New-Text-Document-5-00.jpg (https://postimg.cc/XZtjBtg9)
EDIT:
Do not try this one.
# BouncingBallMovie.avs
Function Elliptical_Marker(clip c,int W, Int H,Bool "Soft") {
# Req mt_tools_2, Returns YV12 frame WxH same FPS as c and without audio
Soft=Default(Soft,False)
# INFIX_H="(((x-.5)^2 +(y-.5)^2) < .25 ? 255 : 0" # INFIX: Elliptical Disk (Hard Edge) :: mode = "relative", Radius=0.5, Rad^2=0.25 :: SOFT_Inner rad:(Rad*0.9)^2~=0.2
# INFIX_S="((x-.5)^2+(y-.5)^2)<.2?255:(((x-.5)^2+(y-.5)^2)<.25?(.25-((x-.5)^2+(y-.5)^2))*5100):255" # INFIX: Elliptical Disk (Soft Edge) :: (.25-0.2)*5100=255 : (.25-.25)*5100=0.0] :: mode="relative", 0.25=1.0 : 0.2~=0.9
rpn = (!Soft)
\ ? "x 0.5 - 2 ^ y 0.5 - 2 ^ + 0.25 < 255 0 ?" [* RPN: Elliptical Disk [Hard Edge] *]
\ : "x 0.5 - 2 ^ y 0.5 - 2 ^ + 0.2 < 255 x 0.5 - 2 ^ y 0.5 - 2 ^ + 0.25 < 0.25 x 0.5 - 2 ^ y 0.5 - 2 ^ + - 5100 *" [* RPN: Elliptical Disk [Soft Edge] *]
c.Blankclip(width=W,height=H,Length=1,pixel_type="YV12").Killaudio
return Last.mt_lutspa(mode = "relative", expr = rpn, chroma = "-128" )
}
Function DrawBounce(clip c) { # Physical window coords
Squash = (G_bounceY == 0)
B = (Squash) ? G_Squashed_Ball : G_Ball
Xrel = (b.Width - G_Ball.Width) / 2
phyX = Round(G_bounceX * (c.Width - G_Ball.Width - xrel))
phyY = Round((1.0 - G_bounceY) * c.Height) - B.Height
(G_Sym.IsClip)
\ ? c.Overlay(Squash?G_Sym_Squashed:G_Sym,x=phyX,y=phyY,mask=B)
\ : c.OverLay(B.BlankClip(Color=G_BALLCOLOR,Length=1),x=phyX,y=phyY,Mask=B)
return Last
}
Function MoveBounce(clip c) { # Logical coords (0.0 -> 1.0, cartesian)
bX = G_bounceX + G_bounceXstep
Global G_bounceXstep = (0.0 < bX < 1.0) ? G_bounceXstep : -G_bounceXstep # Wall Bounce, Switch direction next time
Global G_bounceX = (0.0 > bX) ? 0.0 : (bX > 1.0) ? 1.0 : bX
bY = Sin(G_bounceAngle) * G_bounceMax
Global G_bounceY = (bY < 0.0) ? 0.0 : bY
bAng = G_bounceAngle + G_bounceAngleStep
Global G_bounceAngle = (bAng > PI) ? 0.0 : bAng
return c.DrawBounce
}
Function RandF() {return Rand / 32767.0}
######
#Avisource("F:\V\SexInTheCity.avi")
#Avisource("F:\V\XMen2.avi")
ColorBars.ShowFrameNumber.KillAudio
Rand(Seed=True)
###
Global G_BALLCOLOR = $C020FF
BALLSZ = 128
SQUISH = 8
SOFT = True
SYM = True # False = Plain bouncing ball
### GENERAL CONTROL for bouncer (1.0=norm)
SPEED = 1.0
BOUNCEHEIGHT = 1.0
###
Global G_bounceMax = BOUNCEHEIGHT * (1.0-Float(BALLSZ)/Height)
Global G_bounceXstep = 0.005 * SPEED # Xpos increment
Global G_bounceAngleStep = (0.01 + RandF * 0.04) * SPEED # Step angle
### Start pos
Global G_bounceX = RandF # Current X position
Global G_bounceY = RandF # Current Y position
Global G_bounceAngle = RandF * PI
######
Global G_Ball = Last.Elliptical_Marker(BALLSZ,BALLSZ,SOFT)
Global G_Squashed_Ball = Last.Elliptical_Marker(BALLSZ+SQUISH,BALLSZ-SQUISH,SOFT)
Global G_Sym = (SYM) ? BilinearResize(BALLSZ,BALLSZ) : 0
Global G_Sym_Squashed = (SYM) ? BilinearResize(G_Squashed_Ball.Width,G_Squashed_Ball.Height): 0
ScriptClip("return MoveBounce")
EDIT: Some Avisynth demo stuff linked here:- https://forum.doom9.org/showthread.php?p=1858424#post1858424
EDIT: My Favourite Hanfunz xmas demo
function p(float len, float freq){return audiodub(BlankClip(length=int(len*24), width=800,height=288, pixel_type="rgb32",fps=24, color=int((freq-271.0)/1.72)),tone(len,freq,channels=1,level=1.0).FadeIO0(1,0,24))}
function q(float len, float freq){return tone(len,freq,channels=1,level=0.5).FadeIO0(1,0,24)}
c=261.6255653006
D=293.6647679174
E=329.6275569129
F=349.2282314330
G=391.9954359817
A=440.00000000001
B=493.8833012561
c2=c*2.0
d2=d*2.0
e2=e*2.0
f2=f*2.0
g2=g*2.0
N1=1.0
N2=0.5
N4=0.25
BlankClip(length=576, width=400,height=400, pixel_type="rgb32",fps=24, color=0).subtitle(" . * . * ",y=50,size=46,align=5, font="Courier New").subtitle(" . * . ",y=50+30*1,size=46,align=5, font="Courier New").subtitle("* . . * ",y=50+30*2,size=46,align=5, font="Courier New").subtitle(" . . .",y=50+30*3,size=46,align=5, font="Courier New").subtitle(" . . * . ",y=50+30*4,size=46,align=5, font="Courier New").subtitle(" * . * ",y=50+30*5,size=46,align=5, font="Courier New").subtitle(" . * . ",y=50+30*6,size=46,align=5, font="Courier New").subtitle("* . . * ",y=50+30*7,size=46,align=5, font="Courier New").subtitle(" . . .",y=50+30*8,size=46,align=5, font="Courier New").subtitle(" . . * . ",y=50+30*9,size=46,align=5, font="Courier New").greyscale().GeneralConvolution(0, "5 10 10 10 5 10 10 5 10 10 5 10 10 10 5 10 10 10 10 10 5 10 10 10 5 ", 200, false).crop(0,10,0,-076)
stackvertical(last,last,last,last)
sn= Animate(0,576,"Bicubicresize",stackhorizontal(last,last,last), 800,288, 1./3.,1./3., 576./3., 1256.-288.-200.,800,288, stackhorizontal(last,last,last), 800,288, 1./3.,1./3., 0., 0.,800,280)
sn2=sn.crop(100,100,0,0).bicubicresize(800,288)
mixaudio(p(N4,E2)+p(N4,E2)+p(N2,E2)+p(N4,E2)+p(N4,E2)+p(N2,E2)+p(N4,E2)+p(N4,G2)+p(N4,C)+p(N4,D2)+p(N1,E2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,E2)+p(N4,E2)+p(N4,E2)+p(N4,E2)+p(N4,D2)+p(N4,D2)+p(N4,E2)+p(N2,D2)+p(N2,G2)+p(N4,E2)+p(N4,E2)+p(N2,E2)+p(N4,E2)+p(N4,E2)+p(N2,E2)+p(N4,E2)+p(N4,G2)+p(N4,C)+p(N4,D2)+p(N1,E2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,E2)+p(N4,E2)+p(N4,E2)+p(N4,G2)+p(N4,G2)+p(N4,F2)+p(N4,D2)+p(N1,C),q(N2,C)+q(N2,g)+q(N2,C)+q(N2,g)+q(N2,g)+q(N2,a)+q(N2,g)+q(N2,C)+q(N2,A)+q(N2,B)+q(N2,g)+q(N2,g)+q(N2,a)+q(N2,g)+q(N4,b)+q(N4,g)+q(N4,a)+q(N4,b)+q(N2,C)+q(N2,g)+q(N2,C)+q(N2,g)+q(N2,a)+q(N2,g)+q(N2,C)+q(N2,g)+q(N2,b)+q(N2,g)+q(N2,C)+q(N2,g)+q(N4,b)+q(N4,g)+q(N4,a)+q(N4,b)+q(N1,c2)).subtitle("I wish all avisynth developers and users\n a merry christmas and a happy new year!\n\n(hanfrunz 2015)", align=5, lsp=10, text_color=$ffff00, halo_color=$ff0000)
audiodub(mixaudio(tone(5.0, 400.0,channels=1), mixaudio(tone(5.0, 200.0,type="Triangle",channels=1),tone(5.0, 300.0,type="Triangle",channels=1)) ).fadein(100).fadeout(30), BlankClip(length=24*5,width=800-4,height=288-4, pixel_type="rgb32",fps=24, color=$000000).subtitle("presented in Ultra Panavision 70",align=5,size=28,text_color=$dfdfdf).fadeIO2(25).addborders(2,2,2,2, color=$dfdfdf)) + overlay(last, sn ,mode="blend", opacity=0.25 ).overlay(sn2,mode="blend", opacity=0.25).crop(2,2,-2,-2).addborders(2,2,2,2, color=$dfdfdf)
#
return last
A=Colorbars().Killaudio.ShowFrameNumber
W=A.Width
H=A.Height
B=A.Invert.FlipHorizontal.Spline36Resize(W/2,H/2)
A.Overlay(B,x=W/4,y=H/4,Opacity=1.0)
EDIT: Here an MP4 file, BouncingBallMovie2.mp4, about 1MB on MediaFire,
https://www.mediafire.com/file/ijyrq530512tybi/BouncingBallMovie2.mp4
jay123210599
19th October 2024, 12:58
This any good for a starter,
A=Colorbars().Killaudio.ShowFrameNumber
W=A.Width
H=A.Height
B=A.Invert.FlipHorizontal.Spline36Resize(W/2,H/2)
A.Overlay(B,x=W/4,y=H/4,Opacity=1.0)
https://i.postimg.cc/XZtjBtg9/New-Text-Document-5-00.jpg (https://postimg.cc/XZtjBtg9)
EDIT:
Do not try this one.
# BouncingBallMovie.avs
Function Elliptical_Marker(clip c,int W, Int H,Bool "Soft") {
# Req mt_tools_2, Returns YV12 frame WxH same FPS as c and without audio
Soft=Default(Soft,False)
# INFIX_H="(((x-.5)^2 +(y-.5)^2) < .25 ? 255 : 0" # INFIX: Elliptical Disk (Hard Edge) :: mode = "relative", Radius=0.5, Rad^2=0.25 :: SOFT_Inner rad:(Rad*0.9)^2~=0.2
# INFIX_S="((x-.5)^2+(y-.5)^2)<.2?255:(((x-.5)^2+(y-.5)^2)<.25?(.25-((x-.5)^2+(y-.5)^2))*5100):255" # INFIX: Elliptical Disk (Soft Edge) :: (.25-0.2)*5100=255 : (.25-.25)*5100=0.0] :: mode="relative", 0.25=1.0 : 0.2~=0.9
rpn = (!Soft)
\ ? "x 0.5 - 2 ^ y 0.5 - 2 ^ + 0.25 < 255 0 ?" [* RPN: Elliptical Disk [Hard Edge] *]
\ : "x 0.5 - 2 ^ y 0.5 - 2 ^ + 0.2 < 255 x 0.5 - 2 ^ y 0.5 - 2 ^ + 0.25 < 0.25 x 0.5 - 2 ^ y 0.5 - 2 ^ + - 5100 *" [* RPN: Elliptical Disk [Soft Edge] *]
c.Blankclip(width=W,height=H,Length=1,pixel_type="YV12").Killaudio
return Last.mt_lutspa(mode = "relative", expr = rpn, chroma = "-128" )
}
Function DrawBounce(clip c) { # Physical window coords
Squash = (G_bounceY == 0)
B = (Squash) ? G_Squashed_Ball : G_Ball
Xrel = (b.Width - G_Ball.Width) / 2
phyX = Round(G_bounceX * (c.Width - G_Ball.Width - xrel))
phyY = Round((1.0 - G_bounceY) * c.Height) - B.Height
(G_Sym.IsClip)
\ ? c.Overlay(Squash?G_Sym_Squashed:G_Sym,x=phyX,y=phyY,mask=B)
\ : c.OverLay(B.BlankClip(Color=G_BALLCOLOR,Length=1),x=phyX,y=phyY,Mask=B)
return Last
}
Function MoveBounce(clip c) { # Logical coords (0.0 -> 1.0, cartesian)
bX = G_bounceX + G_bounceXstep
Global G_bounceXstep = (0.0 < bX < 1.0) ? G_bounceXstep : -G_bounceXstep # Wall Bounce, Switch direction next time
Global G_bounceX = (0.0 > bX) ? 0.0 : (bX > 1.0) ? 1.0 : bX
bY = Sin(G_bounceAngle) * G_bounceMax
Global G_bounceY = (bY < 0.0) ? 0.0 : bY
bAng = G_bounceAngle + G_bounceAngleStep
Global G_bounceAngle = (bAng > PI) ? 0.0 : bAng
return c.DrawBounce
}
Function RandF() {return Rand / 32767.0}
######
#Avisource("F:\V\SexInTheCity.avi")
#Avisource("F:\V\XMen2.avi")
ColorBars.ShowFrameNumber.KillAudio
Rand(Seed=True)
###
Global G_BALLCOLOR = $C020FF
BALLSZ = 128
SQUISH = 8
SOFT = True
SYM = True # False = Plain bouncing ball
### GENERAL CONTROL for bouncer (1.0=norm)
SPEED = 1.0
BOUNCEHEIGHT = 1.0
###
Global G_bounceMax = BOUNCEHEIGHT * (1.0-Float(BALLSZ)/Height)
Global G_bounceXstep = 0.005 * SPEED # Xpos increment
Global G_bounceAngleStep = (0.01 + RandF * 0.04) * SPEED # Step angle
### Start pos
Global G_bounceX = RandF # Current X position
Global G_bounceY = RandF # Current Y position
Global G_bounceAngle = RandF * PI
######
Global G_Ball = Last.Elliptical_Marker(BALLSZ,BALLSZ,SOFT)
Global G_Squashed_Ball = Last.Elliptical_Marker(BALLSZ+SQUISH,BALLSZ-SQUISH,SOFT)
Global G_Sym = (SYM) ? BilinearResize(BALLSZ,BALLSZ) : 0
Global G_Sym_Squashed = (SYM) ? BilinearResize(G_Squashed_Ball.Width,G_Squashed_Ball.Height): 0
ScriptClip("return MoveBounce")
EDIT: Some Avisynth demo stuff linked here:- https://forum.doom9.org/showthread.php?p=1858424#post1858424
EDIT: My Favourite Hanfunz xmas demo
function p(float len, float freq){return audiodub(BlankClip(length=int(len*24), width=800,height=288, pixel_type="rgb32",fps=24, color=int((freq-271.0)/1.72)),tone(len,freq,channels=1,level=1.0).FadeIO0(1,0,24))}
function q(float len, float freq){return tone(len,freq,channels=1,level=0.5).FadeIO0(1,0,24)}
c=261.6255653006
D=293.6647679174
E=329.6275569129
F=349.2282314330
G=391.9954359817
A=440.00000000001
B=493.8833012561
c2=c*2.0
d2=d*2.0
e2=e*2.0
f2=f*2.0
g2=g*2.0
N1=1.0
N2=0.5
N4=0.25
BlankClip(length=576, width=400,height=400, pixel_type="rgb32",fps=24, color=0).subtitle(" . * . * ",y=50,size=46,align=5, font="Courier New").subtitle(" . * . ",y=50+30*1,size=46,align=5, font="Courier New").subtitle("* . . * ",y=50+30*2,size=46,align=5, font="Courier New").subtitle(" . . .",y=50+30*3,size=46,align=5, font="Courier New").subtitle(" . . * . ",y=50+30*4,size=46,align=5, font="Courier New").subtitle(" * . * ",y=50+30*5,size=46,align=5, font="Courier New").subtitle(" . * . ",y=50+30*6,size=46,align=5, font="Courier New").subtitle("* . . * ",y=50+30*7,size=46,align=5, font="Courier New").subtitle(" . . .",y=50+30*8,size=46,align=5, font="Courier New").subtitle(" . . * . ",y=50+30*9,size=46,align=5, font="Courier New").greyscale().GeneralConvolution(0, "5 10 10 10 5 10 10 5 10 10 5 10 10 10 5 10 10 10 10 10 5 10 10 10 5 ", 200, false).crop(0,10,0,-076)
stackvertical(last,last,last,last)
sn= Animate(0,576,"Bicubicresize",stackhorizontal(last,last,last), 800,288, 1./3.,1./3., 576./3., 1256.-288.-200.,800,288, stackhorizontal(last,last,last), 800,288, 1./3.,1./3., 0., 0.,800,280)
sn2=sn.crop(100,100,0,0).bicubicresize(800,288)
mixaudio(p(N4,E2)+p(N4,E2)+p(N2,E2)+p(N4,E2)+p(N4,E2)+p(N2,E2)+p(N4,E2)+p(N4,G2)+p(N4,C)+p(N4,D2)+p(N1,E2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,E2)+p(N4,E2)+p(N4,E2)+p(N4,E2)+p(N4,D2)+p(N4,D2)+p(N4,E2)+p(N2,D2)+p(N2,G2)+p(N4,E2)+p(N4,E2)+p(N2,E2)+p(N4,E2)+p(N4,E2)+p(N2,E2)+p(N4,E2)+p(N4,G2)+p(N4,C)+p(N4,D2)+p(N1,E2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,F2)+p(N4,E2)+p(N4,E2)+p(N4,E2)+p(N4,G2)+p(N4,G2)+p(N4,F2)+p(N4,D2)+p(N1,C),q(N2,C)+q(N2,g)+q(N2,C)+q(N2,g)+q(N2,g)+q(N2,a)+q(N2,g)+q(N2,C)+q(N2,A)+q(N2,B)+q(N2,g)+q(N2,g)+q(N2,a)+q(N2,g)+q(N4,b)+q(N4,g)+q(N4,a)+q(N4,b)+q(N2,C)+q(N2,g)+q(N2,C)+q(N2,g)+q(N2,a)+q(N2,g)+q(N2,C)+q(N2,g)+q(N2,b)+q(N2,g)+q(N2,C)+q(N2,g)+q(N4,b)+q(N4,g)+q(N4,a)+q(N4,b)+q(N1,c2)).subtitle("I wish all avisynth developers and users\n a merry christmas and a happy new year!\n\n(hanfrunz 2015)", align=5, lsp=10, text_color=$ffff00, halo_color=$ff0000)
audiodub(mixaudio(tone(5.0, 400.0,channels=1), mixaudio(tone(5.0, 200.0,type="Triangle",channels=1),tone(5.0, 300.0,type="Triangle",channels=1)) ).fadein(100).fadeout(30), BlankClip(length=24*5,width=800-4,height=288-4, pixel_type="rgb32",fps=24, color=$000000).subtitle("presented in Ultra Panavision 70",align=5,size=28,text_color=$dfdfdf).fadeIO2(25).addborders(2,2,2,2, color=$dfdfdf)) + overlay(last, sn ,mode="blend", opacity=0.25 ).overlay(sn2,mode="blend", opacity=0.25).crop(2,2,-2,-2).addborders(2,2,2,2, color=$dfdfdf)
#
return last
A=Colorbars().Killaudio.ShowFrameNumber
W=A.Width
H=A.Height
B=A.Invert.FlipHorizontal.Spline36Resize(W/2,H/2)
A.Overlay(B,x=W/4,y=H/4,Opacity=1.0)
EDIT: Here an MP4 file, BouncingBallMovie2.mp4, about 1MB on MediaFire,
https://www.mediafire.com/file/ijyrq530512tybi/BouncingBallMovie2.mp4
I meant how by using video editors like Kdenlive.
StainlessS
19th October 2024, 13:01
I meant how by using video editors like Kdenlive.
Sorry, no idea.
poisondeathray
19th October 2024, 14:33
For video editors you use an "overlay" . Another term is "picture in picture". Use those search terms for step by step tutorials on youtube for your specific editor
2 tracks are used, usually the background is the bottom track (track order can be switched in some editors e.g. aviutl) , and the top track is the overlay track. You would scale the top track smaller . You can add any effects to the top or bottom track
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.