Merge pull request #785 from tikuf/master

Webm adjustments to cpu threads and quality
This commit is contained in:
Luke 2014-04-16 08:49:10 -04:00
commit 460e4cbd1f
2 changed files with 8 additions and 6 deletions

View File

@ -300,7 +300,7 @@ namespace MediaBrowser.Api.Playback
case EncodingQuality.HighSpeed: case EncodingQuality.HighSpeed:
return 2; return 2;
case EncodingQuality.HighQuality: case EncodingQuality.HighQuality:
return isWebm ? Math.Max(Environment.ProcessorCount - 1, 2) : 0; return isWebm ? Math.Max((int)((Environment.ProcessorCount -1) / 2) , 2) : 0;
case EncodingQuality.MaxQuality: case EncodingQuality.MaxQuality:
return isWebm ? Math.Max(Environment.ProcessorCount - 1, 2) : 0; return isWebm ? Math.Max(Environment.ProcessorCount - 1, 2) : 0;
default: default:
@ -364,14 +364,16 @@ namespace MediaBrowser.Api.Playback
switch (qualitySetting) switch (qualitySetting)
{ {
case EncodingQuality.HighSpeed: case EncodingQuality.HighSpeed:
crf = "18"; crf = "12";
profileScore++; profileScore = 2;
break; break;
case EncodingQuality.HighQuality: case EncodingQuality.HighQuality:
crf = "10"; crf = "8";
profileScore = 1;
break; break;
case EncodingQuality.MaxQuality: case EncodingQuality.MaxQuality:
crf = "4"; crf = "4";
//profilescore aready set to 0
break; break;
default: default:
throw new ArgumentException("Unrecognized quality setting"); throw new ArgumentException("Unrecognized quality setting");
@ -379,7 +381,7 @@ namespace MediaBrowser.Api.Playback
if (isVc1) if (isVc1)
{ {
profileScore++; profileScore = 1;
} }
// http://www.webmproject.org/docs/encoder-parameters/ // http://www.webmproject.org/docs/encoder-parameters/

View File

@ -224,7 +224,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
case EncodingQuality.HighSpeed: case EncodingQuality.HighSpeed:
return 2; return 2;
case EncodingQuality.HighQuality: case EncodingQuality.HighQuality:
return isWebm ? Math.Max(Environment.ProcessorCount - 1, 2) : 0; return isWebm ? Math.Max((int)((Environment.ProcessorCount -1) / 2) , 2) : 0;
case EncodingQuality.MaxQuality: case EncodingQuality.MaxQuality:
return isWebm ? Math.Max(Environment.ProcessorCount - 1, 2) : 0; return isWebm ? Math.Max(Environment.ProcessorCount - 1, 2) : 0;
default: default: