| | |
| | | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| | | import com.github.xiaoymin.knife4j.core.util.StrUtil; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.Collection; |
| | |
| | | } |
| | | |
| | | public LambdaQueryWrapperX<T> eqIfPresent(SFunction<T, ?> column, Object val) { |
| | | if (ObjectUtil.isNotEmpty(val)) { |
| | | return (LambdaQueryWrapperX<T>) super.eq(column, val); |
| | | if (val != null && !(val instanceof String && StrUtil.isBlank((String) val))) { |
| | | this.eq(column, val); |
| | | } |
| | | return this; |
| | | } |
| | |
| | | // 当没有人像时,视频放在 cover 的下层 |
| | | builder = new ProcessBuilder( |
| | | "ffmpeg", |
| | | "-i", cover1, // 背景图 1 |
| | | "-i", substring1, // 视频 |
| | | "-i", cover1, // 背景图 2 |
| | | "-i", cover, // PPT内容 |
| | | "-i", cover1, // 背景图 1 |
| | | "-i", substring1, // 视频(含音频) |
| | | "-i", cover1, // 背景图 2 |
| | | "-i", cover, // PPT 内容 |
| | | "-filter_complex", |
| | | "[0:v]scale=" + Math.round(scene.getBackground().getWidth()) + ":" + Math.round(scene.getBackground().getHeight()) + "[bg1];" + |
| | | "[1:v]scale=" + Math.round(scene.getComponents().get(0).getWidth()) + ":" + Math.round(scene.getComponents().get(0).getHeight()) + "[v1];" + |
| | |
| | | "[2:v]scale=" + Math.round(scene.getBackground().getWidth()) + ":" + Math.round(scene.getBackground().getHeight()) + "[bg2];" + |
| | | "[img1][bg2]overlay=shortest=1[v2];" + |
| | | "[3:v]scale=" + Math.round(scene.getComponents().get(1).getWidth()) + ":" + Math.round(scene.getComponents().get(1).getHeight()) + "[v3];" + |
| | | "[v2][v3]overlay=x=" + Math.round(scene.getComponents().get(1).getMarginLeft()) + ":y=" + Math.round(scene.getComponents().get(1).getTop()), |
| | | newFileName2 // 输出文件名 |
| | | "[v2][v3]overlay=x=" + Math.round(scene.getComponents().get(1).getMarginLeft()) + ":y=" + Math.round(scene.getComponents().get(1).getTop()) + "[outv]", |
| | | "-map", "[outv]", |
| | | "-map", "1:a?", // 添加音频流(如果存在) |
| | | "-c:v", "libx264", // 视频编码格式(可选但推荐) |
| | | "-c:a", "aac", // 音频编码格式(可选但推荐) |
| | | "-shortest", // 让输出长度与最短流一致,避免黑屏或静音延长 |
| | | "-y", // 覆盖输出文件 |
| | | newFileName2 // 输出文件名 |
| | | ); |
| | | } |
| | | System.out.println(newFileName2); |