FFMPEG set -ss and -to with string

删除回忆录丶 提交于 2019-12-25 09:26:17

问题


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);

回答1:


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);


来源:https://stackoverflow.com/questions/43908697/ffmpeg-set-ss-and-to-with-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!