本文介绍了FFMPEG将-ss和-to设置为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道我可以用 -ss 开始,以 -to 结尾,但有人可以帮助我格式化以下内容,以便我可以输入 -ss
和 -to
一个字符串?
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?
-ss
来自
String start = editStart.getText().toString();
和 -to
来自
and -to
to come from
String end = editEnd.getText().toString();
这是我要编辑的ffmpeg字符串,我已经输入了 -ss
和 -to
以显示我想要上述字符串的位置。
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);
推荐答案
确定,以便您的起点和终点:
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);
这篇关于FFMPEG将-ss和-to设置为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!