Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extend + scale a portrait video so the aspect ratio stays and the black borders become a blurry version of the video

Tags:

ffmpeg

I have a 720 x 1280 pixels video. How do I extend and scale it to 1920 x 1080 such that the aspect ratio is being kept and the black borders are a blurry version of the video, so you don't really notice that it's just a small vertical stripe.

Example

enter image description here

enter image description here

I started with

ffmpeg -i video720x1280.mp4 -vf "scale=608:1080,pad=width=1920:height=1080:x=656:y=0:color=black" video1920x1080.mp4
like image 920
Aurelius Schnitzler Avatar asked Dec 29 '25 05:12

Aurelius Schnitzler


1 Answers

Use

ffmpeg -i video720x1280.mp4
  -filter_complex
      "[0]scale=hd1080,setsar=1,boxblur=20:20[b];
       [0]scale=-1:1080[v];[b][v]overlay=(W-w)/2"   video1920x1080.mp4

Adjust the two values in the boxblur filter for blur strength. Higher = more blurring.

like image 93
Gyan Avatar answered Dec 31 '25 00:12

Gyan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!