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 void GetVideoDurations(List <VideoFIle> videoFiles) { videoFiles.ForEach(singleVideo => { singleVideo.DurationInTicks = ValueRetriever.GetVideoInfo(singleVideo.FileName).Item3; singleVideo.DurationInSeconds = ValueRetriever.TickToSeconds(singleVideo.DurationInTicks); }); }
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"); }
private void MergeTogetherVideos() { this.ShuffleList(); this.CreateMergeList(); this.PromptSaveFile(); this.WriteMergeList(); var command = ValueRetriever.GetMergeCommand(this._outputLocation); CommandExecutor.RunCommand(command); }
public static void CreateDirectoryForFile(VideoFIle singleFile) { var outputPath = ValueRetriever.GetFileOutputPath(singleFile); try { Directory.CreateDirectory(outputPath); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void MergeVideos() { if (!this.CanPerformMerge()) { return; } ////TODO: Merge the Videos this._videoFiles = ValueRetriever.GetVideoFiles(this.Directory); if (this._videoFiles.Count == 0) { MessageBox.Show($@"No Files Found Inside of: {this.Directory}"); return; } ValueRetriever.GetVideoDurations(this._videoFiles); //// This auto updates the List Objects this.MergeTogetherVideos(); }
public void SplitVideos() { if (!this.CanPerformSplit()) { return; } this._timeInterval = ValueRetriever.GetTimeInterval(); this._videoFiles = ValueRetriever.GetVideoFiles(this.Directory); if (this._videoFiles.Count == 0) { MessageBox.Show($@"No Files Found Inside of: {this.Directory}"); return; } ValueRetriever.GetVideoDurations(this._videoFiles); //// This auto updates the List Objects this._videoFiles.ForEach(singleFile => { this.SplitVideoIntoChunks(singleFile, this._timeInterval); }); }