我执行以下命令来模糊视频背景,但出现错误。
String[] complexCommand = {"-i", "" + yourRealPath, "-lavfi", "[0:v]scale=ih*16/9:-1",
"boxblur=luma_radius=min(640,356)/20", ":luma_power=1:chroma_radius=min(cw,ch)/20",
":chroma_power=1[bg]", ";[bg][0:v]", "overlay=(W-w)/2:(H-h)/2",
"crop=h=iw*9/16", "-vb", "800K", filePath};
错误:
无法为'boxblur = luma_radius = min(640,356)/ 20'找到合适的输出格式 boxblur = luma_radius = min(640,356)/ 20:无效的参数
答案 0 :(得分:0)
此代码段对我来说效果很好:
"-i", input,
"-strict", "-2",
"-filter_complex", "[0:v]scale=ih*16/9:-1,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,crop=h=iw*9/16",
"-c:v", "libx264",
"-pix_fmt", "yuv420p",
output