Closed eraldhaka closed 7 years ago
-ss seeks to position(time from where we want to start cutting video) -t limit the duration of data read from the input file(duration from cutting start position time upto which we want to cut video)
So if you want to cut video from 5 to 8 seconds ,value of -ss should be 5 and value of -t should be 3. Are you using that?
I am using this code: String[] complexCommand = {"-i", yourRealPath, "-ss", "" + startMs / 1000,"-acodec", "copy","-vcodec","copy", "-t", "" + endMs / 1000, dest.getAbsolutePath()};
Where "yourRealPath" is original path (in my case 10 sec video) startMs = 5000 (5000/1000= 5sek) endMs = 8000 (8000/1000= 8sek) "-acodec", "copy","-vcodec","copy" is the code that you said for copy dest.getAbsolutePath() is new path that should be 3sec
Can you please tell me where is my mistake in this code? If there is can you please write an simple code example? Thank you
As you can see in my project and tutorial, -t
should be (endMs - startMs)
.
So,it should be-
String[] complexCommand = {"-i", yourRealPath, "-ss", "" + startMs / 1000,"-acodec", "copy","-vcodec","copy", "-t", "" + (endMs - startMs)/ 1000, dest.getAbsolutePath()};
Thank you for your explanation and your patience.
I have a 10 seconds video, I want to cut from second 5 to second 8, after cutting the video is saved from second 5 to second 10.. can you please take a look to this problem?