add pcm format when codec is pcm_*

This commit is contained in:
YuLong Yao 2023-10-02 09:03:00 +08:00
parent b83217d1d7
commit 808e59fdda
No known key found for this signature in database
GPG Key ID: FF6CE608CD728420

View File

@ -6242,6 +6242,12 @@ namespace MediaBrowser.Controller.MediaEncoding
audioTranscodeParams.Add("-acodec " + GetAudioEncoder(state));
}
if (GetAudioEncoder(state).StartsWith("pcm_", StringComparison.Ordinal))
{
audioTranscodeParams.Add(string.Concat("-f ", GetAudioEncoder(state).Substring(4)));
audioTranscodeParams.Add("-ar " + state.BaseRequest.AudioBitRate);
}
if (!string.Equals(outputCodec, "opus", StringComparison.OrdinalIgnoreCase))
{
// opus only supports specific sampling rates