mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
Allow using "ffmpeg" for generating waveform on Linux
This commit is contained in:
parent
504ae9373d
commit
d9078b1b45
@ -86,13 +86,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
if (Configuration.Settings.General.UseFFmpegForWaveExtraction && File.Exists(Configuration.Settings.General.FFmpegLocation))
|
||||
if (Configuration.Settings.General.UseFFmpegForWaveExtraction && (File.Exists(Configuration.Settings.General.FFmpegLocation)) || !Configuration.IsRunningOnWindows)
|
||||
{
|
||||
encoderName = "FFmpeg";
|
||||
string audioParameter = string.Empty;
|
||||
if (audioTrackNumber > 0)
|
||||
{
|
||||
audioParameter = string.Format("-map 0:a:{0}", audioTrackNumber);
|
||||
audioParameter = $"-map 0:a:{audioTrackNumber}";
|
||||
}
|
||||
|
||||
const string fFmpegWaveTranscodeSettings = "-i \"{0}\" -vn -ar 24000 -ac 2 -ab 128 -vol 448 -f wav {2} \"{1}\"";
|
||||
@ -106,6 +106,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
// "-map 0:a:0" is the first audio stream, "-map 0:a:1" is the second audio stream
|
||||
|
||||
exeFilePath = Configuration.Settings.General.FFmpegLocation;
|
||||
if (!Configuration.IsRunningOnWindows)
|
||||
{
|
||||
exeFilePath = "ffmpeg";
|
||||
}
|
||||
parameters = string.Format(fFmpegWaveTranscodeSettings, inputVideoFile, outWaveFile, audioParameter);
|
||||
}
|
||||
return new Process { StartInfo = new ProcessStartInfo(exeFilePath, parameters) { WindowStyle = ProcessWindowStyle.Hidden } };
|
||||
|
@ -535,13 +535,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
checkBoxUseFFmpeg.Text = language.WaveformUseFFmpeg;
|
||||
buttonDownloadFfmpeg.Text = language.DownloadFFmpeg;
|
||||
if (Configuration.IsRunningOnLinux || Configuration.IsRunningOnMac)
|
||||
if (!Configuration.IsRunningOnWindows)
|
||||
{
|
||||
buttonDownloadFfmpeg.Visible = false;
|
||||
}
|
||||
labelFFmpegPath.Visible = false;
|
||||
textBoxFFmpegPath.Visible = false;
|
||||
buttonBrowseToFFmpeg.Visible = false;
|
||||
|
||||
if (Configuration.IsRunningOnLinux)
|
||||
{
|
||||
buttonMpvSettings.Visible = false;
|
||||
radioButtonVideoPlayerDirectShow.Enabled = false;
|
||||
radioButtonVideoPlayerMpcHc.Enabled = false;
|
||||
|
Loading…
Reference in New Issue
Block a user