diff --git a/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.cs b/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.cs index 99c9e93a..9f0fb9f3 100644 --- a/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.cs +++ b/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.cs @@ -122,6 +122,17 @@ protected virtual void FillFFMpegArgumentsList() } break; + case OutputType.m4a: + { + string channelArgs = ConversionJob_FFMPEG.ComputeAudioChannelArgs(this.ConversionPreset); + //https://stackoverflow.com/questions/62486428/using-ffmpeg-to-convert-flac-to-alac-with-cover-art + string encoderArgs = $"-c:a alac -c:v copy {channelArgs}"; + + string arguments = string.Format("-n -stats -i \"{0}\" {2} \"{1}\"", this.InputFilePath, this.OutputFilePath, encoderArgs); + + this.ffmpegArgumentStringByPass.Add(new FFMpegPass(arguments)); + } + break; case OutputType.Avi: { diff --git a/Application/FileConverter/ConversionPreset/ConversionPreset.cs b/Application/FileConverter/ConversionPreset/ConversionPreset.cs index 1204ea6d..ee5174fe 100644 --- a/Application/FileConverter/ConversionPreset/ConversionPreset.cs +++ b/Application/FileConverter/ConversionPreset/ConversionPreset.cs @@ -421,6 +421,11 @@ private void InitializeDefaultSettings(OutputType outputType) this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.EnableFFMPEGCustomCommand, "False"); this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.FFMPEGCustomCommand, string.Empty); break; + case OutputType.m4a: + this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioChannelCount, "0"); + this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.EnableFFMPEGCustomCommand, "False"); + this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.FFMPEGCustomCommand, string.Empty); + break; case OutputType.Flac: this.InitializeSettingsValue(ConversionPreset.ConversionSettingKeys.AudioChannelCount, "0"); diff --git a/Application/FileConverter/FileConverter.csproj b/Application/FileConverter/FileConverter.csproj index 70979b37..3c882125 100644 --- a/Application/FileConverter/FileConverter.csproj +++ b/Application/FileConverter/FileConverter.csproj @@ -278,9 +278,13 @@ Settings.settings True - + + Designer + - + + Designer + diff --git a/Application/FileConverter/Helpers.cs b/Application/FileConverter/Helpers.cs index a1e3b02f..7a73996f 100644 --- a/Application/FileConverter/Helpers.cs +++ b/Application/FileConverter/Helpers.cs @@ -199,6 +199,7 @@ public static bool IsOutputTypeCompatibleWithCategory(OutputType outputType, str switch (outputType) { case OutputType.Aac: + case OutputType.m4a: case OutputType.Flac: case OutputType.Mp3: case OutputType.Ogg: diff --git a/Application/FileConverter/OutputType.cs b/Application/FileConverter/OutputType.cs index fda2caf1..c09e00c6 100644 --- a/Application/FileConverter/OutputType.cs +++ b/Application/FileConverter/OutputType.cs @@ -7,6 +7,7 @@ public enum OutputType None, Aac, + m4a, Avi, Flac, Gif, diff --git a/Application/FileConverter/Settings.default.xml b/Application/FileConverter/Settings.default.xml index 420de1d2..96c3b2fb 100644 --- a/Application/FileConverter/Settings.default.xml +++ b/Application/FileConverter/Settings.default.xml @@ -385,6 +385,7 @@ 3gp + Alac 3gpp avi bik @@ -419,6 +420,42 @@ (p)(f) + + 3gp + 3gpp + Aac + avi + bik + flv + m4v + mkv + mov + mp4 + mpg + mpeg + ogv + rm + ts + webm + wmv + aac + aiff + ape + flac + m4a + m4b + mp3 + oga + ogg + opus + wav + wma + None + + + + (p)(f) + vob None diff --git a/Application/FileConverter/ViewModels/SettingsViewModel.cs b/Application/FileConverter/ViewModels/SettingsViewModel.cs index 0b201e5d..5fe5e6aa 100644 --- a/Application/FileConverter/ViewModels/SettingsViewModel.cs +++ b/Application/FileConverter/ViewModels/SettingsViewModel.cs @@ -75,6 +75,7 @@ public SettingsViewModel() outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Ogg)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Mp3)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Aac)); + outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.m4a)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Flac)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Wav)); outputTypeViewModels.Add(new OutputTypeViewModel(OutputType.Mkv)); diff --git a/Application/FileConverter/Views/Resources/ConversionPresetTemplates.xaml b/Application/FileConverter/Views/Resources/ConversionPresetTemplates.xaml index 98ddf1e7..a9fe430e 100644 --- a/Application/FileConverter/Views/Resources/ConversionPresetTemplates.xaml +++ b/Application/FileConverter/Views/Resources/ConversionPresetTemplates.xaml @@ -163,6 +163,25 @@ + + + + + + + + + + + + + @@ -621,6 +640,9 @@ + + +