- Регистрация
- 27.09.2018
- Сообщения
- 51
- Благодарностей
- 5
- Баллы
- 8
Вот это :
Нужно правильно вставить сюда (заменить то что мешает или не даёт выполниться)
Встал колом в этом вопросе.
Я пытался сделать так :
Код:
ffmpeg -i input.mkv -c copy -f segment -segment_time 10 -y output%03d.mkv
Код:
project.SendInfoToLog("Обрезаю видео", true);
string comand = "";
string vide_file = @project.Variables["video_file"].Value;
int video_duration = int.Parse(project.Variables["video_duration"].Value);
// Виде начинается с 30 секунды
string v_start = "30";
string v_duration = (video_duration-60).ToString();
string dir_main = project.Directory;
comand = @"-ss "+ v_start +@" -i "+ dir_main + @"\content\download\" + vide_file +@" -c copy -t "+ v_duration +@" "+ dir_main + @"\content\step1\" + vide_file;
//comand = @"-i E:\v\nfs_test.mp4 -i E:\v\logo.png -filter_complex ""overlay=5:H-h-5"" -codec:a copy E:\v\nfs_test_water1.mp4"; //
string exe = @project.Variables["exe"].Value;
Process p = new Process();
var info = p.StartInfo;
info.FileName = exe;
info.Arguments = comand;
info.CreateNoWindow = true;
info.UseShellExecute = false;
info.RedirectStandardError = true;
p = Process.Start(info);
string line;
string duration = "";
while ((line = p.StandardError.ReadLine()) != null) {
project.SendInfoToLog(line, true);
}
p.Close();
Я пытался сделать так :
Код:
project.SendInfoToLog("Обрезаю видео", true);
string comand = "";
string vide_file = @project.Variables["video_file"].Value;
int video_duration = int.Parse(project.Variables["video_duration"].Value);
// Виде начинается с 30 секунды
string v_start = "30";
string v_duration = (video_duration-60).ToString();
string dir_main = project.Directory;
comand = @"-ss "+ v_start +@" -i "+ dir_main + @"\content\download\" + vide_file +@" -c copy -f segment -segment_time 10 -y "+ dir_main + @"\content\step1\" + vide_file;
//comand = @"-i E:\v\nfs_test.mp4 -i E:\v\logo.png -filter_complex ""overlay=5:H-h-5"" -codec:a copy E:\v\nfs_test_water1.mp4"; //
string exe = @project.Variables["exe"].Value;
Process p = new Process();
var info = p.StartInfo;
info.FileName = exe;
info.Arguments = comand;
info.CreateNoWindow = true;
info.UseShellExecute = false;
info.RedirectStandardError = true;
p = Process.Start(info);
string line;
string duration = "";
while ((line = p.StandardError.ReadLine()) != null) {
project.SendInfoToLog(line, true);
}
p.Close();