public void Run(MainForm info) { // normal video verification string error = null; if ((error = info.Video.verifyVideoSettings()) != null) { MessageBox.Show(error, "Unsupported video configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if ((error = info.Audio.verifyAudioSettings()) != null && !error.Equals("No audio input defined.")) { MessageBox.Show(error, "Unsupported audio configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if (info.Video.CurrentSettings.VideoEncodingType == VideoCodecSettings.VideoEncodingMode.twopass1 || info.Video.CurrentSettings.VideoEncodingType == VideoCodecSettings.VideoEncodingMode.threepass1) { MessageBox.Show("First pass encoding is not supported for automated encoding as no output is generated.\nPlease choose another encoding mode", "Improper configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } // close video player so that the AviSynth script is also closed info.ClosePlayer(); JobUtil.GetInputProperties(info.Video.VideoInput, out ulong frameCount, out double frameRate); VideoCodecSettings vSettings = info.Video.CurrentSettings.Clone(); Zone[] zones = info.Video.Info.Zones; // We can't simply modify the zones in place because that would reveal the final zones config to the user, including the credits/start zones bool cont = JobUtil.GetFinalZoneConfiguration(vSettings, info.Video.Info.IntroEndFrame, info.Video.Info.CreditsStartFrame, ref zones, (int)frameCount); if (cont) { VideoStream myVideo = new VideoStream(); myVideo.Input = info.Video.Info.VideoInput; myVideo.Output = info.Video.Info.VideoOutput; myVideo.NumberOfFrames = frameCount; myVideo.Framerate = (decimal)frameRate; myVideo.VideoType = info.Video.CurrentMuxableVideoType; myVideo.Settings = vSettings; VideoInfo vInfo = info.Video.Info.Clone(); // so we don't modify the data on the main form vInfo.Zones = zones; using (AutoEncodeWindow aew = new AutoEncodeWindow(myVideo, info.Audio.AudioStreams, info.Video.PrerenderJob, vInfo)) { if (aew.init()) { aew.ShowDialog(); } else { MessageBox.Show("The currently selected combination of video and audio output cannot be muxed", "Unsupported configuration", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }
public void Run(MainForm info) { // normal video verification string error = null; // update the current audio stream with the latest data // updateAudioStreams(); if ((error = info.Video.verifyVideoSettings()) != null) { MessageBox.Show(error, "Unsupported video configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if ((error = info.Audio.verifyAudioSettings()) != null && !error.Equals("No audio input defined.")) { MessageBox.Show(error, "Unsupported audio configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } #warning must be fixed up to be more generic if (info.Video.CurrentVideoCodecSettings.EncodingMode == 2 || info.Video.CurrentVideoCodecSettings.EncodingMode == 5) { MessageBox.Show("First pass encoding is not supported for automated encoding as no output is generated.\nPlease choose another encoding mode", "Improper configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } VideoCodecSettings vSettings = info.Video.CurrentVideoCodecSettings.clone(); bool cont = info.JobUtil.getFinalZoneConfiguration(vSettings, info.Video.Info.IntroEndFrame, info.Video.Info.CreditsStartFrame); if (cont) { ulong length = 0; double framerate = 0.0; VideoStream myVideo = new VideoStream(); JobUtil.getInputProperties(out length, out framerate, info.Video.VideoInput); myVideo.Input = info.Video.Info.VideoInput; myVideo.Output = info.Video.Info.VideoOutput; myVideo.NumberOfFrames = length; myVideo.Framerate = (decimal)framerate; myVideo.DAR = info.Video.Info.DAR; myVideo.VideoType = info.Video.CurrentMuxableVideoType; myVideo.Settings = vSettings; using (AutoEncodeWindow aew = new AutoEncodeWindow(myVideo, info.Audio.AudioStreams, info, info.Video.PrerenderJob)) { if (aew.init()) { info.ClosePlayer(); aew.ShowDialog(); } else { MessageBox.Show("The currently selected combination of video and audio output cannot be muxed", "Unsupported configuration", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }
public void Run(MainForm info) { // normal video verification string error = null; if ((error = info.Video.verifyVideoSettings()) != null) { MessageBox.Show(error, "Unsupported video configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if ((error = info.Audio.verifyAudioSettings()) != null && !error.Equals("No audio input defined.")) { MessageBox.Show(error, "Unsupported audio configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if (info.Video.CurrentSettings.EncodingMode == 2 || info.Video.CurrentSettings.EncodingMode == 5) { MessageBox.Show("First pass encoding is not supported for automated encoding as no output is generated.\nPlease choose another encoding mode", "Improper configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } VideoCodecSettings vSettings = info.Video.CurrentSettings.Clone(); Zone[] zones = info.Video.Info.Zones; // We can't simply modify the zones in place because that would reveal the final zones config to the user, including the credits/start zones bool cont = info.JobUtil.getFinalZoneConfiguration(vSettings, info.Video.Info.IntroEndFrame, info.Video.Info.CreditsStartFrame, ref zones); if (cont) { ulong length = 0; double framerate = 0.0; VideoStream myVideo = new VideoStream(); JobUtil.getInputProperties(out length, out framerate, info.Video.VideoInput); myVideo.Input = info.Video.Info.VideoInput; myVideo.Output = info.Video.Info.VideoOutput; myVideo.NumberOfFrames = length; myVideo.Framerate = (decimal)framerate; myVideo.DAR = info.Video.Info.DAR; myVideo.VideoType = info.Video.CurrentMuxableVideoType; myVideo.Settings = vSettings; VideoInfo vInfo = info.Video.Info.Clone(); // so we don't modify the data on the main form vInfo.Zones = zones; using (AutoEncodeWindow aew = new AutoEncodeWindow(myVideo, info.Audio.AudioStreams, info, info.Video.PrerenderJob, vInfo)) { if (aew.init()) { info.ClosePlayer(); aew.ShowDialog(); } else MessageBox.Show("The currently selected combination of video and audio output cannot be muxed", "Unsupported configuration", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }