private bool JoinClips()
        {
            string cmd = "-y -loglevel panic -safe 0 -f concat -i " + ProductionPathHelper.GetClipListPath(production) + " -c copy -an ";

            cmd += ProductionPathHelper.GetFullMp4Path(production);

            VCProcess ConcatenateProcess = new VCProcess(production);

            ConcatenateProcess.StartInfo.FileName               = Settings.LocalFfmpegExePath;
            ConcatenateProcess.StartInfo.CreateNoWindow         = true;
            ConcatenateProcess.StartInfo.UseShellExecute        = false;
            ConcatenateProcess.StartInfo.RedirectStandardError  = false;
            ConcatenateProcess.StartInfo.RedirectStandardOutput = false;
            ConcatenateProcess.StartInfo.Arguments              = cmd;
            bool success = ConcatenateProcess.Execute();

            if (success)
            {
                ConcatenateProcess.WaitForExit();
            }

            if (!File.Exists(ProductionPathHelper.GetFullMp4Path(production)))
            {
                FireFailureEvent(ProductionErrorStatus.PES_JOIN_CLIPS);
                return(false);
            }
            else
            {
                return(true);
            }
        }
Beispiel #2
0
        private static bool StartRendering(Job job)
        {
            string parameters = JobPathHelper.GetDeadlineJobFile(job);

            parameters += " " + Settings.LocalFusionPluginPath;
            parameters += " " + JobPathHelper.GetJobCompPath(job);

            VCProcess process = new VCProcess(job);

            process.StartInfo.FileName               = Settings.LocalDeadlineExePath;
            process.StartInfo.CreateNoWindow         = true;
            process.StartInfo.UseShellExecute        = false;
            process.StartInfo.RedirectStandardError  = true;
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.Arguments              = parameters;
            process.EnableRaisingEvents              = true;
            process.StartInfo.WindowStyle            = System.Diagnostics.ProcessWindowStyle.Minimized;

            process.Execute();
            string output = process.StandardOutput.ReadToEnd();

            job.RenderID = RenderIDParser.Parse(output);
            process.WaitForExit();
            process.Close();

            return(job.RenderID != null);
        }
        public static bool Extract(Job job, Motif motif)
        {
            IOHelper.CreateDirectory(JobPathHelper.GetLocalJobAnimatedMotifDiretory(job.Production, motif));

            string sourcePath = JobPathHelper.GetLocalJobMotifPath(job, motif);
            string targetPath = Path.Combine(JobPathHelper.GetLocalJobAnimatedMotifDiretory(job.Production, motif), @"motif_F%04d.tga");

            string parameters = "-i " + sourcePath + " " + targetPath;

            VCProcess process = new VCProcess(job);

            process.StartInfo.FileName               = Settings.LocalFfmpegExePath;
            process.StartInfo.Arguments              = parameters;
            process.StartInfo.CreateNoWindow         = true;
            process.StartInfo.UseShellExecute        = false;
            process.StartInfo.RedirectStandardError  = false;
            process.StartInfo.RedirectStandardOutput = false;
            process.StartInfo.WindowStyle            = System.Diagnostics.ProcessWindowStyle.Hidden;
            process.Execute();
            process.WaitForExit();

            motif.Frames = Directory.GetFiles(JobPathHelper.GetLocalJobAnimatedMotifDiretory(job.Production, motif), "*.tga").Length;
            //motif.Extension = ".tga";

            return(motif.Frames > 0);
        }
        private static void Encode(Job job, string parameters)
        {
            VCProcess ConcatenateProcess = new VCProcess(job);

            ConcatenateProcess.StartInfo.FileName               = Settings.LocalFfmpegExePath;
            ConcatenateProcess.StartInfo.CreateNoWindow         = true;
            ConcatenateProcess.StartInfo.UseShellExecute        = false;
            ConcatenateProcess.StartInfo.RedirectStandardError  = false;
            ConcatenateProcess.StartInfo.RedirectStandardOutput = false;
            ConcatenateProcess.StartInfo.Arguments              = parameters;
            ConcatenateProcess.Execute();
            ConcatenateProcess.WaitForExit();
            ConcatenateProcess.Close();
        }
        private bool CreateTrimmedMusic()
        {
            int durationInSeconds = 0;

            if (production.HasSpecialIntroMusic)
            {
                durationInSeconds = production.ClipDurationInSeconds;
            }
            else
            {
                durationInSeconds = production.TotalDurationInSeconds;
            }

            if (durationInSeconds == 0)
            {
                FireFailureEvent(ProductionErrorStatus.PES_CALCULATE_DURATION);
                return(false);
            }

            string cmd = "-y -loglevel panic -i " + audioData.AudioPath + " -t " + durationInSeconds + " " + ProductionPathHelper.GetTrimmedMusicPath(production);

            VCProcess MusicProcess = new VCProcess(production);

            MusicProcess.StartInfo.FileName               = Settings.LocalFfmpegExePath;
            MusicProcess.StartInfo.CreateNoWindow         = true;
            MusicProcess.StartInfo.UseShellExecute        = false;
            MusicProcess.StartInfo.RedirectStandardError  = false;
            MusicProcess.StartInfo.RedirectStandardOutput = false;
            MusicProcess.EnableRaisingEvents              = true;
            MusicProcess.StartInfo.Arguments              = cmd;
            bool success = MusicProcess.Execute();

            if (success)
            {
                MusicProcess.WaitForExit();
            }

            if (!File.Exists(ProductionPathHelper.GetTrimmedMusicPath(production)))
            {
                FireFailureEvent(ProductionErrorStatus.PES_MUX_AUDIO);
                return(false);
            }
            else
            {
                return(true);
            }
        }
Beispiel #6
0
        private void EncodeFilm(string parameters)
        {
            VCProcess process = new VCProcess(production);

            process.StartInfo.FileName               = Settings.LocalFfmpegExePath;
            process.StartInfo.Arguments              = parameters;
            process.StartInfo.CreateNoWindow         = true;
            process.StartInfo.UseShellExecute        = false;
            process.StartInfo.RedirectStandardError  = false;
            process.StartInfo.RedirectStandardOutput = false;
            bool success = process.Execute();

            if (success)
            {
                process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                process.WaitForExit();
            }
        }
Beispiel #7
0
        private bool EncodeFilms()
        {
            if (production.IsPreview)
            {
                return(true);
            }

            bool result = true;

            VCProcess process = new VCProcess(production);

            process.StartInfo.FileName               = Settings.LocalFfmpegExePath;
            process.StartInfo.Arguments              = GetParameterString();
            process.StartInfo.CreateNoWindow         = true;
            process.StartInfo.UseShellExecute        = false;
            process.StartInfo.RedirectStandardError  = false;
            process.StartInfo.RedirectStandardOutput = false;

            bool success = process.Execute();

            if (success)
            {
                process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                process.WaitForExit();
            }

            //check if all films have been created
            foreach (FilmOutputFormat format in production.Film.FilmOutputFormatList)
            {
                if (format.ID != 20)
                {
                    string filepath = FilmPathHelper.GetFilmHashPath(production, format);
                    if (!File.Exists(filepath))
                    {
                        FireFailureEvent(ProductionErrorStatus.PES_ENCODE_PRODUCTION);
                        result = false;
                        break;
                    }
                }
            }

            return(result);
        }
        private void ResizeDicative(Job thisJob, FilmOutputFormat codecFormat)
        {
            string formattedIndex = String.Format("{0:D4}", thisJob.ProductID);
            string sourcePath     = ProductionPathHelper.GetProductMp4Path(thisJob.ProductID);
            string targetPath     = ProductionPathHelper.GetProductMp4PathByOutputFormat(thisJob.ProductID, codecFormat.ID);

            string cmd = "-y -loglevel panic -i " + sourcePath + " -s " + codecFormat.Width + "x" + codecFormat.Height + " -c:v libx264 -pix_fmt yuv420p -preset ultrafast -qp 19 " + targetPath;

            VCProcess ConcatenateProcess = new VCProcess(production);

            ConcatenateProcess.StartInfo.FileName               = Settings.LocalFfmpegExePath;
            ConcatenateProcess.StartInfo.CreateNoWindow         = true;
            ConcatenateProcess.StartInfo.UseShellExecute        = false;
            ConcatenateProcess.StartInfo.RedirectStandardError  = false;
            ConcatenateProcess.StartInfo.RedirectStandardOutput = false;
            ConcatenateProcess.StartInfo.Arguments              = cmd;
            ConcatenateProcess.Execute();
            ConcatenateProcess.WaitForExit();
        }