mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
preserve coded names
This commit is contained in:
parent
9c9ca620bc
commit
9728668751
@ -813,11 +813,11 @@ namespace MediaBrowser.Api.Playback
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the name of the output audio codec
|
/// Gets the audio encoder.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="request">The request.</param>
|
/// <param name="request">The request.</param>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
private string GetAudioCodec(StreamRequest request)
|
protected string GetAudioEncoder(StreamRequest request)
|
||||||
{
|
{
|
||||||
var codec = request.AudioCodec;
|
var codec = request.AudioCodec;
|
||||||
|
|
||||||
@ -846,7 +846,7 @@ namespace MediaBrowser.Api.Playback
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="request">The request.</param>
|
/// <param name="request">The request.</param>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
private string GetVideoCodec(VideoStreamRequest request)
|
protected string GetVideoEncoder(VideoStreamRequest request)
|
||||||
{
|
{
|
||||||
var codec = request.VideoCodec;
|
var codec = request.VideoCodec;
|
||||||
|
|
||||||
@ -1665,13 +1665,13 @@ namespace MediaBrowser.Api.Playback
|
|||||||
state.OutputAudioBitrate = GetAudioBitrateParam(state.Request, state.AudioStream);
|
state.OutputAudioBitrate = GetAudioBitrateParam(state.Request, state.AudioStream);
|
||||||
state.OutputAudioSampleRate = request.AudioSampleRate;
|
state.OutputAudioSampleRate = request.AudioSampleRate;
|
||||||
|
|
||||||
state.OutputAudioCodec = GetAudioCodec(state.Request);
|
state.OutputAudioCodec = state.Request.AudioCodec;
|
||||||
|
|
||||||
state.OutputAudioChannels = GetNumAudioChannelsParam(state.Request, state.AudioStream, state.OutputAudioCodec);
|
state.OutputAudioChannels = GetNumAudioChannelsParam(state.Request, state.AudioStream, state.OutputAudioCodec);
|
||||||
|
|
||||||
if (videoRequest != null)
|
if (videoRequest != null)
|
||||||
{
|
{
|
||||||
state.OutputVideoCodec = GetVideoCodec(videoRequest);
|
state.OutputVideoCodec = state.VideoRequest.VideoCodec;
|
||||||
state.OutputVideoBitrate = GetVideoBitrateParamValue(state.VideoRequest, state.VideoStream);
|
state.OutputVideoBitrate = GetVideoBitrateParamValue(state.VideoRequest, state.VideoStream);
|
||||||
|
|
||||||
if (state.OutputVideoBitrate.HasValue)
|
if (state.OutputVideoBitrate.HasValue)
|
||||||
@ -2061,15 +2061,18 @@ namespace MediaBrowser.Api.Playback
|
|||||||
state.MimeType = mediaProfile.MimeType;
|
state.MimeType = mediaProfile.MimeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
var transcodingProfile = state.VideoRequest == null ?
|
if (!state.Request.Static)
|
||||||
profile.GetAudioTranscodingProfile(state.OutputContainer, audioCodec) :
|
|
||||||
profile.GetVideoTranscodingProfile(state.OutputContainer, audioCodec, videoCodec);
|
|
||||||
|
|
||||||
if (transcodingProfile != null)
|
|
||||||
{
|
{
|
||||||
state.EstimateContentLength = transcodingProfile.EstimateContentLength;
|
var transcodingProfile = state.VideoRequest == null ?
|
||||||
state.EnableMpegtsM2TsMode = transcodingProfile.EnableMpegtsM2TsMode;
|
profile.GetAudioTranscodingProfile(state.OutputContainer, audioCodec) :
|
||||||
state.TranscodeSeekInfo = transcodingProfile.TranscodeSeekInfo;
|
profile.GetVideoTranscodingProfile(state.OutputContainer, audioCodec, videoCodec);
|
||||||
|
|
||||||
|
if (transcodingProfile != null)
|
||||||
|
{
|
||||||
|
state.EstimateContentLength = transcodingProfile.EstimateContentLength;
|
||||||
|
state.EnableMpegtsM2TsMode = transcodingProfile.EnableMpegtsM2TsMode;
|
||||||
|
state.TranscodeSeekInfo = transcodingProfile.TranscodeSeekInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,9 +378,9 @@ namespace MediaBrowser.Api.Playback.Dash
|
|||||||
|
|
||||||
protected override string GetAudioArguments(StreamState state)
|
protected override string GetAudioArguments(StreamState state)
|
||||||
{
|
{
|
||||||
var codec = state.OutputAudioCodec;
|
var codec = GetAudioEncoder(state.Request);
|
||||||
|
|
||||||
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return "-codec:a:0 copy";
|
return "-codec:a:0 copy";
|
||||||
}
|
}
|
||||||
@ -408,7 +408,7 @@ namespace MediaBrowser.Api.Playback.Dash
|
|||||||
|
|
||||||
protected override string GetVideoArguments(StreamState state)
|
protected override string GetVideoArguments(StreamState state)
|
||||||
{
|
{
|
||||||
var codec = state.OutputVideoCodec;
|
var codec = GetVideoEncoder(state.VideoRequest);
|
||||||
|
|
||||||
var args = "-codec:v:0 " + codec;
|
var args = "-codec:v:0 " + codec;
|
||||||
|
|
||||||
|
@ -797,7 +797,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||||||
return string.Join(" ", audioTranscodeParams.ToArray());
|
return string.Join(" ", audioTranscodeParams.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
var codec = state.OutputAudioCodec;
|
var codec = GetAudioEncoder(state.Request);
|
||||||
|
|
||||||
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
@ -832,7 +832,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
var codec = state.OutputVideoCodec;
|
var codec = GetVideoEncoder(state.VideoRequest);
|
||||||
|
|
||||||
var args = "-codec:v:0 " + codec;
|
var args = "-codec:v:0 " + codec;
|
||||||
|
|
||||||
|
@ -48,9 +48,9 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
protected override string GetAudioArguments(StreamState state)
|
protected override string GetAudioArguments(StreamState state)
|
||||||
{
|
{
|
||||||
var codec = state.OutputAudioCodec;
|
var codec = GetAudioEncoder(state.Request);
|
||||||
|
|
||||||
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return "-codec:a:0 copy";
|
return "-codec:a:0 copy";
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
protected override string GetVideoArguments(StreamState state)
|
protected override string GetVideoArguments(StreamState state)
|
||||||
{
|
{
|
||||||
var codec = state.OutputVideoCodec;
|
var codec = GetVideoEncoder(state.VideoRequest);
|
||||||
|
|
||||||
var args = "-codec:v:0 " + codec;
|
var args = "-codec:v:0 " + codec;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ namespace MediaBrowser.Api.Playback.Progressive
|
|||||||
protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding)
|
protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding)
|
||||||
{
|
{
|
||||||
// Get the output codec name
|
// Get the output codec name
|
||||||
var videoCodec = state.OutputVideoCodec;
|
var videoCodec = GetVideoEncoder(state.VideoRequest);
|
||||||
|
|
||||||
var format = string.Empty;
|
var format = string.Empty;
|
||||||
var keyFrame = string.Empty;
|
var keyFrame = string.Empty;
|
||||||
@ -183,11 +183,11 @@ namespace MediaBrowser.Api.Playback.Progressive
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the output codec name
|
// Get the output codec name
|
||||||
var codec = state.OutputAudioCodec;
|
var codec = GetAudioEncoder(state.Request);
|
||||||
|
|
||||||
var args = "-codec:a:0 " + codec;
|
var args = "-codec:a:0 " + codec;
|
||||||
|
|
||||||
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user