android - 单个命令可在一个视频中裁剪、动画(效果)和添加图像和文本
问题描述
我想创建一个可以执行单个操作的命令。
我有几个单独运行良好的命令
添加背景音乐命令
String[] command = {"-i", inputPath, "-i",
audioPath, "-filter_complex", "amix", "-preset",
"ultrafast", "-vcodec", "libx264", outputPath};
多重图像叠加命令
String[] command = {"-i", inputPath, "-i",
audio.getAbsolutePath(), "-i", image1,
"-i", image2, "-i", image3, "-
filter_complex","[0][1]overlay=x=W/2-w/2:y=H/2-
h/2:enable='between(t,2,10)'[v1];[v1][2]overlay=x=W/2-w/2:y=H/2-
h/2:enable='between(t,10,20)'[v2];[v2][3]overlay=x=W/2-w/2:y=H/2-
h/2:enable='gt(t,20)'[v3]","-map", "[v3]", outputPath};
图像叠加命令
String[] command = {"-i", inputPath, "-i",
image,"-filter_complex","overlay=(main_w-overlay_w)/2:
(main_h-overlay_h)/2","-codec:a", "copy", outputPath};
裁剪命令
String[] command = {"-i", inputPath, "-filter:v", "crop=iw/2:ih:"
+ 0 + ":" + 0, "-c:a", "copy", outputPath};
影响
String[] command = {"-i", inputPath, "-loop", "1", "-t", "2", "-
i", image1, "-loop", "1", "-t", "2", "-i",
image2, "-filter_complex", "
[0]boxblur=enable='lt(t,2)+gt(t,10)'[vid];
[1:v]format=rgba,fade=in:st=0:d=0.5:alpha=1,
fade=out:st=1.5:d=0.5:alpha=1[img1];
[2:v]format=rgba,fade=in:st=0:d=0.5:alpha=1,
fade=out:st=1.5:d=0.5:alpha=1,setpts
=PTS+10/TB[img2];[vid][img1]overlay=(main_w-overlay_w)/2:(main_h-
overlay_h)/2[bkg];[bkg][img2]overlay=(main_w-overlay_w)/2:(main_h-
overlay_h)/2", "-preset", "ultrafast", "-c:a", "copy", outputPath};
但我不知道如何将这一切组合成一个命令。请帮帮我。
提前致谢。
解决方案
推荐阅读
- google-apps-script - 如何将上下文菜单项添加到 Gmail 插件中的省略号菜单?
- powershell - 无法在 powershell 中安装模块 Power BI
- r - 长向量 stringdist 包 R
- android - 如何在Android的xml中将不同的字符串与另一个字符串拼接?
- html - 合并R中的html文件,文件名作为标题
- java - Jsoup.Element.text() 未正确编码 utf-8
- php - 致命错误:找不到 CakePHP 核心
- java - 错误:java.io.IOException:流已关闭 - HSM
- python - What is the most idiomatic way of generating A1 reference style column names?
- log4j2 - dynamodb 本地:错误 StatusLogger Log4j2 找不到日志记录实现