public MP4BoxMuxer(string executablePath) { UpdateCacher.CheckPackage("mp4box"); this.executable = executablePath; trackNumber = 0; lastLine = ""; }
public static string getFFMSVideoInputLine(string inputFile, string indexFile, double fps) { UpdateCacher.CheckPackage("ffms"); int fpsnum, fpsden; getFPSFraction(fps, inputFile, out fpsnum, out fpsden); return(getFFMSBasicInputLine(!isFFMSDefaultPluginRequired(), inputFile, indexFile, -1, 0, fpsnum, fpsden, true)); }
public static string getLSMASHVideoInputLine(string inputFile, string indexFile, double fps) { UpdateCacher.CheckPackage("lsmash"); int fpsnum, fpsden; getFPSFraction(fps, inputFile, out fpsnum, out fpsden); return(getLSMASHBasicInputLine(inputFile, indexFile, -1, 0, fpsnum, fpsden, true)); }
private static IJobProcessor init(MainForm mf, Job j) { if (j is VideoJob && (j as VideoJob).Settings is x265Settings) { UpdateCacher.CheckPackage("ffmpeg"); UpdateCacher.CheckPackage("x265"); return(new x265Encoder("cmd.exe")); } return(null); }
/// <summary> /// initializes the dga reader /// </summary> /// <param name="fileName">the DGAVCIndex project file that this reader will process</param> public dgaFile(string fileName) { UpdateCacher.CheckPackage("dgavcindex"); this.fileName = fileName; string strPath = Path.GetDirectoryName(MainForm.Instance.Settings.DGAVCIndex.Path); string strDLL = Path.Combine(strPath, "DGAVCDecode.dll"); reader = AvsFile.ParseScript("LoadPlugin(\"" + strDLL + "\")\r\nAVCSource(\"" + this.fileName + "\")"); this.readFileProperties(); }
public MkvMergeMuxer(string executablePath) { UpdateCacher.CheckPackage("mkvmerge"); this.executable = executablePath; // Exit code 0 = everything was OK // Exit code 1 = there were non-fatal warnings // Exit code 2 = there was a fatal error this.arrSuccessCodes.Add(1); }
public VobSubIndexer() { UpdateCacher.CheckPackage("vsrip"); executable = MainForm.Instance.Settings.VobSubRipper.Path; bCommandLine = false; // success exit code is 2 this.arrSuccessCodes = new System.Collections.Generic.List <int>() { 2 }; }
public x265Encoder(string encoderPath) : base() { UpdateCacher.CheckPackage("x265"); executable = encoderPath; string x265Path = Path.Combine(Path.GetDirectoryName(encoderPath), "avs4x265.exe"); if (File.Exists(x265Path)) { executable = x265Path; } }
/// <summary> /// initializes the dgi reader /// </summary> /// <param name="fileName">the DGNVIndex project file that this reader will process</param> public dgmFile(string fileName) { this.fileName = fileName; UpdateCacher.CheckPackage("dgindexim"); string strScript = ""; string strPath = Path.GetDirectoryName(MainForm.Instance.Settings.DGIndexIM.Path); strScript = "LoadPlugin(\"" + Path.Combine(strPath, "DGDecodeIM.dll") + "\")\r\nDGSourceIM(\"" + this.fileName + "\", silent=true)"; reader = AvsFile.ParseScript(strScript, true); this.readFileProperties(); }
private void getInfo() { _strResult = null; using (Process mkvinfo = new Process()) { UpdateCacher.CheckPackage("mkvmerge"); mkvinfo.StartInfo.FileName = MainForm.Instance.Settings.MkvMerge.Path; mkvinfo.StartInfo.Arguments = string.Format("--ui-language en --identify-verbose \"{0}\"", _strFile); mkvinfo.StartInfo.CreateNoWindow = true; mkvinfo.StartInfo.UseShellExecute = false; mkvinfo.StartInfo.RedirectStandardOutput = true; mkvinfo.StartInfo.RedirectStandardError = true; mkvinfo.StartInfo.ErrorDialog = false; mkvinfo.EnableRaisingEvents = true; mkvinfo.ErrorDataReceived += new DataReceivedEventHandler(backgroundWorker_ErrorDataReceived); mkvinfo.OutputDataReceived += new DataReceivedEventHandler(backgroundWorker_OutputDataReceived); try { mkvinfo.Start(); mkvinfo.BeginErrorReadLine(); mkvinfo.BeginOutputReadLine(); while (!mkvinfo.HasExited) // wait until the process has terminated without locking the GUI { System.Windows.Forms.Application.DoEvents(); System.Threading.Thread.Sleep(100); } mkvinfo.WaitForExit(); _oLog.LogValue("MkvInfo", _strResult); if (mkvinfo.ExitCode != 0) { _bMuxable = false; _bHasChapters = false; } else { parseResult(); } } catch (Exception ex) { _oLog.LogValue("MkvInfo - Unhandled Error", ex, ImageType.Error); } finally { mkvinfo.ErrorDataReceived -= new DataReceivedEventHandler(backgroundWorker_ErrorDataReceived); mkvinfo.OutputDataReceived -= new DataReceivedEventHandler(backgroundWorker_OutputDataReceived); } } }
public static string getLSMASHVideoInputLine(string inputFile, string indexFile, double fps, ref MediaInfoFile oInfo) { UpdateCacher.CheckPackage("lsmash"); int iVideoBits = 8; if (!String.IsNullOrEmpty(indexFile) && String.IsNullOrEmpty(inputFile)) { using (StreamReader sr = new StreamReader(indexFile, System.Text.Encoding.Default)) { string line = null; while ((line = sr.ReadLine()) != null) { if (line.StartsWith("<InputFilePath>")) { string strSourceFile = line.Substring(15, line.LastIndexOf("</InputFilePath>") - 15); if (File.Exists(strSourceFile)) { inputFile = strSourceFile; } break; } } } } if (File.Exists(inputFile) && oInfo == null) { oInfo = new MediaInfoFile(inputFile); } if (oInfo != null) { if (oInfo.VideoInfo.HasVideo) { if (fps == 0 && oInfo.VideoInfo.FPS > 0) { fps = oInfo.VideoInfo.FPS; } iVideoBits = oInfo.VideoInfo.BitDepth; } if (String.IsNullOrEmpty(indexFile) && !oInfo.FileName.Equals(inputFile)) { indexFile = inputFile; inputFile = oInfo.FileName; } } GetFPSDetails(fps, inputFile, out int fpsnum, out int fpsden); return(getLSMASHBasicInputLine(inputFile, indexFile, -1, 0, fpsnum, fpsden, true, iVideoBits)); }
/// <summary> /// initializes the dgi reader /// </summary> /// <param name="fileName">the DGNVIndex project file that this reader will process</param> public dgiFile(string fileName) { this.fileName = fileName; UpdateCacher.CheckPackage("dgindexnv"); string strScript = ""; string strPath = Path.GetDirectoryName(MainForm.Instance.Settings.DGIndexNV.Path); strScript = "LoadPlugin(\"" + Path.Combine(strPath, "DGDecodeNV.dll") + "\")\r\nDGSource(\"" + this.fileName + "\""; if (MainForm.Instance.Settings.AutoForceFilm && MainForm.Instance.Settings.ForceFilmThreshold <= (decimal)dgiFile.GetFilmPercent(this.fileName)) { strScript += ",fieldop=1)"; } else { strScript += ",fieldop=0)"; } reader = AvsFile.ParseScript(strScript, true); this.readFileProperties(); }
private void enableToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem ts = (ToolStripMenuItem)sender; foreach (ListViewItem item in listViewDetails.SelectedItems) { ProgramSettings pSettings = UpdateCacher.GetPackage(item.Name); if (pSettings != null) { UpdateCacher.CheckPackage(item.Name, ts.Checked, false); } iUpgradeable file = MainForm.Instance.UpdateHandler.UpdateData.FindByName(item.Name); Version latest = file.AvailableVersion; if (pSettings != null && !pSettings.UpdateAllowed()) { item.SubItems["Status"].Text = EnumProxy.Create(PackageStatus.Disabled).ToString(); item.Checked = false; } else if (!file.isAvailable()) { item.SubItems["Status"].Text = EnumProxy.Create(PackageStatus.Reinstall).ToString(); item.Checked = true; } else if (latest != null && file.CurrentVersion == null || latest.CompareTo(file.CurrentVersion) != 0) { item.SubItems["Status"].Text = EnumProxy.Create(PackageStatus.UpdateAvailable).ToString(); item.Checked = true; } else { item.SubItems["Status"].Text = EnumProxy.Create(PackageStatus.NoUpdateAvailable).ToString(); item.Checked = false; } } }
public FFMSIndexer(string executableName) { UpdateCacher.CheckPackage("ffms"); executable = executableName; }
public static string getFFMSAudioInputLine(string inputFile, string indexFile, int track) { UpdateCacher.CheckPackage("ffms"); return(GetFFMSBasicInputLine(!isFFMSDefaultPluginRequired(), inputFile, indexFile, track, 0, 0, 0, false, false)); }
public HDStreamExtractorIndexer(string executablePath) { UpdateCacher.CheckPackage("eac3to"); this.executable = executablePath; }
public static string GetInputLine(string input, string indexFile, bool interlaced, PossibleSources sourceType, bool colormatrix, bool mpeg2deblock, bool flipVertical, double fps, bool dss2, NvDeinterlacerType nvDeintType, int nvHorizontalResolution, int nvVerticalResolution, CropValues nvCropValues) { string inputLine = "#input"; string strDLLPath = ""; switch (sourceType) { case PossibleSources.avs: inputLine = "Import(\"" + input + "\")"; break; case PossibleSources.d2v: UpdateCacher.CheckPackage("dgindex"); if (String.IsNullOrEmpty(indexFile)) { indexFile = input; } strDLLPath = Path.Combine(Path.GetDirectoryName(MainForm.Instance.Settings.DGIndex.Path), "DGDecode.dll"); inputLine = "LoadPlugin(\"" + strDLLPath + "\")\r\nDGDecode_mpeg2source(\"" + indexFile + "\""; if (mpeg2deblock) { inputLine += ", cpu=4"; } if (colormatrix) { inputLine += ", info=3"; } inputLine += ")"; if (colormatrix) { inputLine += string.Format("\r\nLoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "ColorMatrix.dll") + "\")\r\nColorMatrix(hints=true{0}, threads=0)", interlaced ? ", interlaced=true" : ""); } break; case PossibleSources.dgm: UpdateCacher.CheckPackage("dgindexim"); if (String.IsNullOrEmpty(indexFile)) { indexFile = input; } strDLLPath = Path.Combine(Path.GetDirectoryName(MainForm.Instance.Settings.DGIndexIM.Path), "dgdecodeim.dll"); inputLine = "LoadPlugin(\"" + strDLLPath + "\")\r\nDGSourceIM(\"" + indexFile + "\", silent=true)"; if (MainForm.Instance.Settings.AviSynthPlus && MainForm.Instance.Settings.Input8Bit) { inputLine += "\r\nConvertBits(8)"; } break; case PossibleSources.dgi: UpdateCacher.CheckPackage("dgindexnv"); if (String.IsNullOrEmpty(indexFile)) { indexFile = input; } strDLLPath = Path.Combine(Path.GetDirectoryName(MainForm.Instance.Settings.DGIndexNV.Path), "DGDecodeNV.dll"); inputLine = "LoadPlugin(\"" + strDLLPath + "\")\r\nDGSource(\"" + indexFile + "\""; if (MainForm.Instance.Settings.AutoForceFilm && MainForm.Instance.Settings.ForceFilmThreshold <= (decimal)dgiFile.GetFilmPercent(indexFile)) { inputLine += ",fieldop=1"; // fieldop=0 is the default value } if (nvDeintType != NvDeinterlacerType.nvDeInterlacerNone) { inputLine += ScriptServer.GetNvDeInterlacerLine(true, nvDeintType); } if (nvCropValues != null && nvCropValues.isCropped()) { GetMod4Cropping(ref nvCropValues); inputLine += ", ct=" + nvCropValues.top + ", cb=" + nvCropValues.bottom + ", cl=" + nvCropValues.left + ", cr=" + nvCropValues.right; } if (nvHorizontalResolution > 0 && nvVerticalResolution > 0) { inputLine += ", rw=" + nvHorizontalResolution + ", rh=" + nvVerticalResolution; } inputLine += ")"; if (MainForm.Instance.Settings.AviSynthPlus && MainForm.Instance.Settings.Input8Bit) { inputLine += "\r\nConvertBits(8)"; } break; case PossibleSources.ffindex: inputLine = VideoUtil.getFFMSVideoInputLine(input, indexFile, fps); break; case PossibleSources.lsmash: MediaInfoFile oInfo = null; inputLine = VideoUtil.getLSMASHVideoInputLine(input, indexFile, fps, ref oInfo); if (oInfo != null) { oInfo.Dispose(); } break; case PossibleSources.vdr: case PossibleSources.avisource: inputLine = "AVISource(\"" + input + "\", audio=false)" + VideoUtil.getAssumeFPS(fps, input); if (MainForm.Instance.Settings.AviSynthPlus && MainForm.Instance.Settings.Input8Bit) { inputLine += "\r\nConvertBits(8)"; } break; case PossibleSources.directShow: if (dss2) { string path = MeGUI.core.util.FileUtil.GetHaaliInstalledPath(); if (!File.Exists(Path.Combine(path, "avss.dll"))) { UpdateCacher.CheckPackage("haali"); path = Path.GetDirectoryName(MainForm.Instance.Settings.Haali.Path); } inputLine = "LoadPlugin(\"" + path + "\\avss.dll" + "\")\r\ndss2(\"" + input + "\"" + ((fps > 0) ? ", fps=" + fps.ToString("F3", new CultureInfo("en-us")) : string.Empty) + ")" + VideoUtil.getAssumeFPS(fps, input); } else { inputLine = String.Empty; if (MainForm.Instance.Settings.PortableAviSynth) { inputLine = "LoadPlugin(\"" + Path.Combine(Path.GetDirectoryName(MainForm.Instance.Settings.AviSynth.Path), @"plugins\directshowsource.dll") + "\")\r\n"; } inputLine += "DirectShowSource(\"" + input + "\"" + ((fps > 0) ? ", fps=" + fps.ToString("F3", new CultureInfo("en-us")) : string.Empty) + ", audio=false, convertfps=true)" + VideoUtil.getAssumeFPS(fps, input); } if (MainForm.Instance.Settings.AviSynthPlus && MainForm.Instance.Settings.Input8Bit) { inputLine += "\r\nConvertBits(8)"; } if (flipVertical) { inputLine = inputLine + "\r\nFlipVertical()"; } break; } return(inputLine); }
public LSMASHIndexer(string executableName) { UpdateCacher.CheckPackage("lsmash"); executable = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "ping.exe"); }
public MkvExtract(string executablePath) { UpdateCacher.CheckPackage("mkvmerge"); this.executable = executablePath; }
public VobSubIndexer() { UpdateCacher.CheckPackage("vobsub"); executable = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\rundll32.exe"; }
public static string GetInputLine(string input, string indexFile, bool interlaced, PossibleSources sourceType, bool colormatrix, bool mpeg2deblock, bool flipVertical, double fps, bool dss2) { string inputLine = "#input"; string strDLLPath = ""; switch (sourceType) { case PossibleSources.avs: inputLine = "Import(\"" + input + "\")"; break; case PossibleSources.d2v: UpdateCacher.CheckPackage("dgindex"); if (String.IsNullOrEmpty(indexFile)) { indexFile = input; } strDLLPath = Path.Combine(Path.GetDirectoryName(MainForm.Instance.Settings.DGIndex.Path), "DGDecode.dll"); inputLine = "LoadPlugin(\"" + strDLLPath + "\")\r\nDGDecode_mpeg2source(\"" + indexFile + "\""; if (mpeg2deblock) { inputLine += ", cpu=4"; } if (colormatrix) { inputLine += ", info=3"; } inputLine += ")"; if (colormatrix) { inputLine += string.Format("\r\nLoadPlugin(\"" + Path.Combine(MainForm.Instance.Settings.AvisynthPluginsPath, "ColorMatrix.dll") + "\")\r\nColorMatrix(hints=true{0}, threads=0)", interlaced ? ", interlaced=true" : ""); } break; case PossibleSources.dga: UpdateCacher.CheckPackage("dgavcindex"); if (String.IsNullOrEmpty(indexFile)) { indexFile = input; } strDLLPath = Path.Combine(Path.GetDirectoryName(MainForm.Instance.Settings.DGAVCIndex.Path), "DGAVCDecode.dll"); inputLine = "LoadPlugin(\"" + strDLLPath + "\")\r\nAVCSource(\"" + indexFile + "\")"; break; case PossibleSources.dgi: UpdateCacher.CheckPackage("dgindexnv"); if (String.IsNullOrEmpty(indexFile)) { indexFile = input; } strDLLPath = Path.Combine(Path.GetDirectoryName(MainForm.Instance.Settings.DGIndexNV.Path), "DGDecodeNV.dll"); inputLine = "LoadPlugin(\"" + strDLLPath + "\")\r\nDGSource(\"" + indexFile + "\""; if (MainForm.Instance.Settings.AutoForceFilm && MainForm.Instance.Settings.ForceFilmThreshold <= (decimal)dgiFile.GetFilmPercent(indexFile)) { inputLine += ",fieldop=1"; } else { inputLine += ",fieldop=0"; } break; case PossibleSources.ffindex: inputLine = VideoUtil.getFFMSVideoInputLine(input, indexFile, fps); break; case PossibleSources.lsmash: inputLine = VideoUtil.getLSMASHVideoInputLine(input, indexFile, fps); break; case PossibleSources.vdr: inputLine = "AVISource(\"" + input + "\", audio=false)" + VideoUtil.getAssumeFPS(fps, input); break; case PossibleSources.directShow: if (input.ToLower(System.Globalization.CultureInfo.InvariantCulture).EndsWith(".avi")) { inputLine = "AVISource(\"" + input + "\", audio=false)" + VideoUtil.getAssumeFPS(fps, input); } else { if (dss2 && File.Exists(Path.Combine(MeGUISettings.HaaliMSPath, "avss.dll"))) { inputLine = "LoadPlugin(\"" + MeGUISettings.HaaliMSPath + "\\avss.dll" + "\")\r\ndss2(\"" + input + "\"" + ((fps > 0) ? ", fps=" + fps.ToString("F3", new CultureInfo("en-us")) : string.Empty) + ")" + VideoUtil.getAssumeFPS(fps, input); } else { inputLine = String.Empty; if (MainForm.Instance.Settings.PortableAviSynth) { inputLine = "LoadPlugin(\"" + Path.Combine(Path.GetDirectoryName(MainForm.Instance.Settings.AviSynth.Path), @"plugins\directshowsource.dll") + "\")\r\n"; } inputLine += "DirectShowSource(\"" + input + "\"" + ((fps > 0) ? ", fps=" + fps.ToString("F3", new CultureInfo("en-us")) : string.Empty) + ", audio=false, convertfps=true)" + VideoUtil.getAssumeFPS(fps, input); } if (flipVertical) { inputLine = inputLine + "\r\nFlipVertical()"; } } break; } return(inputLine); }
public FFmpegMuxer(string executablePath) { UpdateCacher.CheckPackage("ffmpeg"); this.executable = executablePath; }
public PgcDemux(string executablePath) { UpdateCacher.CheckPackage("pgcdemux"); this.executable = executablePath; }
public tsMuxeR(string executablePath) { UpdateCacher.CheckPackage("tsmuxer"); this.executable = executablePath; }
public XviDEncoder(string exePath) : base() { UpdateCacher.CheckPackage("xvid_encraw"); executable = exePath; }
public ffmpegEncoder(string encoderPath) : base() { UpdateCacher.CheckPackage("ffmpeg"); executable = encoderPath; }
public DGMIndexer(string executableName) { UpdateCacher.CheckPackage("dgindexim"); executable = executableName; }
public DGAIndexer(string executableName) { UpdateCacher.CheckPackage("dgavcindex"); executable = executableName; }
public AMGMuxer(string executablePath) { UpdateCacher.CheckPackage("avimux_gui"); this.executable = executablePath; }
public static string getLSMASHAudioInputLine(string inputFile, string indexFile, int track) { UpdateCacher.CheckPackage("lsmash"); return(getLSMASHBasicInputLine(inputFile, indexFile, track, 0, 0, 0, false, 8)); }