|
|
|
@ -1711,20 +1711,30 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
return audioTranscodeParams;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// flac and opus are experimental in mp4 muxer
|
|
|
|
|
var strictArgs = string.Empty;
|
|
|
|
|
|
|
|
|
|
if (string.Equals(state.ActualOutputAudioCodec, "flac", StringComparison.OrdinalIgnoreCase)
|
|
|
|
|
|| string.Equals(state.ActualOutputAudioCodec, "opus", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
strictArgs = " -strict -2";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (EncodingHelper.IsCopyCodec(audioCodec))
|
|
|
|
|
{
|
|
|
|
|
var videoCodec = _encodingHelper.GetVideoEncoder(state, _encodingOptions);
|
|
|
|
|
var bitStreamArgs = EncodingHelper.GetAudioBitStreamArguments(state, state.Request.SegmentContainer, state.MediaSource.Container);
|
|
|
|
|
var copyArgs = "-codec:a:0 copy" + bitStreamArgs + strictArgs;
|
|
|
|
|
|
|
|
|
|
if (EncodingHelper.IsCopyCodec(videoCodec) && state.EnableBreakOnNonKeyFrames(videoCodec))
|
|
|
|
|
{
|
|
|
|
|
return "-codec:a:0 copy -strict -2 -copypriorss:a:0 0" + bitStreamArgs;
|
|
|
|
|
return copyArgs + " -copypriorss:a:0 0";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "-codec:a:0 copy -strict -2" + bitStreamArgs;
|
|
|
|
|
return copyArgs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var args = "-codec:a:0 " + audioCodec;
|
|
|
|
|
var args = "-codec:a:0 " + audioCodec + strictArgs;
|
|
|
|
|
|
|
|
|
|
var channels = state.OutputAudioChannels;
|
|
|
|
|
|
|
|
|
@ -1779,11 +1789,12 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
|| string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (EncodingHelper.IsCopyCodec(codec)
|
|
|
|
|
&& (string.Equals(state.VideoStream.CodecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
|
|
|
|
|
&& (string.Equals(state.VideoStream.CodecTag, "dovi", StringComparison.OrdinalIgnoreCase)
|
|
|
|
|
|| string.Equals(state.VideoStream.CodecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
|
|
|
|
|
|| string.Equals(state.VideoStream.CodecTag, "dvhe", StringComparison.OrdinalIgnoreCase)))
|
|
|
|
|
{
|
|
|
|
|
// Prefer dvh1 to dvhe
|
|
|
|
|
args += " -tag:v:0 dvh1";
|
|
|
|
|
args += " -tag:v:0 dvh1 -strict -2";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|