aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2013-12-15 06:21:52 -0800
committerLuke <luke.pulverenti@gmail.com>2013-12-15 06:21:52 -0800
commit17c4a8461f308655dbd6a625a81565f2604787b9 (patch)
treebc276ca19add9783f18c765e3b821476dd9ff99c
parent9c4f122c02155f3344462b452957bd726e13873d (diff)
parent52997275020e0e656f09f8a4b5d270c57ba8596e (diff)
Merge pull request #647 from tikuf/master
Change subtitle seek behavior
-rw-r--r--MediaBrowser.Api/Playback/Hls/VideoHlsService.cs2
-rw-r--r--MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs17
2 files changed, 8 insertions, 11 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
index fe863c862..9d335d2d3 100644
--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
@@ -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
diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs
index 2224c657f..9df8334d5 100644
--- a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs
+++ b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs
@@ -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
}