コード例 #1
0
ファイル: FileEncoder.cs プロジェクト: tika06/GUI-ffmpeg
 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
ファイル: Execution.cs プロジェクト: tika06/GUI-ffmpeg
 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);
				}
				
			}
		}