Thank you for the music: Imperial Forces by Aaron Kenny
github file https://github.com/afrum/my_ffmpeg/bl...
spreadsheet for perspective practice: https://github.com/afrum/spreadsheets
changing the perspective of a video
(Stretching or squashing a video based on a quadrilateral shape you define to give the appearance of perspective)
if you imagine plotting 4 sets of x,y coordinates on a video and drawing lines from one corner to the other to make a quadrilateral shape
and then you stretch the area of this quadrilateral shape to fit the shape of the original video that is what this command does.
ffmpeg -i input.MOV -vf "perspective=0:0:W:400:0:H:W:H-400" perspective0.MOV
this first command selects a quadralateral shape the first 2 coordinates x0 and y0 which is shown as 0:0
0 for x0 coordinate means that the upper left corner moves to the right 0 pixels (it doesn't move that point)
0 for y0 coordinate means that the upper left corner moves down 0 pixels (it also doesn't move)
W:400 represents the top righ corner coordinates x1:y1
W for x1 coordinate means the coordinate for the top right corner is the same number of pixels accross as the width of the video
400 for y1 coordinate means the coordinate for the top right corner is moved down 400 pixels
0:H are the coordinates for the bottom left corner x2:y2 (H represents height in pixels of the video)
W:H-400 are the coordinates for the bottom right corner x3:y3
If you want the original image squashed to fit into the quadrilateral shape then you add the sense=destination option
ffmpeg -i input.MOV -vf "perspective=eval=0:0:W:400:0:H:W:H-400:sense=destination" perspective1.MOV
if you want a plain surrounding of the new perspective you need to add some type of border to the video
either by using pad or datagrid or drawbox any other command that works for you
ffmpeg -i input.MOV -vf drawbox,perspective=200:200:W-200:200:0:H:W:H:sense=destination perspective2.MOV
for drawbox you don't need to figure out the video's dimensions but for pad and datagrid you can use this command
to get dimensions I found at this link https://stackoverflow.com/questions/7...
ffprobe -v error -show_entries stream=width,height -of csv=p=0:s=x input.m4v
now that we know the dimensions we can do the drawgrid and perspective command together
my dimensions were 1920x1989, also notice that the thickness of the grid is 1 pixels larger than the area otherwise it doesn't work
ffmpeg -i input.MOV -vf drawgrid=1915:1075:t=6,perspective=200:200:W-200:200:0:H:W:H:sense=destination perspective2.MOV
----------------------------------------------------------------------------
Making a intro similar to Star Wars text
you can combine the rolling credits https://github.com/afrum/my_ffmpeg/bl...
drawbox and perspective options
I use drawbox twice the first drawbox makes a black background and the second one does a border
if you take one or both of the drawbox out it will give you different effects
ffmpeg -i input.MOV -vf "drawbox=t=fill,drawtext=textfile=prologue.txt:x=20:y=h-80*t:fontsize=50:fontcolor=yellow,drawbox,perspective=W/4:H/8:W-(W/4):H/8:0:H:W:H:sense=destination" prologue.MOV
---------------------------------------------------------------------------
Boomer recording the TV effect
this is a quick effect of someone recording their TV, you can probably improve on this.
this combines 4 options drawbox, drawgrid, perspective and boxblur.
drawbox gives the black backgound, drawgrid puts the lines on the TV, perspective gives impression that the cell phone recorder is not facing straigh on,
boxblur makes the gridlines less sharp.
ffmpeg -i input.MOV -vf "drawbox=t=20,drawgrid=h=10,perspective=0:0:W-(W/20):H/20:0:H:W-(W/20):H-(H/20):sense=destination,boxblur=3:1" boomertv.MOV
Watch video using ffmpeg to adjust perspective online without registration, duration hours minute second in high quality. This video was added by user A Forum 01 May 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 795 once and liked it 18 people.