コード例 #1
0
        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);
        }
コード例 #2
0
 public static void GetVideoDurations(List <VideoFIle> videoFiles)
 {
     videoFiles.ForEach(singleVideo =>
     {
         singleVideo.DurationInTicks   = ValueRetriever.GetVideoInfo(singleVideo.FileName).Item3;
         singleVideo.DurationInSeconds = ValueRetriever.TickToSeconds(singleVideo.DurationInTicks);
     });
 }
コード例 #3
0
        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");
        }
コード例 #4
0
        private void MergeTogetherVideos()
        {
            this.ShuffleList();
            this.CreateMergeList();
            this.PromptSaveFile();
            this.WriteMergeList();
            var command = ValueRetriever.GetMergeCommand(this._outputLocation);

            CommandExecutor.RunCommand(command);
        }
コード例 #5
0
        public static void CreateDirectoryForFile(VideoFIle singleFile)
        {
            var outputPath = ValueRetriever.GetFileOutputPath(singleFile);

            try
            {
                Directory.CreateDirectory(outputPath);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        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); });
        }