0

I know I can set the start with -ss and end with -to but can someone please help me to format the following so that I can enter the -ss and -to with a string?

I want -ss to come from

String start = editStart.getText().toString();

and -to to come from

String end = editEnd.getText().toString();

Here is my ffmpeg string I want to edit, I have entered -ss and -to to show where I want the above strings to be.

String s = "-i" + " " + mVideoUri.toString().replace("file:///", "") + " -filter_complex [1:v][0:v]scale2ref=iw:ih[ovr][base];[ovr]colorchannelmixer=aa=0.7[ovrl];[base][ovrl]overlay[v] -ss -to -map [v]" + directoryToStore + "/" + FileName + mp4;

String[] arguments = s.split(" ");

ExecuteFFMPEG(arguments);
  • can you please clarify how you are passing values for them. And how do you execute ffmpeg. For example we do Runtime.getRuntime().exec and pass a string with full command line for ffmpeg – Olga Khylkouskaya May 12 '17 at 05:07
  • Thank you for looking at this question, please see my edit @OlgaKhylkouskaya –  May 12 '17 at 11:45
  • 1
    take a look at http://stackoverflow.com/questions/30197627/ffmpeg-android-execute You don't need to split arguments, just pass a String with -ss and -to. You specified that you can get such values formatter.format(getValueRight). – Olga Khylkouskaya May 12 '17 at 21:57

1 Answers1

0

Ok so you get your start and end point from:

String start = editStart.getText().toString();  
String end = editEnd.getText().toString();

So instead of splitting the argument do this instead:

String[] s = {"-i" ,mVideoUri.toString(),"-filter_complex","[1:v][0:v]scale2ref=iw:ih[ovr][base];[ovr]colorchannelmixer=aa=0.7[ovrl];[base][ovrl]overlay[v]","-ss","start","-to","end","-map","[v]",directoryToStore+"/"+"output.mp4"};
ExecuteFFMPEG(s);
HB.
  • 4,116
  • 4
  • 29
  • 53