2016-05-01 5 views
0

私はアンドロイドでビデオ編集用にFFmpegを使用しています。オーバーレイのFFmpegを使用して1つのコマンドでトリミング、トリミング、オーバーレイを追加する方法

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

トリムのために

command = new String[]{"-i",inputVideoFilePath,"-ss","00:00:30.0","-c","copy","-t","00:00:10.0",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}; 

けど、私は、作物をトリミングし、コマンドの下に使用してオーバーレイを追加することができていますこれらのコマンドを単一のコマンドにマージすることはできません。 私を助けてください。

答えて

3

使用

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}; 

filter_complexは1つが直列または並列に異なる入力に複数のフィルタリング動作を実行することを可能にします。

+0

Thanx for help。私はこれを試してみる。 – ultimate

+0

が完璧に動作しているので、処理時間を短縮する方法はありません。 – ultimate

関連する問題