The Free Software Media System - Server Backend & API
add option to save recordings as mkv
Luke Pulverenti323d4104843d
diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.csindex 242a2d24e4..ee7dd8b985 100644--- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs+++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs@@ -13,6 +13,7 @@ namespace MediaBrowser.Model.LiveTvpublic string SeriesRecordingPath { get; set; }public bool EnableAutoOrganize { get; set; }public bool EnableRecordingEncoding { get; set; }+ public string RecordingEncodingFormat { get; set; }public bool EnableRecordingSubfolders { get; set; }public bool EnableOriginalAudioWithEncodedRecordings { get; set; }@@ -31,6 +32,7 @@ namespace MediaBrowser.Model.LiveTvTunerHosts = new List<TunerHostInfo>();ListingProviders = new List<ListingsProviderInfo>();MediaLocationsCreated = new string[] { };+ RecordingEncodingFormat = "mp4";}}diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.csindex 5e7e3a94f7..75ad3de59e 100644--- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs+++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs@@ -46,9 +46,24 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV_httpClient = httpClient;}+ private string OutputFormat+ {+ get+ {+ var format = _liveTvOptions.RecordingEncodingFormat;++ if (string.Equals(format, "mkv", StringComparison.OrdinalIgnoreCase))+ {+ return "mkv";+ }++ return "mp4";+ }+ }+public string GetOutputPath(MediaSourceInfo mediaSource, string targetFile){- return Path.ChangeExtension(targetFile, ".mp4");+ return Path.ChangeExtension(targetFile, "." + OutputFormat);}public async Task Record(MediaSourceInfo mediaSource, string targetFile, TimeSpan duration, Action onStarted, CancellationToken cancellationToken)@@ -233,15 +248,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTVprivate string GetAudioArgs(MediaSourceInfo mediaSource){- // do not copy aac because many players have difficulty with aac_latm- var copyAudio = new[] { "mp3" };var mediaStreams = mediaSource.MediaStreams ?? new List<MediaStream>();var inputAudioCodec = mediaStreams.Where(i => i.Type == MediaStreamType.Audio).Select(i => i.Codec).FirstOrDefault() ?? string.Empty;- if (copyAudio.Contains(inputAudioCodec, StringComparer.OrdinalIgnoreCase))- {- return "-codec:a:0 copy";- }+ // do not copy aac because many players have difficulty with aac_latmif (_liveTvOptions.EnableOriginalAudioWithEncodedRecordings && !string.Equals(inputAudioCodec, "aac", StringComparison.OrdinalIgnoreCase)){return "-codec:a:0 copy";diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.csindex 8fb0e8f46b..cdacdc81f8 100644--- a/MediaBrowser.ServerApplication/MainStartup.cs+++ b/MediaBrowser.ServerApplication/MainStartup.cs@@ -331,7 +331,7 @@ namespace MediaBrowser.ServerApplicationApplication.Run();}- private static SplashForm _splash;+ internal static SplashForm _splash;private static Thread _splashThread;private static void ShowSplashScreen(Version appVersion, Progress<double> progress, ILogger logger){diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.csindex 3cd6c95d2d..200e2d3ae1 100644--- a/MediaBrowser.ServerApplication/Native/WindowsApp.cs+++ b/MediaBrowser.ServerApplication/Native/WindowsApp.cs@@ -212,7 +212,12 @@ namespace MediaBrowser.ServerApplication.Nativeprivate bool Confirm(){- return MessageBox.Show("Emby has detected that Windows Firewall has been configured in a way that may prevent your other devices from accessing Emby Server. Click OK to remove this rule, or cancel to proceed anyway.", "Windows Firewall", MessageBoxButtons.OKCancel) == DialogResult.OK;+ if (MainStartup._splash == null)+ {+ return false;+ }++ return MessageBox.Show(MainStartup._splash, "Emby has detected that Windows Firewall has been configured in a way that may prevent your other devices from accessing Emby Server. Click OK to remove this rule, or cancel to proceed anyway.", "Windows Firewall", MessageBoxButtons.OKCancel) == DialogResult.OK;}public bool PortsRequireAuthorization(string applicationPath)@@ -242,7 +247,7 @@ namespace MediaBrowser.ServerApplication.Nativeif (data.IndexOf("Block", StringComparison.OrdinalIgnoreCase) != -1){- _logger.Info("Found windows firewall rule: " + data);+ _logger.Info("Found potential windows firewall rule blocking Emby Server: " + data);return Confirm();}