display additional transcoding info in dashboard
This commit is contained in:
@@ -78,8 +78,6 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||
/// <exception cref="System.InvalidOperationException">Only aac and mp3 audio codecs are supported.</exception>
|
||||
protected override string GetCommandLineArguments(string outputPath, StreamState state, bool performSubtitleConversions)
|
||||
{
|
||||
var request = state.Request;
|
||||
|
||||
var audioTranscodeParams = new List<string>();
|
||||
|
||||
var bitrate = state.OutputAudioBitrate;
|
||||
|
||||
@@ -45,53 +45,51 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||
return ext;
|
||||
}
|
||||
|
||||
var videoRequest = state.Request as VideoStreamRequest;
|
||||
var isVideoRequest = state.VideoRequest != null;
|
||||
|
||||
// Try to infer based on the desired video codec
|
||||
if (videoRequest != null && !string.IsNullOrEmpty(videoRequest.VideoCodec))
|
||||
if (isVideoRequest)
|
||||
{
|
||||
if (state.IsInputVideo)
|
||||
{
|
||||
if (string.Equals(videoRequest.VideoCodec, "h264", StringComparison.OrdinalIgnoreCase))
|
||||
var videoCodec = state.VideoRequest.VideoCodec;
|
||||
|
||||
if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".ts";
|
||||
}
|
||||
if (string.Equals(videoRequest.VideoCodec, "theora", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(videoCodec, "theora", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".ogv";
|
||||
}
|
||||
if (string.Equals(videoRequest.VideoCodec, "vpx", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(videoCodec, "vpx", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".webm";
|
||||
}
|
||||
if (string.Equals(videoRequest.VideoCodec, "wmv", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(videoCodec, "wmv", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".asf";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Try to infer based on the desired audio codec
|
||||
if (!string.IsNullOrEmpty(state.Request.AudioCodec))
|
||||
if (!isVideoRequest)
|
||||
{
|
||||
if (!state.IsInputVideo)
|
||||
var audioCodec = state.Request.AudioCodec;
|
||||
|
||||
if (string.Equals("aac", audioCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.Equals("aac", state.Request.AudioCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".aac";
|
||||
}
|
||||
if (string.Equals("mp3", state.Request.AudioCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".mp3";
|
||||
}
|
||||
if (string.Equals("vorbis", state.Request.AudioCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".ogg";
|
||||
}
|
||||
if (string.Equals("wma", state.Request.AudioCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".wma";
|
||||
}
|
||||
return ".aac";
|
||||
}
|
||||
if (string.Equals("mp3", audioCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".mp3";
|
||||
}
|
||||
if (string.Equals("vorbis", audioCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".ogg";
|
||||
}
|
||||
if (string.Equals("wma", audioCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ".wma";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +132,7 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||
}
|
||||
}
|
||||
|
||||
var outputPath = GetOutputFilePath(state);
|
||||
var outputPath = state.OutputFilePath;
|
||||
var outputPathExists = File.Exists(outputPath);
|
||||
|
||||
var isStatic = request.Static ||
|
||||
@@ -243,7 +241,7 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||
private async Task<object> GetStreamResult(StreamState state, IDictionary<string, string> responseHeaders, bool isHeadRequest)
|
||||
{
|
||||
// Use the command line args with a dummy playlist path
|
||||
var outputPath = GetOutputFilePath(state);
|
||||
var outputPath = state.OutputFilePath;
|
||||
|
||||
responseHeaders["Accept-Ranges"] = "none";
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||
protected override string GetCommandLineArguments(string outputPath, StreamState state, bool performSubtitleConversions)
|
||||
{
|
||||
// Get the output codec name
|
||||
var videoCodec = GetVideoCodec(state.VideoRequest);
|
||||
var videoCodec = state.OutputVideoCodec;
|
||||
|
||||
var format = string.Empty;
|
||||
var keyFrame = string.Empty;
|
||||
@@ -190,10 +190,8 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var request = state.Request;
|
||||
|
||||
// Get the output codec name
|
||||
var codec = GetAudioCodec(request);
|
||||
var codec = state.OutputAudioCodec;
|
||||
|
||||
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user