madhavanmalolan / ffmpegandroidlibrary

One line integration for FFMPEG Library in Android
MIT License
90 stars 15 forks source link

Error in merging videos #29

Open nauman415 opened 6 years ago

nauman415 commented 6 years ago

String intermediate1 = getExternalFilesDir(null).getAbsoluteFile()+"/intermediate1.ts"; String intermediate2 = getExternalFilesDir(null).getAbsoluteFile()+"/intermediate2.ts"; String filein = getExternalFilesDir(null).getAbsoluteFile()+"/in.mp4"; String fileout = getExternalFilesDir(null).getAbsoluteFile()+"/out.mp4"; String fileouts = getExternalFilesDir(null).getAbsoluteFile()+"/outs.mp4"; /****/ Controller.getInstance().run(new String[]{ "-i", filein, "-c", "copy", "-bsf:v h264_mp4toannexb", "-f", "mpegts",

            intermediate1
    });
    Controller.getInstance().run(new String[]{
            "-i",
            fileout,
            "-c",
            "copy",
            "-bsf:v h264_mp4toannexb",
            "-f",
            "mpegts",

            intermediate2
    });

[https://trac.ffmpeg.org/wiki/Concatenate] /*****/ below is your code

from this files are created but not merge into 1 file

Controller.getInstance().run(new String[]{ "-f", "-i", filein, "-vcodec", "copy", "-an", intermediate2 }); Controller.getInstance().run(new String[]{ "-f", "-i", fileout, "-vcodec", "copy", "-an", intermediate1 }); Controller.getInstance().run(new String[]{ "-i", "concat:"+intermediate1+"|"+intermediate2, "-c", "copy", "-bsf:a aac_adtstoasc", fileouts }); Application is closed when this code is run Please help