mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Prefer FFmpeg over VLC when generating waveform for the fist time - thx Jamakmake :)
Texts will be improved later...
This commit is contained in:
parent
05391d4ca4
commit
641b70be21
@ -5,7 +5,6 @@ using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
@ -143,15 +142,36 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
catch (DllNotFoundException)
|
||||
{
|
||||
if (MessageBox.Show(LanguageSettings.Current.AddWaveform.VlcMediaPlayerNotFound + Environment.NewLine +
|
||||
Environment.NewLine + LanguageSettings.Current.AddWaveform.GoToVlcMediaPlayerHomePage,
|
||||
LanguageSettings.Current.AddWaveform.VlcMediaPlayerNotFoundTitle,
|
||||
MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
var isFfmpegAvailable = !string.IsNullOrEmpty(Configuration.Settings.General.FFmpegLocation) && File.Exists(Configuration.Settings.General.FFmpegLocation);
|
||||
if (isFfmpegAvailable)
|
||||
{
|
||||
UiUtil.OpenUrl("http://www.videolan.org/");
|
||||
Configuration.Settings.General.UseFFmpegForWaveExtraction = true;
|
||||
process = GetCommandLineProcess(SourceVideoFileName, AudioTrackNumber, targetFile, _encodeParameters, out encoderName);
|
||||
labelInfo.Text = encoderName;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MessageBox.Show(LanguageSettings.Current.Settings.DownloadFFmpeg, "Subtitle Edit", MessageBoxButtons.YesNoCancel) != DialogResult.Yes)
|
||||
{
|
||||
buttonRipWave.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
using (var form = new DownloadFfmpeg())
|
||||
{
|
||||
if (form.ShowDialog(this) == DialogResult.OK && !string.IsNullOrEmpty(form.FFmpegPath))
|
||||
{
|
||||
Configuration.Settings.General.FFmpegLocation = form.FFmpegPath;
|
||||
Configuration.Settings.General.UseFFmpegForWaveExtraction = true;
|
||||
process = GetCommandLineProcess(SourceVideoFileName, AudioTrackNumber, targetFile, _encodeParameters, out encoderName);
|
||||
}
|
||||
else
|
||||
{
|
||||
buttonRipWave.Enabled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
buttonRipWave.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
process.Start();
|
||||
@ -502,6 +522,5 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user