Merge pull request #647 from tikuf/master

Change subtitle seek behavior
This commit is contained in:
Luke 2013-12-15 06:21:52 -08:00
commit 17c4a8461f
2 changed files with 8 additions and 11 deletions

View File

@ -129,7 +129,7 @@ namespace MediaBrowser.Api.Playback.Hls
if (bitrate.HasValue)
{
args += string.Format(" -b:v {0} -maxrate ({0}*.85) -bufsize {0}", bitrate.Value.ToString(UsCulture));
args += string.Format(" -b:v {0} -maxrate ({0}*.80) -bufsize {0}", bitrate.Value.ToString(UsCulture));
}
// Add resolution params, if specified

View File

@ -427,8 +427,8 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
throw new ArgumentNullException("outputPath");
}
var slowSeekParam = GetSlowSeekCommandLineParameter(offset);
var fastSeekParam = GetFastSeekCommandLineParameter(offset);
var slowSeekParam = offset.TotalSeconds > 0 ? " -ss " + offset.TotalSeconds.ToString(UsCulture) : string.Empty;
var encodingParam = string.IsNullOrEmpty(language) ? string.Empty :
GetSubtitleLanguageEncodingParam(language) + " ";
@ -444,12 +444,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
UseShellExecute = false,
FileName = FFMpegPath,
Arguments =
string.Format("{0}{1}-i \"{2}\"{3} \"{4}\"",
fastSeekParam,
encodingParam,
inputPath,
slowSeekParam,
outputPath),
string.Format("{0} -i \"{1}\" {2} -c:s ass \"{3}\"", encodingParam, inputPath, slowSeekParam, outputPath),
WindowStyle = ProcessWindowStyle.Hidden,
ErrorDialog = false
@ -665,7 +660,9 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
throw new ArgumentNullException("outputPath");
}
var slowSeekParam = offset.TotalSeconds > 0 ? " -ss " + offset.TotalSeconds.ToString(UsCulture) : string.Empty;
var slowSeekParam = GetSlowSeekCommandLineParameter(offset);
var fastSeekParam = GetFastSeekCommandLineParameter(offset);
var process = new Process
{
@ -678,7 +675,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
RedirectStandardError = true,
FileName = FFMpegPath,
Arguments = string.Format("-i {0}{1} -map 0:{2} -an -vn -c:s ass \"{3}\"", inputPath, slowSeekParam, subtitleStreamIndex, outputPath),
Arguments = string.Format(" {0} -i {1} {2} -map 0:{3} -an -vn -c:s ass \"{4}\"", fastSeekParam, inputPath, slowSeekParam, subtitleStreamIndex, outputPath),
WindowStyle = ProcessWindowStyle.Hidden,
ErrorDialog = false
}