add more to mbt endpoints

This commit is contained in:
Luke Pulverenti
2013-10-05 21:04:41 -04:00
parent 94becdd339
commit 82ffaafc03
6 changed files with 63 additions and 19 deletions

View File

@@ -282,6 +282,14 @@ namespace MediaBrowser.Api.Playback
string.Format(" -vf \"scale={0}:-1{1}\"", request.Width.Value, assSubtitleParam);
}
// If a fixed height was requested
if (request.Height.HasValue)
{
return isH264Output ?
string.Format(" -vf \"scale={0}:trunc(oh/a/2)*2{1}\"", request.Height.Value, assSubtitleParam) :
string.Format(" -vf \"scale=-1{1}:{0}\"", request.Height.Value, assSubtitleParam);
}
// If a max width was requested
if (request.MaxWidth.HasValue && (!request.MaxHeight.HasValue || state.VideoStream == null))
{
@@ -290,6 +298,14 @@ namespace MediaBrowser.Api.Playback
string.Format(" -vf \"scale=min(iw\\,{0}):-1{1}\"", request.MaxWidth.Value, assSubtitleParam);
}
// If a max height was requested
if (request.MaxHeight.HasValue && (!request.MaxWidth.HasValue || state.VideoStream == null))
{
return isH264Output ?
string.Format(" -vf \"scale=min(ih\\,{0}):trunc(oh/a/2)*2{1}\"", request.MaxHeight.Value, assSubtitleParam) :
string.Format(" -vf \"scale=min(ih\\,{0}):-1{1}\"", request.MaxHeight.Value, assSubtitleParam);
}
if (state.VideoStream == null)
{
// No way to figure this out