コード例 #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 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");
        }
コード例 #3
0
        public static void CreateDirectoryForFile(VideoFIle singleFile)
        {
            var outputPath = ValueRetriever.GetFileOutputPath(singleFile);

            try
            {
                Directory.CreateDirectory(outputPath);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #4
0
        public static string GetFileOutputPath(VideoFIle singleFile)
        {
            var endFileName = Path.GetFileName(singleFile.FileName)?.Split('.')[0];

            return(singleFile.Directory + $@"\\{endFileName}\\");
        }
コード例 #5
0
 private static string GetEndFileName(VideoFIle singleFile)
 {
     return(Path.GetFileName(singleFile.FileName)?.Split('.')[0]);
 }