Merge pull request #647 from tikuf/master

Change subtitle seek behavior
pull/702/head
Luke 11 years ago
commit 17c4a8461f

@ -129,7 +129,7 @@ namespace MediaBrowser.Api.Playback.Hls
if (bitrate.HasValue) 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 // Add resolution params, if specified

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

Loading…
Cancel
Save