예제 #1
0
 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);
         }
     }
 }
예제 #2
0
 public static void FileEncode()
 {
     FileEncoder.Run();
 }
예제 #3
0
		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);
				}
				
			}
		}