Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
667 views
in Technique[技术] by (71.8m points)

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

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...