Exemplo n.º 1
0
 private void OnFFmpegProgressChanged(FFmpeg sender, FFmpegProgress ffmpegProgress)
 {
     Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                       (Action)(() =>
     {
         var info = $"Progress: {ffmpegProgress.Percent}%\tSize: {ffmpegProgress.CurrentFileSize}\tSpeed: {ffmpegProgress.CurrentSpeed}";
         txtProgress.Text = info;
         progressBar.Value = ffmpegProgress.Percent;
     }));
 }
Exemplo n.º 2
0
 private void FFmpeg_OnProgressChanged(FFmpeg sender, FFmpegProgress progress)
 {
     Debug.WriteLine(progress.Percent + "%   " + progress.CurrentSpeed + "    "
                     + progress.CurrentFileSize + "    " + progress.CurrentBitRate + "    " +
                     progress.CurrentFrame + "    " + progress.CurrentFrameRate + "    " +
                     progress.CurrentTime + "   ");
     if (InvokeRequired)
     {
         BeginInvoke(new Action(() => FFmpeg_OnProgressChanged(sender, progress)));
         return;
     }
     progressBar1.Value = progress.Percent;
 }
Exemplo n.º 3
0
        private void OnFFmpegProgressChanged(FFmpeg sender, FFmpegProgress ffmpegProgress)
        {
            // چون کدهای این کلاس در یک نخ جدا اجرا میشود، شما باید آنرا
            // Invoke
            // کنید
            if (InvokeRequired)
            {
                BeginInvoke(new Action(() => OnFFmpegProgressChanged(sender, ffmpegProgress)));
                return;
            }
            var info = $"Progress: {ffmpegProgress.Percent}%     Size: {ffmpegProgress.CurrentFileSize}     Speed: {ffmpegProgress.CurrentSpeed}";

            txtProgress.Text  = info;
            progressBar.Value = ffmpegProgress.Percent;
        }