0

Actually i want to cut the video from the specific time.
This is my below code:

String args[] = new String[] {
                "ffmpeg",
                "-y",
                "-ss",
                "[start]"+start,// set start time in second
                "-t",
                "[duration]"+duration,// set duration in second
                "-i",
                Environment.getExternalStorageDirectory().getAbsoluteFile()//Curent Video path
                        + SquareVideoPath1,

                "-filter_complex",
                "scale=item", // set widthxwidth, option
                                    // 320x320,440x440,640x640(For
                                    // Instagram),720x720, 1020x120

                "-strict",
                "experimental",

                Environment.getExternalStorageDirectory().getAbsoluteFile()//Video Output path
                        + "/tomp3/water2.mp4" +outputFilePath };

        clsffmpeg.ffmpeg(args);

But the problem is how can i put start time and and time in this.

Blo
  • 11,903
  • 5
  • 45
  • 99
Jignesh Patel
  • 27
  • 1
  • 7

1 Answers1

-1

I think this video trimmer code can solve your problem

EDIT

Take a look at he video-trimmer.c inside function Java_net_video_trimmer_natives_VideoTrimmer_trim() you will find it useful (shows the ffmpeg params).

UPDATE

String args[] = new String[] { "ffmpeg"
    , "-i"
    , inputFilePath
    , "-ss"
    , startTime
    , "-t"
    , duration
    , "-vcodec"
    ,"copy"
    , "-acodec"
    , "copy"
    , outputFilePath };

Replace inputFilePath , startTime , duration , outputFilePath with proper values.

Shubhang Malviya
  • 1,525
  • 11
  • 17