Android 如何使用FFmpeg在单个命令中修剪、裁剪和添加覆盖

Android 如何使用FFmpeg在单个命令中修剪、裁剪和添加覆盖,android,video,ffmpeg,video-editing,Android,Video,Ffmpeg,Video Editing,我在android中使用FFmpeg进行视频编辑。我可以使用以下命令修剪、裁剪和添加覆盖: 对于修剪: command = new String[]{"-i",inputVideoFilePath,"-ss","00:00:30.0","-c","copy","-t","00:00:10.0",outputVideoFilePath}; 对于作物: command = new String[]{"-i",inputVideoFilePath,"-preset", "ultrafast","-f

我在android中使用FFmpeg进行视频编辑。我可以使用以下命令修剪、裁剪和添加覆盖:

对于修剪:

command = new String[]{"-i",inputVideoFilePath,"-ss","00:00:30.0","-c","copy","-t","00:00:10.0",outputVideoFilePath};
对于作物:

command = new String[]{"-i",inputVideoFilePath,"-preset", "ultrafast","-filter:v","crop=400:400:0:0","-c:a","copy", outputVideoFilePath};
对于叠加:

command = new String[]{"-i",inputVideoFilePath, "-i",overlayImagePath,"-preset", "ultrafast","-filter_complex", "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2", "-codec:a", "copy", outputVideoFilePath};
但我无法将这些命令合并到单个命令中。 请帮帮我

使用

command = new String[]{"-ss", "00:00:30.0", "-t", "00:00:10.0", "-i",inputVideoFilePath, 
          "-i",overlayImagePath, "-filter_complex",
          "[0]crop=400:400:0:0[a];[a][1]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2",
          "-preset", "ultrafast", "-codec:a", "copy", outputVideoFilePath};
滤波器复合体允许对不同的输入进行串联或并联的多个滤波操作。

使用

command = new String[]{"-ss", "00:00:30.0", "-t", "00:00:10.0", "-i",inputVideoFilePath, 
          "-i",overlayImagePath, "-filter_complex",
          "[0]crop=400:400:0:0[a];[a][1]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2",
          "-preset", "ultrafast", "-codec:a", "copy", outputVideoFilePath};

过滤器复合体允许一个人对串联或并联的不同输入执行多个过滤操作。

Thanx寻求帮助。我会试试这个。工作完美,顺便说一句,有没有办法减少处理时间。谢谢帮助。我会试试这个。工作完美,顺便说一句,有没有办法减少处理时间。