I've searched around and found multiple solutions. I've found one that works well, but the final video ends up being too big which makes the rendering slow.
I'm giving it a 1280x720 video and want it to turn out like shown here with 720x1280 as the resolution.
-lavfi "[0:v]scale=256/81*iw:256/81*ih,boxblur=luma_radius=min(h,w)/40:luma_power=3:chroma_radius=min(cw,ch)/40:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,setsar=1,crop=w=iw*81/256"
This video ends up being 1280x2274 instead of 720x1280, everything else is fine except the speed and resolution.
-lavfi [0:v]scale=16/9*iw:16/9*ih,boxblur=luma_radius=min(h,w)/40:luma_power=3:chroma_radius=min(cw,ch)/40:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,setsar=1,crop=w=720:h=1280
This cuts the original video, but ends up being 720x1280, faster than the first solution.
-lavfi "[0:v]scale=256/81*iw:256/81*ih,boxblur=luma_radius=min(h,w)/40:luma_power=3:chroma_radius=min(cw,ch)/40:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,setsar=1,crop=w=iw*81/256,scale=720:1280"
This is the same as the first one, but it gets scaled again. It has the correct resolution, but is way to slow for my liking (only about 3.6 it/s, when I've tried other solutions which fluctuates around 35 it/s).
I guess my scaling is wrong, but I don't understand what I should multiply and divide by, to get the result I'm looking for.
Thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…