public static void Run() { using (FileEncoder fenc = new FileEncoder()) { if (fenc.ShowDialog() != DialogResult.OK) { return; } if (fenc._builder == null) { return; } try { string str = fenc._builder.Output(fenc.tbOut.Text); LogWindow lw = new LogWindow(); lw.Show(); lw.Log(str + "\r\n"); using (Process p = new Process()) { ProcessStartInfo psi = new ProcessStartInfo(Common.ffmpeg, str); psi.UseShellExecute = false; psi.CreateNoWindow = true; psi.RedirectStandardError = true; p.StartInfo = psi; p.Start(); string line; while ((line = p.StandardError.ReadLine()) != null) { lw.Log(line); Application.DoEvents(); } p.WaitForExit(); } lw.Log("\r\n---------------------------------------------\r\nFin de l'opération\r\n---------------------------------------------"); lw.CanBeClosed = true; } catch (Exception ex) { MessageBox.Show(ex.Message); MessageBox.Show(ex.StackTrace); } } }
public static void FileEncode() { FileEncoder.Run(); }
public static void Run() { using(FileEncoder fenc = new FileEncoder()) { if(fenc.ShowDialog() != DialogResult.OK) return; if(fenc._builder == null) return; try { string str = fenc._builder.Output(fenc.tbOut.Text); LogWindow lw = new LogWindow(); lw.Show(); lw.Log(str + "\r\n"); using(Process p = new Process()) { ProcessStartInfo psi = new ProcessStartInfo(Common.ffmpeg, str); psi.UseShellExecute = false; psi.CreateNoWindow = true; psi.RedirectStandardError = true; p.StartInfo = psi; p.Start(); string line; while ((line = p.StandardError.ReadLine()) != null) { lw.Log(line); Application.DoEvents(); } p.WaitForExit(); } lw.Log("\r\n---------------------------------------------\r\nFin de l'opération\r\n---------------------------------------------"); lw.CanBeClosed = true; } catch(Exception ex) { MessageBox.Show(ex.Message); MessageBox.Show(ex.StackTrace); } } }