FFmpeg: How to convert horizontal video 16:9 to vertical video 9:16, with blurred background on top and bottom sides

后端 未结 2 882
孤城傲影
孤城傲影 2021-01-14 14:33

I know there is a post to do the contrary: FFmpeg: How to convert vertical video with black sides, to video 16:9, with blurred background sides

but i can\'t figure o

相关标签:
2条回答
  • 2021-01-14 15:21

    I adapted solution proposed by Mulvya

    here is the final result:

    ffmpeg -i input.mp4 -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"  output.mp4
    
    0 讨论(0)
  • 2021-01-14 15:23

    Adapted from the linked thread:

    ffmpeg -i input.mp4 -lavfi "[0:v]scale=iw:2*trunc(iw*16/18),boxblur=luma_radius=min(h\,w)/20:luma_power=1:chroma_radius=min(cw\,ch)/20:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,setsar=1" {-other parameters} output.mp4
    
    0 讨论(0)
提交回复
热议问题