private void RunFFMPEG(FFmpegJob job)
        {
            Directory.CreateDirectory(Paths.TrackDataFolder(LocationMode.PlayerData));
            App.logger.Debug(("FFMPEG start: " + FFmpegQueue.binaryPath + " " + job.GetCommand()));
            CancellationTokenSource doneCts = new CancellationTokenSource();
            var    done    = doneCts.Token;
            string exepath = FFmpegQueue.binaryPath;
            string command = job.GetCommand();

            new Thread((ThreadStart)(() =>
            {
                string output = "";
                Process process = new Process();
                process.StartInfo.RedirectStandardOutput = true;
                process.StartInfo.RedirectStandardError = true;
                process.StartInfo.UseShellExecute = false;
                process.StartInfo.CreateNoWindow = true;
                process.StartInfo.FileName = exepath;
                process.StartInfo.Arguments = command;
                process.OutputDataReceived += (DataReceivedEventHandler)((s, e) => output += e.Data);
                process.ErrorDataReceived += (DataReceivedEventHandler)((s, e) => output += e.Data);
                process.Start();
                process.WaitForExit();
                process.Close();
                job._message = output;
                doneCts.Cancel();
            })).Start();
            while (!done.IsCancellationRequested)
            {
            }
            job._onFinished.Invoke(job);
            App.logger.Debug("FFMEG done");
        }
        private void OnConvertedToWav(FFmpegJob job)
        {
            App.logger.Debug("FFMPEG complete: " + job._outputPath);
            LocationMode locationMode = LocationMode.PlayerData;

            this.originalFileNameBackup = Path.GetFileNameWithoutExtension(job._inputPath);
            this.PopulateTrackDataFromAudioFile(job._outputPath, locationMode, job._inputPath, true);
        }
 public void Queue(FFmpegJob job) => RunFFMPEG(job);