public void TEST_COMMAND_BUILDER_A_S() { MediaSource ms = TestDVD_A_S(TestDVD_Dir, 1, 0); MEncoderCommandBuilder builder = new MEncoderCommandBuilder(ms); Assert.IsNotNull(builder.GetArguments(MEncoderLogging.None)); Assert.AreEqual(@" dvd://1 -dvd-device """ + Path.GetFullPath(ms.MediaPath).ToLower() + @"""" + @" -aid 129 -oac lavc -ovc lavc" + @" -font c:\windows\fonts\arial.ttf -sid 0" + @" -of mpeg -mpegopts format=dvd:tsaf" + @" -vf harddup -really-quiet -o """ + FileSystemWalker.TranscodeBufferDirectory.ToLower() + @"\testdvd.mpg""", builder.GetArguments(MEncoderLogging.None).ToLower()); }
public void EXECUTE_COMMAND_BUILDER_A_S() { MediaSource ms = TestDVD_A_S(@"C:\Users\Public\Videos\DVDs\Apocalypto", 2, 2); ms.StartChapter = 2; ms.EndChapter = 2; MEncoderCommandBuilder builder = new MEncoderCommandBuilder(ms); Process process = new Process(); process.StartInfo.FileName = builder.GetCommand(); process.StartInfo.Arguments = builder.GetArguments(MEncoderLogging.None).Replace("-really-quiet", ""); process.StartInfo.ErrorDialog = true; process.Start(); process.WaitForExit(); }
public void TEST_BASIC_COMMAND_BUILDER() { string drive = OMLSettings.VirtualDiscDrive.ToLower(); MediaSource ms = new MediaSource(new Disk("", drive + ":", VideoFormat.DVD)); MEncoderCommandBuilder builder = new MEncoderCommandBuilder(ms) { AudioEncoderFormat = MEncoder.AudioFormat.Copy, VideoEncoderFormat = MEncoder.VideoFormat.Copy, }; Assert.IsNotNull(builder.GetArguments(MEncoderLogging.None)); Assert.AreEqual(@" dvd:// -dvd-device """ + drive.ToLower() + @":\"" -oac copy -ovc copy -of mpeg -mpegopts format=dvd:tsaf " + @"-vf harddup -really-quiet -o """ + FileSystemWalker.TranscodeBufferDirectory.ToLower() + @"\mymovie.mpg""", builder.GetArguments(MEncoderLogging.None).ToLower()); Assert.IsNotNull(builder.GetCommand()); Assert.AreEqual(Path.GetFullPath(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)) + @"\openmedialibrary\mencoder.exe", builder.GetCommand().ToLower()); }
public int BeginTranscodeJob() { MEncoderCommandBuilder cmdBuilder = new MEncoderCommandBuilder(Source); Process = new Process(); Process.StartInfo.FileName = cmdBuilder.GetCommand(); Process.StartInfo.Arguments = cmdBuilder.GetArguments(_mencoderloglevel); Process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; Process.StartInfo.ErrorDialog = false; if (_mencoderloglevel != MEncoderLogging.None) { Process.StartInfo.UseShellExecute = false; Process.StartInfo.RedirectStandardError = true; Process.StartInfo.RedirectStandardOutput = true; Process.ErrorDataReceived += new DataReceivedEventHandler(this.MenCoderLogErr); Process.OutputDataReceived += new DataReceivedEventHandler(this.MenCoderLogOut); } Process.EnableRaisingEvents = true; Process.Exited += new EventHandler(this.HandleTranscodeExited); Process.Start(); if (_mencoderloglevel != MEncoderLogging.None) { Process.BeginOutputReadLine(); Process.BeginErrorReadLine(); } WriteMenCoderLogLine("Launching Memcoder with - " + Process.StartInfo.Arguments); Utilities.DebugLine("[Transcode] Transcoding job started" + (Process.HasExited ? ", exit-code=" + Process.ExitCode : "")); if (Process.HasExited) { return(Process.ExitCode); } return(0); }
public int BeginTranscodeJob() { MEncoderCommandBuilder cmdBuilder = new MEncoderCommandBuilder(Source); Process = new Process(); Process.StartInfo.FileName = cmdBuilder.GetCommand(); Process.StartInfo.Arguments = cmdBuilder.GetArguments(_mencoderloglevel); Process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; Process.StartInfo.ErrorDialog = false; if (_mencoderloglevel != MEncoderLogging.None) { Process.StartInfo.UseShellExecute = false; Process.StartInfo.RedirectStandardError = true; Process.StartInfo.RedirectStandardOutput = true; Process.ErrorDataReceived += new DataReceivedEventHandler(this.MenCoderLogErr); Process.OutputDataReceived += new DataReceivedEventHandler(this.MenCoderLogOut); } Process.EnableRaisingEvents = true; Process.Exited += new EventHandler(this.HandleTranscodeExited); Process.Start(); if (_mencoderloglevel != MEncoderLogging.None) { Process.BeginOutputReadLine(); Process.BeginErrorReadLine(); } WriteMenCoderLogLine("Launching Memcoder with - " + Process.StartInfo.Arguments); Utilities.DebugLine("[Transcode] Transcoding job started" + (Process.HasExited ? ", exit-code=" + Process.ExitCode : "")); if (Process.HasExited) return Process.ExitCode; return 0; }