diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 1da79fd133..a19b66af60 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -813,11 +813,11 @@ namespace MediaBrowser.Api.Playback
}
///
- /// Gets the name of the output audio codec
+ /// Gets the audio encoder.
///
/// The request.
/// System.String.
- private string GetAudioCodec(StreamRequest request)
+ protected string GetAudioEncoder(StreamRequest request)
{
var codec = request.AudioCodec;
@@ -846,7 +846,7 @@ namespace MediaBrowser.Api.Playback
///
/// The request.
/// System.String.
- private string GetVideoCodec(VideoStreamRequest request)
+ protected string GetVideoEncoder(VideoStreamRequest request)
{
var codec = request.VideoCodec;
@@ -1665,13 +1665,13 @@ namespace MediaBrowser.Api.Playback
state.OutputAudioBitrate = GetAudioBitrateParam(state.Request, state.AudioStream);
state.OutputAudioSampleRate = request.AudioSampleRate;
- state.OutputAudioCodec = GetAudioCodec(state.Request);
+ state.OutputAudioCodec = state.Request.AudioCodec;
state.OutputAudioChannels = GetNumAudioChannelsParam(state.Request, state.AudioStream, state.OutputAudioCodec);
if (videoRequest != null)
{
- state.OutputVideoCodec = GetVideoCodec(videoRequest);
+ state.OutputVideoCodec = state.VideoRequest.VideoCodec;
state.OutputVideoBitrate = GetVideoBitrateParamValue(state.VideoRequest, state.VideoStream);
if (state.OutputVideoBitrate.HasValue)
@@ -2061,15 +2061,18 @@ namespace MediaBrowser.Api.Playback
state.MimeType = mediaProfile.MimeType;
}
- var transcodingProfile = state.VideoRequest == null ?
- profile.GetAudioTranscodingProfile(state.OutputContainer, audioCodec) :
- profile.GetVideoTranscodingProfile(state.OutputContainer, audioCodec, videoCodec);
-
- if (transcodingProfile != null)
+ if (!state.Request.Static)
{
- state.EstimateContentLength = transcodingProfile.EstimateContentLength;
- state.EnableMpegtsM2TsMode = transcodingProfile.EnableMpegtsM2TsMode;
- state.TranscodeSeekInfo = transcodingProfile.TranscodeSeekInfo;
+ var transcodingProfile = state.VideoRequest == null ?
+ profile.GetAudioTranscodingProfile(state.OutputContainer, audioCodec) :
+ profile.GetVideoTranscodingProfile(state.OutputContainer, audioCodec, videoCodec);
+
+ if (transcodingProfile != null)
+ {
+ state.EstimateContentLength = transcodingProfile.EstimateContentLength;
+ state.EnableMpegtsM2TsMode = transcodingProfile.EnableMpegtsM2TsMode;
+ state.TranscodeSeekInfo = transcodingProfile.TranscodeSeekInfo;
+ }
}
}
diff --git a/MediaBrowser.Api/Playback/Dash/MpegDashService.cs b/MediaBrowser.Api/Playback/Dash/MpegDashService.cs
index 1a90dbb531..47eb38b2d5 100644
--- a/MediaBrowser.Api/Playback/Dash/MpegDashService.cs
+++ b/MediaBrowser.Api/Playback/Dash/MpegDashService.cs
@@ -378,9 +378,9 @@ namespace MediaBrowser.Api.Playback.Dash
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";
}
@@ -408,7 +408,7 @@ namespace MediaBrowser.Api.Playback.Dash
protected override string GetVideoArguments(StreamState state)
{
- var codec = state.OutputVideoCodec;
+ var codec = GetVideoEncoder(state.VideoRequest);
var args = "-codec:v:0 " + codec;
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 41d26417d6..854d5b4ad5 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -797,7 +797,7 @@ namespace MediaBrowser.Api.Playback.Hls
return string.Join(" ", audioTranscodeParams.ToArray());
}
- var codec = state.OutputAudioCodec;
+ var codec = GetAudioEncoder(state.Request);
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
{
@@ -832,7 +832,7 @@ namespace MediaBrowser.Api.Playback.Hls
return string.Empty;
}
- var codec = state.OutputVideoCodec;
+ var codec = GetVideoEncoder(state.VideoRequest);
var args = "-codec:v:0 " + codec;
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
index f21be190fe..d8e3423fcf 100644
--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
@@ -48,9 +48,9 @@ namespace MediaBrowser.Api.Playback.Hls
/// System.String.
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";
}
@@ -83,7 +83,7 @@ namespace MediaBrowser.Api.Playback.Hls
/// System.String.
protected override string GetVideoArguments(StreamState state)
{
- var codec = state.OutputVideoCodec;
+ var codec = GetVideoEncoder(state.VideoRequest);
var args = "-codec:v:0 " + codec;
diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs
index 283f9671fa..ebd72b2ce1 100644
--- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs
@@ -89,7 +89,7 @@ namespace MediaBrowser.Api.Playback.Progressive
protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding)
{
// Get the output codec name
- var videoCodec = state.OutputVideoCodec;
+ var videoCodec = GetVideoEncoder(state.VideoRequest);
var format = string.Empty;
var keyFrame = string.Empty;
@@ -183,11 +183,11 @@ namespace MediaBrowser.Api.Playback.Progressive
}
// Get the output codec name
- var codec = state.OutputAudioCodec;
+ var codec = GetAudioEncoder(state.Request);
var args = "-codec:a:0 " + codec;
- if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
+ if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
{
return args;
}