Example #1
0
        public void PrepareJobFiles(MediaEncoderSettings settings)
        {
            settings.JobIndex = ++JobIndex;
            // Files must be prepared before adding to queue so that user can replace preview files.
            PathManager.DeleteJobFiles(settings.JobIndex);
            File.Delete(PathManager.PreviewScriptFile);
            File.Delete(PathManager.PreviewSettingsFile);
            if (settings.ConvertToAvi)
            {
                PathManager.SafeMove(PathManager.PreviewSourceFile, settings.InputFile);
            }
            if (settings.Deshaker)
            {
                PathManager.SafeMove(PathManager.PreviewDeshakerLog, settings.DeshakerLog);
            }
            settings.Save(settings.SettingsFile);
            AviSynthScriptBuilder Script = new AviSynthScriptBuilder(settings.CustomScript);

            if (Script.IsEmpty)
            {
                Script = MediaEncoderScript.GenerateVideoScript(settings, settings.InputFile, false, true);
            }
            else
            {
                Script.Replace(Script.GetAsciiPath(PathManager.PreviewSourceFile), Script.GetAsciiPath(settings.InputFile));
                Script.Replace(Script.GetAsciiPath(PathManager.PreviewDeshakerLog), Script.GetAsciiPath(settings.DeshakerLog));
            }
            Script.WriteToFile(settings.ScriptFile);
            // if (settings.DeshakerSettings.PrescanAction == PrescanType.Full)
        }
Example #2
0
        public void GenerateScript(MediaEncoderSettings settings, bool preview, bool multiThreaded)
        {
            AviSynthScriptBuilder Script = new AviSynthScriptBuilder(settings.CustomScript);

            if (Script.IsEmpty)
            {
                Script = MediaEncoderScript.GenerateVideoScript(settings, GetPreviewSourceFile(settings), preview, multiThreaded);
            }
            else if (preview)
            {
                Script.RemoveMT();
                Script.AppendLine(@"ConvertToRGB32(matrix=""Rec709"")");
            }
            else if (!multiThreaded)
            {
                Script.RemoveMT();
            }
            Script.WriteToFile(PathManager.PreviewScriptFile);
            settings.Save(PathManager.PreviewSettingsFile);
        }
Example #3
0
 public bool CustomScriptHasChanges(MediaEncoderSettings settings)
 {
     return(settings.CustomScript.Replace("\r\n", "\n") != MediaEncoderScript.GenerateVideoScript(settings, GetPreviewSourceFile(settings), false, true).Script.Replace("\r\n", "\n"));
 }
Example #4
0
 public void GenerateCustomScript(MediaEncoderSettings settings)
 {
     settings.CustomScript = MediaEncoderScript.GenerateVideoScript(settings, GetPreviewSourceFile(settings), false, true).Script;
 }