diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index 7460a9f06b..0567bdfd9e 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -163,8 +163,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV var durationParam = " -t " + _mediaEncoder.GetTimeParameter(duration.Ticks); var inputModifiers = "-fflags +genpts -async 1 -vsync -1"; - var mapArgs = "-map 0 -ignore_unknown"; - var commandLineArgs = "-i \"{0}\"{5} " + mapArgs + " {2} -map_metadata -1 -threads 0 {3}{4} -y \"{1}\""; + var commandLineArgs = "-i \"{0}\"{5} {2} -map_metadata -1 -threads 0 {3}{4} -y \"{1}\""; long startTimeTicks = 0; //if (mediaSource.DateLiveStreamOpened.HasValue) @@ -207,7 +206,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV // do not copy aac because many players have difficulty with aac_latm if (_liveTvOptions.EnableOriginalAudioWithEncodedRecordings && !string.Equals(inputAudioCodec, "aac", StringComparison.OrdinalIgnoreCase)) { - return "-codec:a copy"; + return "-codec:a:0 copy"; } var audioChannels = 2; @@ -216,7 +215,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { audioChannels = audioStream.Channels ?? audioChannels; } - return "-codec:a aac -strict experimental -ab 320000"; + return "-codec:a:0 aac -strict experimental -ab 320000"; } private bool EncodeVideo(MediaSourceInfo mediaSource) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index ad61f3e73c..18508a3997 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -154,10 +154,6 @@ namespace MediaBrowser.Controller.MediaEncoding { return "mpegts"; } - if (string.Equals(container, "mpg", StringComparison.OrdinalIgnoreCase)) - { - return "mpeg"; - } // For these need to find out the ffmpeg names if (string.Equals(container, "m2ts", StringComparison.OrdinalIgnoreCase)) { @@ -171,12 +167,21 @@ namespace MediaBrowser.Controller.MediaEncoding { return null; } + if (string.Equals(container, "mpg", StringComparison.OrdinalIgnoreCase)) + { + return null; + } + if (string.Equals(container, "mpeg", StringComparison.OrdinalIgnoreCase)) + { + return null; + } return container; } public string GetDecoderFromCodec(string codec) { + // For these need to find out the ffmpeg names if (string.Equals(codec, "mp2", StringComparison.OrdinalIgnoreCase)) { return null; @@ -185,6 +190,10 @@ namespace MediaBrowser.Controller.MediaEncoding { return null; } + if (string.Equals(codec, "eac3", StringComparison.OrdinalIgnoreCase)) + { + return null; + } return codec; } @@ -1494,7 +1503,7 @@ namespace MediaBrowser.Controller.MediaEncoding //inputModifier += " -noaccurate_seek"; } - if (!string.IsNullOrWhiteSpace(state.InputContainer) && state.VideoType == VideoType.VideoFile) + if (!string.IsNullOrWhiteSpace(state.InputContainer) && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType)) { var inputFormat = GetInputFormat(state.InputContainer); if (!string.IsNullOrWhiteSpace(inputFormat)) @@ -1504,7 +1513,7 @@ namespace MediaBrowser.Controller.MediaEncoding } // Only do this for video files due to sometimes unpredictable codec names coming from BDInfo - if (state.RunTimeTicks.HasValue && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType) && state.VideoType == VideoType.VideoFile) + if (state.RunTimeTicks.HasValue && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType)) { foreach (var stream in state.MediaSource.MediaStreams) { diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index ca22dac2db..4a1bf53057 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -734,6 +734,16 @@ namespace MediaBrowser.MediaEncoding.Subtitles } } + var charsetFromLanguage = string.IsNullOrWhiteSpace(language) + ? null + : GetSubtitleFileCharacterSetFromLanguage(language); + + // This assumption should only be made for external subtitles + if (!string.IsNullOrWhiteSpace(charsetFromLanguage) && !string.Equals(charsetFromLanguage, "windows-1252", StringComparison.OrdinalIgnoreCase)) + { + return charsetFromLanguage; + } + var charset = await DetectCharset(path, language, protocol, cancellationToken).ConfigureAwait(false); if (!string.IsNullOrWhiteSpace(charset)) @@ -746,12 +756,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles return charset; } - if (!string.IsNullOrWhiteSpace(language)) - { - return GetSubtitleFileCharacterSetFromLanguage(language); - } - - return null; + return charsetFromLanguage; } public string GetSubtitleFileCharacterSetFromLanguage(string language) diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index c78c929670..5122227e1d 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -827,72 +827,6 @@ namespace MediaBrowser.Model.Dto get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Video); } } - /// - /// Gets a value indicating whether this instance is audio. - /// - /// true if this instance is audio; otherwise, false. - [IgnoreDataMember] - public bool IsAudio - { - get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Audio); } - } - - /// - /// Gets a value indicating whether this instance is game. - /// - /// true if this instance is game; otherwise, false. - [IgnoreDataMember] - public bool IsGame - { - get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Game); } - } - - /// - /// Gets a value indicating whether this instance is person. - /// - /// true if this instance is person; otherwise, false. - [IgnoreDataMember] - public bool IsPerson - { - get { return StringHelper.EqualsIgnoreCase(Type, "Person"); } - } - - [IgnoreDataMember] - public bool IsMusicGenre - { - get { return StringHelper.EqualsIgnoreCase(Type, "MusicGenre"); } - } - - [IgnoreDataMember] - public bool IsGameGenre - { - get { return StringHelper.EqualsIgnoreCase(Type, "GameGenre"); } - } - - [IgnoreDataMember] - public bool IsGenre - { - get { return StringHelper.EqualsIgnoreCase(Type, "Genre"); } - } - - [IgnoreDataMember] - public bool IsArtist - { - get { return StringHelper.EqualsIgnoreCase(Type, "MusicArtist"); } - } - - [IgnoreDataMember] - public bool IsAlbum - { - get { return StringHelper.EqualsIgnoreCase(Type, "MusicAlbum"); } - } - - [IgnoreDataMember] - public bool IsStudio - { - get { return StringHelper.EqualsIgnoreCase(Type, "Studio"); } - } - /// /// Gets or sets the program identifier. ///