mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics.Eventing.Reader;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -143,15 +142,36 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
}
|
}
|
||||||
catch (DllNotFoundException)
|
catch (DllNotFoundException)
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(LanguageSettings.Current.AddWaveform.VlcMediaPlayerNotFound + Environment.NewLine +
|
var isFfmpegAvailable = !string.IsNullOrEmpty(Configuration.Settings.General.FFmpegLocation) && File.Exists(Configuration.Settings.General.FFmpegLocation);
|
||||||
Environment.NewLine + LanguageSettings.Current.AddWaveform.GoToVlcMediaPlayerHomePage,
|
if (isFfmpegAvailable)
|
||||||
LanguageSettings.Current.AddWaveform.VlcMediaPlayerNotFoundTitle,
|
|
||||||
MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
||||||
{
|
{
|
||||||
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();
|
process.Start();
|
||||||
@ -502,6 +522,5 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
DialogResult = DialogResult.Cancel;
|
DialogResult = DialogResult.Cancel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user