Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
469 views
in Technique[技术] by (71.8m points)

android-ffmpeg - FFmpeg在Android中的视频上叠加多个图像/ gif?(FFmpeg overlay multiple images/gif on video in android issue?)

I am trying to place multiple images/gif on video.

(我正在尝试在视频上放置多个图像/ gif。)

I had tried placing single gif on image or video and its working perfectly fine but not able to work with multiple images.

(我曾尝试将单个gif放在图像或视频上,其效果很好,但无法处理多个图像。)

Tried below code but getting error:

(尝试以下代码,但出现错误:)

        String[] newCmd = new String[17];
        newCmd[0]="-i";
        newCmd[1]="storage/emulated/0/DCIM/ScreenRecorder/Video1.mp4";
        newCmd[2]="-i";
        newCmd[3]=thumbnail;
        newCmd[4]="-i";
        newCmd[5]=thumbnail;
        newCmd[6]="-i";
        newCmd[7]=thumbnail;
        newCmd[8]="-filter_complex";
        newCmd[9]="[0][1]overlay=50:50:enable='between(1,23,27)'[v1]";
        newCmd[10]="[v1][2]overlay=60:60:enable='between(1,44,61)'[v2]";
        newCmd[11]="[v2][3]overlay=70:70:enable='gt(1,112)'[v3]";
        newCmd[12]="-map";
        newCmd[13]="[v3]";
        newCmd[14]="-map";
        newCmd[15]="0:a";
        newCmd[16]="/storage/emulated/0/Pictures/logo-1111.mp4";


        fFmpeg.execute(newCmd,
                new ExecuteBinaryResponseHandler() {

                    @Override
                    public void onStart() {
                        //for logcat
                        Log.w(TAG,"Cut started");
                    }

                    @Override
                    public void onProgress(String message) {
                        //for logcat
                        Log.w(TAG,message.toString());
                    }

                    @Override
                    public void onFailure(String message) {

                        Log.w(TAG,message.toString());
                        Toast.makeText(getApplicationContext(),"Error",Toast.LENGTH_SHORT).show();

                    }

                    @Override
                    public void onSuccess(String message) {

                        Log.w(TAG,message.toString());
                        Toast.makeText(getApplicationContext(),"sucessfully saved",Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void onFinish() {

                        Log.w(TAG,"Cutting video finished");
                    }
                });

Error I am getting is:

(我得到的错误是:)

[NULL @ 0xa9a1ce00] Unable to find a suitable output format for '[v1][2]overlay=60:60:enable='between(1,44,61)'[v2]'
[v1][2]overlay=60:60:enable='between(1,44,61)'[v2]: Invalid argument

As I am new to ffmpeg please help me to resolve the issue

(由于我是ffmpeg的新手,请帮助我解决问题)

  ask by Shweta Patil translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...