Update DoVi 10bit codec tags and remove extra -strict options

pull/7828/head
nyanmisaka 2 years ago
parent 910995f922
commit fb95fb1a73

@ -1711,20 +1711,30 @@ namespace Jellyfin.Api.Controllers
return audioTranscodeParams; 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)) if (EncodingHelper.IsCopyCodec(audioCodec))
{ {
var videoCodec = _encodingHelper.GetVideoEncoder(state, _encodingOptions); var videoCodec = _encodingHelper.GetVideoEncoder(state, _encodingOptions);
var bitStreamArgs = EncodingHelper.GetAudioBitStreamArguments(state, state.Request.SegmentContainer, state.MediaSource.Container); 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)) 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; var channels = state.OutputAudioChannels;
@ -1779,11 +1789,12 @@ namespace Jellyfin.Api.Controllers
|| string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase)) || string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase))
{ {
if (EncodingHelper.IsCopyCodec(codec) 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))) || string.Equals(state.VideoStream.CodecTag, "dvhe", StringComparison.OrdinalIgnoreCase)))
{ {
// Prefer dvh1 to dvhe // Prefer dvh1 to dvhe
args += " -tag:v:0 dvh1"; args += " -tag:v:0 dvh1 -strict -2";
} }
else else
{ {

@ -529,8 +529,7 @@ namespace MediaBrowser.Controller.MediaEncoding
if (string.Equals(codec, "flac", StringComparison.OrdinalIgnoreCase)) if (string.Equals(codec, "flac", StringComparison.OrdinalIgnoreCase))
{ {
// flac is experimental in mp4 muxer return "flac";
return "flac -strict -2";
} }
return codec.ToLowerInvariant(); return codec.ToLowerInvariant();

@ -121,8 +121,7 @@ namespace MediaBrowser.Model.Entities
var codecTag = CodecTag; var codecTag = CodecTag;
if (string.Equals(codecTag, "dva1", StringComparison.OrdinalIgnoreCase) if (string.Equals(codecTag, "dovi", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvav", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvh1", StringComparison.OrdinalIgnoreCase) || string.Equals(codecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvhe", StringComparison.OrdinalIgnoreCase) || string.Equals(codecTag, "dvhe", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dav1", StringComparison.OrdinalIgnoreCase)) || string.Equals(codecTag, "dav1", StringComparison.OrdinalIgnoreCase))

Loading…
Cancel
Save