omit input container when hw encoding

This commit is contained in:
Luke Pulverenti
2017-03-01 15:29:42 -05:00
parent 5d094874e5
commit a181425e54
4 changed files with 29 additions and 82 deletions

View File

@@ -154,10 +154,6 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return "mpegts";
}
if (string.Equals(container, "mpg", StringComparison.OrdinalIgnoreCase))
{
return "mpeg";
}
// For these need to find out the ffmpeg names
if (string.Equals(container, "m2ts", StringComparison.OrdinalIgnoreCase))
{
@@ -171,12 +167,21 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return null;
}
if (string.Equals(container, "mpg", StringComparison.OrdinalIgnoreCase))
{
return null;
}
if (string.Equals(container, "mpeg", StringComparison.OrdinalIgnoreCase))
{
return null;
}
return container;
}
public string GetDecoderFromCodec(string codec)
{
// For these need to find out the ffmpeg names
if (string.Equals(codec, "mp2", StringComparison.OrdinalIgnoreCase))
{
return null;
@@ -185,6 +190,10 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return null;
}
if (string.Equals(codec, "eac3", StringComparison.OrdinalIgnoreCase))
{
return null;
}
return codec;
}
@@ -1494,7 +1503,7 @@ namespace MediaBrowser.Controller.MediaEncoding
//inputModifier += " -noaccurate_seek";
}
if (!string.IsNullOrWhiteSpace(state.InputContainer) && state.VideoType == VideoType.VideoFile)
if (!string.IsNullOrWhiteSpace(state.InputContainer) && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
{
var inputFormat = GetInputFormat(state.InputContainer);
if (!string.IsNullOrWhiteSpace(inputFormat))
@@ -1504,7 +1513,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
// Only do this for video files due to sometimes unpredictable codec names coming from BDInfo
if (state.RunTimeTicks.HasValue && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType) && state.VideoType == VideoType.VideoFile)
if (state.RunTimeTicks.HasValue && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
{
foreach (var stream in state.MediaSource.MediaStreams)
{