private void SplitButton_Click(object sender, EventArgs e) { var lines = File.ReadAllLines(txtNote.Text).ToList(); var seconds = Helper.ConvertToSeconds(lines); var extension = extensionComboBox.Text; var outputFolder = txtOutputFolder.Text; var inputFolder = txtInputFile.Text; var existingValues = Helper.checkOutputFolderForExistFiles(outputFolder, extension); for (int i = 0; i < seconds.Count; i++) { if (!existingValues.Any(p => p == i)) { if (i != seconds.Count - 1) { if (seconds[i + 1] - seconds[i] < 5) { string outputFilename = $@"{outputFolder}\{i}{extension}"; string command = $"-i \"{inputFolder}\" -ss {seconds[i]} -t {(seconds[i + 1] - seconds[i])} \"{outputFilename}\" & exit /b"; FfmpegHandler.ExecuteFFMpeg(command); } } } } }
private void LaunchCommandLineApp(string input, string outputFile) { FfmpegHandler.ExecuteFFMpeg($"-i \"{input}\" \"{outputFile}\""); }