/// <summary> /// search for the log file and add error messages to the stdoutLog /// required as the error lines in stderr or stdout are not readable /// </summary> protected override void getErrorLine() { string[] entry = Regex.Split(job.Args, "[0-9]{1,3}:\\\""); if (entry.Length < 2 || entry[1].Length < 3) { return; } string fileName = entry[1].Substring(0, entry[1].Length - 2); fileName = FileUtil.AddToFileName(System.IO.Path.ChangeExtension(fileName, "txt"), " - Log"); if (!System.IO.File.Exists(fileName)) { return; } using (System.IO.StreamReader file = new System.IO.StreamReader(fileName)) { string line; while ((line = file.ReadLine()) != null) { if (line.ToLowerInvariant().Contains("<error>")) { stdoutLog.LogEvent(line, ImageType.Error); } } } }
/// <summary> /// does the final initialization of the dialog /// gets all audio types from the audio streams, then asks the muxprovider for a list of containers it can mux the video and audio streams into /// if there is no muxer that can deliver any container for the video / audio combination, we can abort right away /// </summary> /// <returns>true if the given video/audio combination can be muxed to at least a single container, false if not</returns> public bool init() { List <AudioEncoderType> aTypes = new List <AudioEncoderType>(); AudioEncoderType[] audioTypes; foreach (AudioJob stream in this.audioStreams) { if (stream.Settings != null && !String.IsNullOrEmpty(stream.Input) && !String.IsNullOrEmpty(stream.Output)) { aTypes.Add(stream.Settings.EncoderType); } } audioTypes = aTypes.ToArray(); List <ContainerType> supportedOutputTypes = this.muxProvider.GetSupportedContainers( this.videoStream.Settings.EncoderType, audioTypes); if (supportedOutputTypes.Count <= 0) { return(false); } this.container.Items.Clear(); this.container.Items.AddRange(supportedOutputTypes.ToArray()); this.container.SelectedIndex = 0; string muxedName = FileUtil.AddToFileName(mainForm.Video.Info.VideoOutput, "-muxed"); this.muxedOutput.Text = Path.ChangeExtension(muxedName, (this.container.SelectedItem as ContainerType).Extension); // this.sizeSelection.SelectedIndex = 2; splitting.Value = mainForm.Settings.AedSettings.SplitSize; if (mainForm.Settings.AedSettings.FileSizeMode && FileSizeRadio.Enabled) { FileSizeRadio.Checked = true; targetSize.Value = mainForm.Settings.AedSettings.FileSize; } else if (mainForm.Settings.AedSettings.BitrateMode) { averageBitrateRadio.Checked = true; projectedBitrateKBits.Text = mainForm.Settings.AedSettings.Bitrate.ToString(); } else { noTargetRadio.Checked = true; } if (mainForm.Settings.AedSettings.AddAdditionalContent) { addSubsNChapters.Checked = true; } foreach (object o in container.Items) // I know this is ugly, but using the ContainerType doesn't work unless we're switching to manual serialization { if (o.ToString().Equals(mainForm.Settings.AedSettings.Container)) { container.SelectedItem = o; break; } } return(true); }
private void chooseOutputFilename() { string projectPath = FileUtil.GetOutputFolder(vInput.Filename); string fileNameNoPath = Path.GetFileName(vInput.Filename); output.Filename = FileUtil.AddToFileName(Path.Combine(projectPath, fileNameNoPath), "-muxed"); ChangeOutputExtension(); }
public void openAudioFile(string fileName) { AudioInput = fileName; AudioOutput = FileUtil.AddToFileName(fileName, MainForm.Instance.Settings.AudioExtension); audioContainer_SelectedIndexChanged(null, null); delay.Value = PrettyFormatting.getDelay(fileName); }
private void chooseOutputFilename() { string projectPath; string fileNameNoPath = Path.GetFileName(vInput.Filename); if (string.IsNullOrEmpty(projectPath = mainForm.Settings.DefaultOutputDir)) { projectPath = Path.GetDirectoryName(vInput.Filename); } output.Filename = FileUtil.AddToFileName(Path.Combine(projectPath, fileNameNoPath), "-muxed"); ChangeOutputExtension(); }
/// <summary> /// search for the log file and add error messages to the stdoutLog /// required as the error lines in stderr or stdout are not readable /// </summary> protected override void getErrorLine() { try { string[] entry = Regex.Split(job.Args, "[0-9]{1,3}:\\\""); if (entry.Length < 2 || entry[1].Length < 3) { return; } string strLogFile = entry[1].Split('\"')[0]; strLogFile = FileUtil.AddToFileName(System.IO.Path.ChangeExtension(strLogFile, "txt"), " - Log"); if (!System.IO.File.Exists(strLogFile)) { return; } using (System.IO.StreamReader file = new System.IO.StreamReader(strLogFile)) { string line; while ((line = file.ReadLine()) != null) { if (line.ToLowerInvariant().Contains("<error>")) { stdoutLog.LogEvent(line, ImageType.Error); } else if (line.ToLowerInvariant().Contains("<warning>") && !FileUtil.RegExMatch(line, @"\[\w\d{2}\] audio overlaps for ", true) && !FileUtil.RegExMatch(line, @"\[\w\d{2}\] the video framerate is correct, but rather unusual", true)) { stdoutLog.LogEvent(line, ImageType.Warning); } if (line.Contains("Getting \"Haali Matroska Muxer\" instance failed")) { // haali media splitter is missing ==> try to (re)install it if (!su.WasAborted && FileUtil.InstallHaali(ref log)) { base.bSecondPassNeeded = true; } } } } } catch (Exception) { stdoutLog.LogEvent("Error parsing: " + job.Args, ImageType.Error); } }
private void fillInAudioInformation(List <AudioJob> arrAudioJobs, List <MuxStream> arrMuxStreams) { foreach (MuxStream m in arrMuxStreams) { m.path = convertTrackNumberToFile(m.path, ref m.delay); } foreach (AudioJob a in arrAudioJobs) { a.Input = convertTrackNumberToFile(a.Input, ref a.Delay); if (String.IsNullOrEmpty(a.Output) && !String.IsNullOrEmpty(a.Input)) { a.Output = FileUtil.AddToFileName(a.Input, "_audio"); } } }
private void fillInAudioInformation() { foreach (MuxStream m in job.PostprocessingProperties.DirectMuxAudio) { m.path = convertTrackNumberToFile(m.path, ref m.delay); } foreach (AudioJob a in job.PostprocessingProperties.AudioJobs) { a.Input = convertTrackNumberToFile(a.Input, ref a.Delay); if (string.IsNullOrEmpty(a.Output)) { a.Output = FileUtil.AddToFileName(a.Input, "_audio"); } } }
public void openAudioFile(string fileName) { AudioInput = fileName; delay.Value = PrettyFormatting.getDelay(fileName); try { AudioOutput = FileUtil.AddToFileName(fileName, MainForm.Instance.Settings.AudioExtension); } catch (Exception e) { throw new ApplicationException("The value detected as delay in your filename seems to be too high/low for MeGUI." + "Try to recreate it with the appropriate tools." + e.Message, e); } audioContainer_SelectedIndexChanged(null, null); }
public void openAudioFile(string fileName) { AudioInput = fileName; delay.Value = PrettyFormatting.getDelayAndCheck(fileName) ?? 0; try { AudioOutput = FileUtil.AddToFileName(PrettyFormatting.ReplaceDelay(fileName, 0), MainForm.Instance.Settings.AudioExtension); } catch (Exception e) { throw new ApplicationException("The value detected as delay in your filename seems to be too high/low for MeGUI." + "Try to recreate it with the appropriate tools." + e.Message, e); } string projectPath = FileUtil.GetOutputFolder(fileName); AudioOutput = Path.Combine(projectPath, Path.GetFileName(AudioOutput)); audioContainer_SelectedIndexChanged(null, null); }
private void FillInAudioInformation(ref List <AudioJob> arrAudioJobs, List <MuxStream> arrMuxStreams) { foreach (MuxStream m in arrMuxStreams) { m.path = ConvertTrackNumberToFile(m.path, ref m.delay); } List <AudioJob> tempList = new List <AudioJob>(); foreach (AudioJob a in arrAudioJobs) { a.Input = ConvertTrackNumberToFile(a.Input, ref a.Delay); if (String.IsNullOrEmpty(a.Output) && !String.IsNullOrEmpty(a.Input)) { a.Output = FileUtil.AddToFileName(a.Input, "_audio"); } if (!String.IsNullOrEmpty(a.Input)) { tempList.Add(a); } } arrAudioJobs = tempList; }
private void chooseOutputFilename() { output.Filename = FileUtil.AddToFileName(vInput.Filename, "-muxed"); ChangeOutputExtension(); }