Example #1
0
 private void slaenge_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
 {
     GenerateVorschau(false);
     Zeitpunkt t = new Zeitpunkt();
     t.setAll(slaenge.Value);
     labInfLaenge.Content = t.ToString();
 }
Example #2
0
        private void CreateExportWorker(object sender, EventArgs e)
        {
            try
            {
                System.Diagnostics.Process p = new System.Diagnostics.Process();
                p.StartInfo.FileName = "ffmpeg.exe";

                Zeitpunkt startZP = new Zeitpunkt();
                startZP.setAll(exportStart);
                Zeitpunkt bisZP = new Zeitpunkt();
                bisZP.setAll(exportLaenge);

                strOutputFile = PfadAufraeumen(System.IO.Path.GetFileNameWithoutExtension(strInputFile) + "_" + startZP.pathString() + "_" + bisZP.pathString());
                //-fs 1000000
                p.StartInfo.Arguments = "-ss " + startZP.ToString() + " -i \"" + strInputFile + "\" -sn -c:v libvpx";
                if (tmpvorlage.imaxfilesize > 0) {
                    p.StartInfo.Arguments += " -fs " + (tmpvorlage.imaxfilesize * 1000000);
                }
                if (tmpvorlage.baudioaus == true) {
                    p.StartInfo.Arguments += " -an";
                }
                p.StartInfo.Arguments += " -crf " + tmpvorlage.icrf + " -qmin " + tmpvorlage.iqmin + " -qmax " + tmpvorlage.iqmax;
                if (tmpvorlage.icropbreite > 0 && tmpvorlage.icrophoehe > 0)
                {
                    p.StartInfo.Arguments += " -vf \"[in]scale=" + tmpvorlage.ibreite + ":" +
                    tmpvorlage.ihoehe + "[middle];[middle]crop=" + tmpvorlage.icropbreite + ":" + tmpvorlage.icrophoehe + ":" +
                    tmpvorlage.icropx + ":" + tmpvorlage.icropy + "[out]\"";
                }
                else {
                    p.StartInfo.Arguments += " -vf \"scale=" + tmpvorlage.ibreite + ":" + tmpvorlage.ihoehe + "\"";
                }
                p.StartInfo.Arguments += " -to " + bisZP.ToString() + " -y \"" + strOutputFile + ".webm\"";

                lsFfmpegLog.Add(p.StartInfo.FileName + " " + p.StartInfo.Arguments);

                p.StartInfo.UseShellExecute = false;
                p.StartInfo.RedirectStandardOutput = true;
                p.StartInfo.CreateNoWindow = true;
                p.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory;
                p.Start();

                p.WaitForExit();
                this.Dispatcher.BeginInvoke(new Action(() => gridContent.IsEnabled = true));
                this.Dispatcher.BeginInvoke(new Action(() => gridContentBlurEffekt.Radius = 0));
                this.Dispatcher.BeginInvoke(new Action(() => gridLoading.Visibility = Visibility.Collapsed));
            }
            catch { MessageBox.Show("Fehler beim encoden des Videos.", "Vorgang abgebrochen", MessageBoxButton.OK, MessageBoxImage.Error);  }
        }