public MkvMerge(Job job, Playlist playlist, string outputMKVPath, IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar) : base(jobObjectManager) { _tempFileRegistrar = tempFileRegistrar; var cli = new MkvMergeCLI(Arguments, tempFileRegistrar) .SetOutputPath(outputMKVPath) .SetSelectedTracks(playlist) .NoGlobalTags() .NoTrackTags() .NoChapters() .SetInputPath(playlist.FullPath) .AttachCoverArt(job.SelectedReleaseMedium) .SetMovieTitle(job) .SetChapters(playlist.Chapters) ; ExePath = cli.ExePath; StdOut += HandleOutputLine; StdErr += HandleOutputLine; Exited += (state, code, exception, time) => OnExited(state, code, job.SelectedReleaseMedium, playlist, outputMKVPath); // CleanExit = false; }
public static string ExeVersion(IJobObjectManager jobObjectManager) { var sb = new StringBuilder(); var arguments = new ArgumentList("-version"); var ffmpeg = new FFmpeg(arguments, jobObjectManager); ffmpeg.StdOut += delegate(string line) { sb.AppendLine(line); }; try { ffmpeg.Start(); // sync } catch (Exception ex) { Logger.Error("FFmpeg.ExeVersion", ex); } var result = sb.ToString(); // we want the first 2 lines only int length = result.IndexOf(Environment.NewLine); length = result.IndexOf(Environment.NewLine, length + 1); if (length > 0) { result = result.Substring(0, length); } return(result); }
private FFmpeg(ArgumentList arguments, IJobObjectManager jobObjectManager) : base(jobObjectManager) { Arguments = arguments; var cli = new FFmpegCLI(Arguments); ExePath = cli.ExePath; }
public PluginInfoForm(IJobObjectManager jobObjectManager) { InitializeComponent(); lblVersion.Text = "looking up version..."; m_thread = new Thread(MakeVersion); m_thread.Start(jobObjectManager); }
private MkvMerge(ArgumentList arguments, IJobObjectManager jobObjectManager) : base(jobObjectManager) { Arguments = arguments; var cli = new MkvMergeCLI(Arguments, null); ExePath = cli.ExePath; }
string GetMkvPropEditVersion(IJobObjectManager jobObjectManager) { string result = ""; var mkvpropedit = new MkvPropEdit(jobObjectManager, null); mkvpropedit.Arguments = new ProcessUtils.ArgumentList("--version"); mkvpropedit.StdOut += delegate(string line) { result += line; }; mkvpropedit.Start(); // sync return(result); }
public PluginInfoForm(IJobObjectManager jobObjectManager) { InitializeComponent(); lblFFMpegVer.Text = lblMkvPropEditVer.Text = "looking up version..."; m_thread1 = new Thread(MakeFFMpegVersion); m_thread1.Start(jobObjectManager); m_thread2 = new Thread(MakeMkvPropEditVersion); m_thread2.Start(jobObjectManager); }
/// <summary> /// Constructs a new <see cref="BackgroundProcessWorker"/> object that uses the given /// <paramref name="jobObjectManager"/> to ensure that child processes are terminated /// if the parent process exits prematurely. /// </summary> /// <param name="jobObjectManager"></param> public BackgroundProcessWorker(IJobObjectManager jobObjectManager) : base(jobObjectManager) { PropertyChanged += OnPropertyChanged; _timer.Elapsed += TimerOnTick; _worker.DoWork += (sender, args) => Start(); _worker.RunWorkerCompleted += delegate(object sender, RunWorkerCompletedEventArgs args) { if (args.Error != null) { Logger.Error("Error occurred while running NonInteractiveProcess in BackgroundWorker", args.Error); } }; }
/// <summary> /// Constructs a new <see href="BackgroundProcessWorker"/> object that uses the given /// <paramref name="jobObjectManager"/> to ensure that child processes are terminated /// if the parent process exits prematurely. /// </summary> /// <param name="jobObjectManager"></param> public BackgroundProcessWorker(IJobObjectManager jobObjectManager) : base(jobObjectManager) { PropertyChanged += OnPropertyChanged; _timer.Elapsed += TimerOnTick; _worker.DoWork += (sender, args) => Start(); _worker.RunWorkerCompleted += delegate(object sender, RunWorkerCompletedEventArgs args) { if (args.Error != null) { Logger.Error("Error occurred while running NonInteractiveProcess in BackgroundWorker", args.Error); } }; }
public static string ExeVersion(IJobObjectManager jobObjectManager) { string result = ""; var arguments = new ArgumentList("--version"); var mkvmerge = new MkvMerge(arguments, jobObjectManager); mkvmerge.StdOut += delegate(string line) { result += line; }; mkvmerge.Start(); // sync return(result); }
public FFmpeg(Job job, Playlist playlist, string outputMKVPath, IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar) : base(jobObjectManager) { _playlistLength = playlist.Length; _inputM2TSPaths = playlist.StreamClips.Select(clip => clip.FileInfo.FullName).ToList(); _selectedTracks = playlist.Tracks.Where(track => track.Keep).ToList(); _outputMKVPath = outputMKVPath; _jobObjectManager = jobObjectManager; _tempFileRegistrar = tempFileRegistrar; _progressFilePath = _tempFileRegistrar.CreateTempFile(GetType(), "progress.log"); _inputFileListPath = _tempFileRegistrar.CreateTempFile(GetType(), "inputFileList.txt"); _indexer = new FFmpegTrackIndexer(playlist); VerifyInputPaths(); VerifySelectedTracks(); SetExePath(); SetFFmpegLogLevel(); RedirectProgressToFile(); ReplaceExistingFiles(); SetInputFiles(); SetMovieTitle(job); MapSelectedTracks(); CopyAllCodecs(); ConvertLPCM(); SetOutputMKVPath(); BeforeStart += OnBeforeStart; StdErr += OnStdErr; Exited += (state, code, exception, time) => OnExited(state, code, job.SelectedReleaseMedium, playlist, _selectedTracks, outputMKVPath); foreach (var track in playlist.Tracks) { var index = _indexer[track]; Logger.InfoFormat("Track w/ stream PID {0} (0x{0:x4}): index {1} => {2} ({3})", track.PID, index.InputIndex, index.OutputIndex, track.Codec); } }
public FFmpeg(Job job, Playlist playlist, string outputMKVPath, IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar) : base(jobObjectManager) { _jobObjectManager = jobObjectManager; _tempFileRegistrar = tempFileRegistrar; _progressFilePath = _tempFileRegistrar.CreateTempFile(GetType(), "progress.log"); _inputFileListPath = _tempFileRegistrar.CreateTempFile(GetType(), "inputFileList.txt"); _reportDumpFileDir = Path.GetDirectoryName(_progressFilePath); _playlistLength = playlist.Length; var inputM2TSPaths = playlist.StreamClips.Select(clip => clip.FileInfo.FullName).ToList(); var selectedTracks = playlist.Tracks.Where(track => track.Keep).ToList(); var trackIndexer = new FFmpegTrackIndexer(playlist); var cli = new FFmpegCLI(Arguments) .DumpLogFile() .SetLogLevel(FFmpegLogLevel.Error) .RedirectProgressToFile(_progressFilePath) .GenPTS() .ReplaceExistingFiles() .SetInputPaths(inputM2TSPaths, _inputFileListPath) .SetMovieTitle(job) .SetSelectedTracks(selectedTracks, trackIndexer) .CopyAllCodecs() .ConvertLPCM() .SetOutputPath(outputMKVPath) ; ExePath = cli.ExePath; BeforeStart += OnBeforeStart; StdErr += OnStdErr; Exited += (state, code, exception, time) => OnExited(state, code, job.SelectedReleaseMedium, playlist, outputMKVPath); CleanExit = false; }
public FFmpegPlugin(IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar) { _jobObjectManager = jobObjectManager; _tempFileRegistrar = tempFileRegistrar; }
public MkvPropEdit(IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar) : base(jobObjectManager) { _tempFileRegistrar = tempFileRegistrar; SetExePath(); }
/// <summary> /// Constructs a new <see cref="NonInteractiveProcess"/> object that uses the given /// <paramref name="jobObjectManager"/> to ensure that child processes are terminated /// if the parent process exits prematurely. /// </summary> /// <param name="jobObjectManager"></param> public NonInteractiveProcess(IJobObjectManager jobObjectManager) { _jobObjectManager = jobObjectManager; }
public MkvPropEdit(IJobObjectManager jobObjectManager) : base(jobObjectManager) { SetExePath(); }
public FFmpegPlugin(IJobObjectManager jobObjectManager) { _jobObjectManager = jobObjectManager; }
/// <summary> /// Constructs a new <see href="NonInteractiveProcess"/> object that uses the given /// <paramref name="jobObjectManager"/> to ensure that child processes are terminated /// if the parent process exits prematurely. /// </summary> /// <param name="jobObjectManager"></param> public NonInteractiveProcess(IJobObjectManager jobObjectManager) { _jobObjectManager = jobObjectManager; }
public MkvMergePlugin(IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar) { _jobObjectManager = jobObjectManager; _tempFileRegistrar = tempFileRegistrar; }