private void SplitVideoIntoChunks(VideoFIle singleFile, int timeInterval) { var command = ValueRetriever.GetSplitCommand(singleFile, timeInterval); CommandExecutor.CreateDirectoryForFile(singleFile); //// Create output Folder before doing Split CommandExecutor.RunCommand(command); }
public static string GetSplitCommand(VideoFIle singleFile, int timeInterval) { var ffmpegDir = "C:\\Users\\connor.jolley\\Desktop\\ffmpegDir\\"; var outputPath = ValueRetriever.GetFileOutputPath(singleFile); var endFileName = ValueRetriever.GetEndFileName(singleFile); return($@"/K {ffmpegDir}ffmpeg.exe -i {singleFile.FileName} -c copy -map 0 -segment_time {timeInterval} -f segment {outputPath}{endFileName}%03d.mp4"); }
public static void CreateDirectoryForFile(VideoFIle singleFile) { var outputPath = ValueRetriever.GetFileOutputPath(singleFile); try { Directory.CreateDirectory(outputPath); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static string GetFileOutputPath(VideoFIle singleFile) { var endFileName = Path.GetFileName(singleFile.FileName)?.Split('.')[0]; return(singleFile.Directory + $@"\\{endFileName}\\"); }
private static string GetEndFileName(VideoFIle singleFile) { return(Path.GetFileName(singleFile.FileName)?.Split('.')[0]); }