Fallback to lossy audio codec for bitrate limit (#13127)

pull/13151/head
gnattu 3 months ago committed by GitHub
parent e7ac3e3929
commit 65f722f23c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -235,6 +235,11 @@ public static class StreamingHelpers
state.VideoRequest.MaxHeight = resolution.MaxHeight; state.VideoRequest.MaxHeight = resolution.MaxHeight;
} }
} }
if (!EncodingHelper.IsCopyCodec(state.OutputAudioCodec) && string.Equals(state.AudioStream.Codec, state.OutputAudioCodec, StringComparison.OrdinalIgnoreCase) && state.OutputAudioBitrate.HasValue)
{
state.OutputAudioCodec = state.SupportedAudioCodecs.Where(c => !EncodingHelper.LosslessAudioCodecs.Contains(c)).FirstOrDefault(mediaEncoder.CanEncodeToAudioCodec);
}
} }
var ext = string.IsNullOrWhiteSpace(state.OutputContainer) var ext = string.IsNullOrWhiteSpace(state.OutputContainer)

Loading…
Cancel
Save