@ -307,7 +307,7 @@ namespace MediaBrowser.Api.Playback
if ( videoCodec . Equals ( "libvpx" , StringComparison . OrdinalIgnoreCase ) )
if ( videoCodec . Equals ( "libvpx" , StringComparison . OrdinalIgnoreCase ) )
{
{
// http://www.webmproject.org/docs/encoder-parameters/
// http://www.webmproject.org/docs/encoder-parameters/
return "-speed 16 -quality good -profile:v 0 -slices 8 ";
return "-speed 16 -quality good -profile:v 0 -slices 8 -crf 18 ";
}
}
// asf/wmv
// asf/wmv
@ -321,11 +321,11 @@ namespace MediaBrowser.Api.Playback
switch ( GetQualitySetting ( ) )
switch ( GetQualitySetting ( ) )
{
{
case EncodingQuality . HighSpeed :
case EncodingQuality . HighSpeed :
return "-preset ultrafast ";
return "-preset ultrafast -crf 18 ";
case EncodingQuality . HighQuality :
case EncodingQuality . HighQuality :
return "-preset superfast ";
return "-preset superfast -crf 18 ";
case EncodingQuality . MaxQuality :
case EncodingQuality . MaxQuality :
return "-preset superfast ";
return "-preset superfast -crf 18 ";
default :
default :
throw new Exception ( "Unrecognized MediaEncodingQuality value." ) ;
throw new Exception ( "Unrecognized MediaEncodingQuality value." ) ;
}
}
@ -381,7 +381,7 @@ namespace MediaBrowser.Api.Playback
audioSampleRate ,
audioSampleRate ,
volParam ,
volParam ,
pts ,
pts ,
state . AudioSync .ToString ( UsCulture ) );
state . AudioSync );
}
}
/// <summary>
/// <summary>
@ -994,6 +994,26 @@ namespace MediaBrowser.Api.Playback
}
}
}
}
protected double? GetFramerateParam ( StreamState state )
{
if ( state . VideoRequest ! = null & & state . VideoRequest . Framerate . HasValue )
{
return state . VideoRequest . Framerate . Value ;
}
if ( state . VideoStream ! = null )
{
var contentRate = state . VideoStream . AverageFrameRate ? ? state . VideoStream . RealFrameRate ;
if ( contentRate . HasValue & & contentRate . Value > 23.976 )
{
return 23.976 ;
}
}
return null ;
}
/// <summary>
/// <summary>
/// Gets the state.
/// Gets the state.
/// </summary>
/// </summary>
@ -1068,7 +1088,7 @@ namespace MediaBrowser.Api.Playback
//state.RunTimeTicks = recording.RunTimeTicks;
//state.RunTimeTicks = recording.RunTimeTicks;
state . ReadInputAtNativeFramerate = recording . RecordingInfo . Status = = RecordingStatus . InProgress ;
state . ReadInputAtNativeFramerate = recording . RecordingInfo . Status = = RecordingStatus . InProgress ;
state . SendInputOverStandardInput = recording . RecordingInfo . Status = = RecordingStatus . InProgress ;
state . SendInputOverStandardInput = recording . RecordingInfo . Status = = RecordingStatus . InProgress ;
state . AudioSync = 1000 ;
state . AudioSync = "1000" ;
state . DeInterlace = true ;
state . DeInterlace = true ;
}
}
else if ( item is LiveTvChannel )
else if ( item is LiveTvChannel )
@ -1096,7 +1116,7 @@ namespace MediaBrowser.Api.Playback
state . SendInputOverStandardInput = true ;
state . SendInputOverStandardInput = true ;
state . ReadInputAtNativeFramerate = true ;
state . ReadInputAtNativeFramerate = true ;
state . AudioSync = 1000 ;
state . AudioSync = "1000" ;
state . DeInterlace = true ;
state . DeInterlace = true ;
}
}
else
else