relocate more ffmpeg params. add channel delay

This commit is contained in:
Luke Pulverenti
2014-01-21 22:07:33 -05:00
parent 3d697cdab2
commit cf1dac60f6
4 changed files with 23 additions and 17 deletions

View File

@@ -622,7 +622,7 @@ namespace MediaBrowser.Api.Playback
/// <param name="videoType">Type of the video.</param>
/// <param name="isoType">Type of the iso.</param>
/// <returns>System.String.</returns>
protected string GetProbeSizeArgument(string mediaPath, bool isVideo, VideoType? videoType, IsoType? isoType)
private string GetProbeSizeArgument(string mediaPath, bool isVideo, VideoType? videoType, IsoType? isoType)
{
var type = !isVideo ? MediaEncoderHelpers.GetInputType(null, null) :
MediaEncoderHelpers.GetInputType(videoType, isoType);
@@ -918,7 +918,7 @@ namespace MediaBrowser.Api.Playback
/// </summary>
/// <param name="path">The path.</param>
/// <returns>System.String.</returns>
protected string GetUserAgentParam(string path)
private string GetUserAgentParam(string path)
{
var useragent = GetUserAgent(path);
@@ -1092,6 +1092,8 @@ namespace MediaBrowser.Api.Playback
state.AudioSync = 1000;
state.DeInterlace = true;
state.InputFormat = "mpegts";
await Task.Delay(1000, cancellationToken).ConfigureAwait(false);
}
else
{
@@ -1147,6 +1149,21 @@ namespace MediaBrowser.Api.Playback
{
var inputModifier = string.Empty;
var probeSize = GetProbeSizeArgument(state.MediaPath, state.IsInputVideo, state.VideoType, state.IsoType);
inputModifier += " " + probeSize;
inputModifier = inputModifier.Trim();
inputModifier += " " + GetUserAgentParam(state.MediaPath);
inputModifier = inputModifier.Trim();
inputModifier += " " + GetFastSeekCommandLineParameter(state.Request);
inputModifier = inputModifier.Trim();
if (state.VideoRequest != null)
{
inputModifier += " -fflags genpts";
}
if (!string.IsNullOrEmpty(state.InputFormat))
{
inputModifier += " -f " + state.InputFormat;
@@ -1161,7 +1178,7 @@ namespace MediaBrowser.Api.Playback
{
inputModifier += " -acodec " + state.InputAudioCodec;
}
if (state.ReadInputAtNativeFramerate)
{
inputModifier += " -re";