@ -21,8 +21,6 @@ namespace MediaBrowser.Controller.MediaEncoding
{
public class EncodingHelper
{
private static readonly CultureInfo _usCulture = new CultureInfo ( "en-US" ) ;
private readonly IMediaEncoder _mediaEncoder ;
private readonly ISubtitleEncoder _subtitleEncoder ;
@ -816,7 +814,7 @@ namespace MediaBrowser.Controller.MediaEncoding
public static string NormalizeTranscodingLevel ( EncodingJobInfo state , string level )
{
if ( double . TryParse ( level , NumberStyles . Any , _us Culture, out double requestLevel ) )
if ( double . TryParse ( level , NumberStyles . Any , CultureInfo. Invariant Culture, out double requestLevel ) )
{
if ( string . Equals ( state . ActualOutputVideoCodec , "hevc" , StringComparison . OrdinalIgnoreCase )
| | string . Equals ( state . ActualOutputVideoCodec , "h265" , StringComparison . OrdinalIgnoreCase ) )
@ -911,7 +909,7 @@ namespace MediaBrowser.Controller.MediaEncoding
CultureInfo . InvariantCulture ,
"subtitles='{0}:si={1}'{2}" ,
_mediaEncoder . EscapeSubtitleFilterPath ( mediaPath ) ,
state . InternalSubtitleStreamOffset . ToString ( _us Culture) ,
state . InternalSubtitleStreamOffset . ToString ( CultureInfo. Invariant Culture) ,
// fallbackFontParam,
setPtsParam ) ;
}
@ -1217,7 +1215,7 @@ namespace MediaBrowser.Controller.MediaEncoding
param + = string . Format (
CultureInfo . InvariantCulture ,
" -speed 16 -quality good -profile:v {0} -slices 8 -crf {1} -qmin {2} -qmax {3}" ,
profileScore . ToString ( _us Culture) ,
profileScore . ToString ( CultureInfo. Invariant Culture) ,
crf ,
qmin ,
qmax ) ;
@ -1289,7 +1287,7 @@ namespace MediaBrowser.Controller.MediaEncoding
var framerate = GetFramerateParam ( state ) ;
if ( framerate . HasValue )
{
param + = string . Format ( CultureInfo . InvariantCulture , " -r {0}" , framerate . Value . ToString ( _us Culture) ) ;
param + = string . Format ( CultureInfo . InvariantCulture , " -r {0}" , framerate . Value . ToString ( CultureInfo. Invariant Culture) ) ;
}
var targetVideoCodec = state . ActualOutputVideoCodec ;
@ -1393,7 +1391,7 @@ namespace MediaBrowser.Controller.MediaEncoding
else if ( string . Equals ( videoEncoder , "hevc_qsv" , StringComparison . OrdinalIgnoreCase ) )
{
// hevc_qsv use -level 51 instead of -level 153.
if ( double . TryParse ( level , NumberStyles . Any , _us Culture, out double hevcLevel ) )
if ( double . TryParse ( level , NumberStyles . Any , CultureInfo. Invariant Culture, out double hevcLevel ) )
{
param + = " -level " + ( hevcLevel / 3 ) ;
}
@ -1555,7 +1553,7 @@ namespace MediaBrowser.Controller.MediaEncoding
// If a specific level was requested, the source must match or be less than
var level = state . GetRequestedLevel ( videoStream . Codec ) ;
if ( ! string . IsNullOrEmpty ( level )
& & double . TryParse ( level , NumberStyles . Any , _us Culture, out var requestLevel ) )
& & double . TryParse ( level , NumberStyles . Any , CultureInfo. Invariant Culture, out var requestLevel ) )
{
if ( ! videoStream . Level . HasValue )
{
@ -1803,7 +1801,7 @@ namespace MediaBrowser.Controller.MediaEncoding
& & state . AudioStream . Channels . Value > 5
& & ! encodingOptions . DownMixAudioBoost . Equals ( 1 ) )
{
filters . Add ( "volume=" + encodingOptions . DownMixAudioBoost . ToString ( _us Culture) ) ;
filters . Add ( "volume=" + encodingOptions . DownMixAudioBoost . ToString ( CultureInfo. Invariant Culture) ) ;
}
var isCopyingTimestamps = state . CopyTimestamps | | state . TranscodingType ! = TranscodingJobType . Progressive ;
@ -2434,8 +2432,8 @@ namespace MediaBrowser.Controller.MediaEncoding
{
if ( isExynosV4L2 )
{
var widthParam = requestedWidth . Value . ToString ( _us Culture) ;
var heightParam = requestedHeight . Value . ToString ( _us Culture) ;
var widthParam = requestedWidth . Value . ToString ( CultureInfo. Invariant Culture) ;
var heightParam = requestedHeight . Value . ToString ( CultureInfo. Invariant Culture) ;
filters . Add (
string . Format (
@ -2453,8 +2451,8 @@ namespace MediaBrowser.Controller.MediaEncoding
// If Max dimensions were supplied, for width selects lowest even number between input width and width req size and selects lowest even number from in width*display aspect and requested size
else if ( requestedMaxWidth . HasValue & & requestedMaxHeight . HasValue )
{
var maxWidthParam = requestedMaxWidth . Value . ToString ( _us Culture) ;
var maxHeightParam = requestedMaxHeight . Value . ToString ( _us Culture) ;
var maxWidthParam = requestedMaxWidth . Value . ToString ( CultureInfo. Invariant Culture) ;
var maxHeightParam = requestedMaxHeight . Value . ToString ( CultureInfo. Invariant Culture) ;
if ( isExynosV4L2 )
{
@ -2486,7 +2484,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
else
{
var widthParam = requestedWidth . Value . ToString ( _us Culture) ;
var widthParam = requestedWidth . Value . ToString ( CultureInfo. Invariant Culture) ;
filters . Add (
string . Format (
@ -2499,7 +2497,7 @@ namespace MediaBrowser.Controller.MediaEncoding
// If a fixed height was requested
else if ( requestedHeight . HasValue )
{
var heightParam = requestedHeight . Value . ToString ( _us Culture) ;
var heightParam = requestedHeight . Value . ToString ( CultureInfo. Invariant Culture) ;
if ( isExynosV4L2 )
{
@ -2522,7 +2520,7 @@ namespace MediaBrowser.Controller.MediaEncoding
// If a max width was requested
else if ( requestedMaxWidth . HasValue )
{
var maxWidthParam = requestedMaxWidth . Value . ToString ( _us Culture) ;
var maxWidthParam = requestedMaxWidth . Value . ToString ( CultureInfo. Invariant Culture) ;
if ( isExynosV4L2 )
{
@ -2545,7 +2543,7 @@ namespace MediaBrowser.Controller.MediaEncoding
// If a max height was requested
else if ( requestedMaxHeight . HasValue )
{
var maxHeightParam = requestedMaxHeight . Value . ToString ( _us Culture) ;
var maxHeightParam = requestedMaxHeight . Value . ToString ( CultureInfo. Invariant Culture) ;
if ( isExynosV4L2 )
{
@ -4122,12 +4120,12 @@ namespace MediaBrowser.Controller.MediaEncoding
if ( bitrate . HasValue )
{
args + = " -ab " + bitrate . Value . ToString ( _us Culture) ;
args + = " -ab " + bitrate . Value . ToString ( CultureInfo. Invariant Culture) ;
}
if ( state . OutputAudioSampleRate . HasValue )
{
args + = " -ar " + state . OutputAudioSampleRate . Value . ToString ( _us Culture) ;
args + = " -ar " + state . OutputAudioSampleRate . Value . ToString ( CultureInfo. Invariant Culture) ;
}
args + = GetAudioFilterParam ( state , encodingOptions ) ;
@ -4143,12 +4141,12 @@ namespace MediaBrowser.Controller.MediaEncoding
if ( bitrate . HasValue )
{
audioTranscodeParams . Add ( "-ab " + bitrate . Value . ToString ( _us Culture) ) ;
audioTranscodeParams . Add ( "-ab " + bitrate . Value . ToString ( CultureInfo. Invariant Culture) ) ;
}
if ( state . OutputAudioChannels . HasValue )
{
audioTranscodeParams . Add ( "-ac " + state . OutputAudioChannels . Value . ToString ( _us Culture) ) ;
audioTranscodeParams . Add ( "-ac " + state . OutputAudioChannels . Value . ToString ( CultureInfo. Invariant Culture) ) ;
}
// opus will fail on 44100
@ -4156,7 +4154,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
if ( state . OutputAudioSampleRate . HasValue )
{
audioTranscodeParams . Add ( "-ar " + state . OutputAudioSampleRate . Value . ToString ( _us Culture) ) ;
audioTranscodeParams . Add ( "-ar " + state . OutputAudioSampleRate . Value . ToString ( CultureInfo. Invariant Culture) ) ;
}
}