update applyconditions

This commit is contained in:
Luke Pulverenti 2017-09-25 15:15:01 -04:00
parent ab8c0bf1e6
commit d43508a898
2 changed files with 29 additions and 28 deletions

View File

@ -1367,7 +1367,8 @@ namespace MediaBrowser.Controller.MediaEncoding
if (state.DeInterlace("h264") && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase)) if (state.DeInterlace("h264") && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase))
{ {
if (string.Equals(options.DeinterlaceMethod, "bobandweave", StringComparison.OrdinalIgnoreCase)) // If it is already 60fps then it will create an output framerate that is much too high for roku and others to handle
if (string.Equals(options.DeinterlaceMethod, "bobandweave", StringComparison.OrdinalIgnoreCase) && (state.VideoStream.RealFrameRate ?? 60) <= 30)
{ {
filters.Add("yadif=1:-1:0"); filters.Add("yadif=1:-1:0");
} }

View File

@ -777,16 +777,28 @@ namespace MediaBrowser.Model.Dlna
bool applyConditions = true; bool applyConditions = true;
foreach (ProfileCondition applyCondition in i.ApplyConditions) foreach (ProfileCondition applyCondition in i.ApplyConditions)
{ {
bool? isSecondaryAudio = audioStream == null ? null : item.IsSecondaryAudio(audioStream); int? width = videoStream == null ? null : videoStream.Width;
int? inputAudioBitrate = audioStream == null ? null : audioStream.BitRate; int? height = videoStream == null ? null : videoStream.Height;
int? audioChannels = audioStream == null ? null : audioStream.Channels; int? bitDepth = videoStream == null ? null : videoStream.BitDepth;
string audioProfile = audioStream == null ? null : audioStream.Profile; int? videoBitrate = videoStream == null ? null : videoStream.BitRate;
int? inputAudioSampleRate = audioStream == null ? null : audioStream.SampleRate; double? videoLevel = videoStream == null ? null : videoStream.Level;
int? inputAudioBitDepth = audioStream == null ? null : audioStream.BitDepth; string videoProfile = videoStream == null ? null : videoStream.Profile;
float? videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate;
bool? isAnamorphic = videoStream == null ? null : videoStream.IsAnamorphic;
bool? isInterlaced = videoStream == null ? (bool?)null : videoStream.IsInterlaced;
string videoCodecTag = videoStream == null ? null : videoStream.CodecTag;
bool? isAvc = videoStream == null ? null : videoStream.IsAVC;
if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth, audioProfile, isSecondaryAudio)) TransportStreamTimestamp? timestamp = videoStream == null ? TransportStreamTimestamp.None : item.Timestamp;
int? packetLength = videoStream == null ? null : videoStream.PacketLength;
int? refFrames = videoStream == null ? null : videoStream.RefFrames;
int? numAudioStreams = item.GetStreamCount(MediaStreamType.Audio);
int? numVideoStreams = item.GetStreamCount(MediaStreamType.Video);
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{ {
LogConditionFailure(options.Profile, "VideoAudioCodecProfile", applyCondition, item); LogConditionFailure(options.Profile, "VideoCodecProfile", applyCondition, item);
applyConditions = false; applyConditions = false;
break; break;
} }
@ -815,26 +827,14 @@ namespace MediaBrowser.Model.Dlna
bool applyConditions = true; bool applyConditions = true;
foreach (ProfileCondition applyCondition in i.ApplyConditions) foreach (ProfileCondition applyCondition in i.ApplyConditions)
{ {
int? width = videoStream == null ? null : videoStream.Width; bool? isSecondaryAudio = audioStream == null ? null : item.IsSecondaryAudio(audioStream);
int? height = videoStream == null ? null : videoStream.Height; int? inputAudioBitrate = audioStream == null ? null : audioStream.BitRate;
int? bitDepth = videoStream == null ? null : videoStream.BitDepth; int? audioChannels = audioStream == null ? null : audioStream.Channels;
int? videoBitrate = videoStream == null ? null : videoStream.BitRate; string audioProfile = audioStream == null ? null : audioStream.Profile;
double? videoLevel = videoStream == null ? null : videoStream.Level; int? inputAudioSampleRate = audioStream == null ? null : audioStream.SampleRate;
string videoProfile = videoStream == null ? null : videoStream.Profile; int? inputAudioBitDepth = audioStream == null ? null : audioStream.BitDepth;
float? videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate;
bool? isAnamorphic = videoStream == null ? null : videoStream.IsAnamorphic;
bool? isInterlaced = videoStream == null ? (bool?)null : videoStream.IsInterlaced;
string videoCodecTag = videoStream == null ? null : videoStream.CodecTag;
bool? isAvc = videoStream == null ? null : videoStream.IsAVC;
TransportStreamTimestamp? timestamp = videoStream == null ? TransportStreamTimestamp.None : item.Timestamp; if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth, audioProfile, isSecondaryAudio))
int? packetLength = videoStream == null ? null : videoStream.PacketLength;
int? refFrames = videoStream == null ? null : videoStream.RefFrames;
int? numAudioStreams = item.GetStreamCount(MediaStreamType.Audio);
int? numVideoStreams = item.GetStreamCount(MediaStreamType.Video);
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{ {
LogConditionFailure(options.Profile, "VideoCodecProfile", applyCondition, item); LogConditionFailure(options.Profile, "VideoCodecProfile", applyCondition, item);
applyConditions = false; applyConditions = false;