Fix audio VBR calculation
Pass encoder, not codec
This commit is contained in:
parent
6a39882a70
commit
e0a7e9baa0
|
@ -1693,7 +1693,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
||||||
|
|
||||||
if (audioBitrate.HasValue && !EncodingHelper.LosslessAudioCodecs.Contains(state.ActualOutputAudioCodec, StringComparison.OrdinalIgnoreCase))
|
if (audioBitrate.HasValue && !EncodingHelper.LosslessAudioCodecs.Contains(state.ActualOutputAudioCodec, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var vbrParam = _encodingHelper.GetAudioVbrModeParam(state.OutputAudioCodec, audioBitrate.Value / (audioChannels ?? 2));
|
var vbrParam = _encodingHelper.GetAudioVbrModeParam(audioCodec, audioBitrate.Value / (audioChannels ?? 2));
|
||||||
if (_encodingOptions.EnableAudioVbr && vbrParam is not null)
|
if (_encodingOptions.EnableAudioVbr && vbrParam is not null)
|
||||||
{
|
{
|
||||||
audioTranscodeParams += vbrParam;
|
audioTranscodeParams += vbrParam;
|
||||||
|
@ -1760,7 +1760,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
||||||
var bitrate = state.OutputAudioBitrate;
|
var bitrate = state.OutputAudioBitrate;
|
||||||
if (bitrate.HasValue && !EncodingHelper.LosslessAudioCodecs.Contains(actualOutputAudioCodec, StringComparison.OrdinalIgnoreCase))
|
if (bitrate.HasValue && !EncodingHelper.LosslessAudioCodecs.Contains(actualOutputAudioCodec, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var vbrParam = _encodingHelper.GetAudioVbrModeParam(actualOutputAudioCodec, bitrate.Value / (channels ?? 2));
|
var vbrParam = _encodingHelper.GetAudioVbrModeParam(audioCodec, bitrate.Value / (channels ?? 2));
|
||||||
if (_encodingOptions.EnableAudioVbr && vbrParam is not null)
|
if (_encodingOptions.EnableAudioVbr && vbrParam is not null)
|
||||||
{
|
{
|
||||||
args += vbrParam;
|
args += vbrParam;
|
||||||
|
|
|
@ -6015,7 +6015,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
|
|
||||||
if (bitrate.HasValue && !LosslessAudioCodecs.Contains(outputCodec, StringComparison.OrdinalIgnoreCase))
|
if (bitrate.HasValue && !LosslessAudioCodecs.Contains(outputCodec, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var vbrParam = GetAudioVbrModeParam(outputCodec, bitrate.Value / (channels ?? 2));
|
var vbrParam = GetAudioVbrModeParam(GetAudioEncoder(state), bitrate.Value / (channels ?? 2));
|
||||||
if (encodingOptions.EnableAudioVbr && vbrParam is not null)
|
if (encodingOptions.EnableAudioVbr && vbrParam is not null)
|
||||||
{
|
{
|
||||||
audioTranscodeParams.Add(vbrParam);
|
audioTranscodeParams.Add(vbrParam);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user