< Summary - Jellyfin

Information
Class: MediaBrowser.Controller.MediaEncoding.EncodingJobInfo
Assembly: MediaBrowser.Controller
File(s): /srv/git/jellyfin/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 215
Coverable lines: 215
Total lines: 750
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 208
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
get_TranscodeReasons()0%2040%
get_IgnoreInputDts()100%210%
get_IgnoreInputIndex()100%210%
get_GenPtsInput()100%210%
get_DiscardCorruptFramesInput()100%210%
get_EnableFastSeekInput()100%210%
get_GenPtsOutput()100%210%
get_StartTimeTicks()100%210%
get_CopyTimestamps()100%210%
get_IsSegmentedLiveStream()0%620%
get_TotalOutputBitrate()100%210%
get_OutputWidth()0%110100%
get_OutputHeight()0%110100%
get_OutputAudioSampleRate()0%7280%
get_OutputAudioBitDepth()0%4260%
get_TargetVideoLevel()0%7280%
get_TargetVideoBitDepth()0%4260%
get_TargetRefFrames()0%4260%
get_TargetFramerate()0%7280%
get_TargetTimestamp()0%2040%
get_TargetPacketLength()0%4260%
get_TargetVideoProfile()0%7280%
get_TargetVideoRangeType()0%110100%
get_TargetVideoCodecTag()0%4260%
get_IsTargetAnamorphic()0%4260%
get_ActualOutputVideoCodec()0%2040%
get_ActualOutputAudioCodec()0%2040%
get_IsTargetInterlaced()0%110100%
get_IsTargetAVC()0%4260%
get_TargetVideoStreamCount()0%620%
get_TargetAudioStreamCount()0%620%
get_EnableAudioVbrEncoding()100%210%
get_HlsListSize()100%210%
EnableBreakOnNonKeyFrames(...)0%4260%
GetMediaStreamCount(...)0%620%
GetMimeType(...)0%2040%
DeInterlace(...)0%110100%
GetRequestedProfiles(...)0%4260%
GetRequestedRangeTypes(...)0%4260%
GetRequestedCodecTags(...)0%4260%
GetRequestedLevel(...)0%2040%
GetRequestedMaxRefFrames(...)0%4260%
GetRequestedVideoBitDepth(...)0%4260%
GetRequestedAudioBitDepth(...)0%4260%
GetRequestedAudioChannels(...)0%110100%
ReportTranscodingProgress(...)100%210%

File(s)

/srv/git/jellyfin/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs

#LineLine coverage
 1#nullable disable
 2
 3#pragma warning disable CS1591, SA1401
 4
 5using System;
 6using System.Collections.Generic;
 7using System.Globalization;
 8using System.Linq;
 9using Jellyfin.Data.Entities;
 10using Jellyfin.Data.Enums;
 11using MediaBrowser.Model.Dlna;
 12using MediaBrowser.Model.Drawing;
 13using MediaBrowser.Model.Dto;
 14using MediaBrowser.Model.Entities;
 15using MediaBrowser.Model.MediaInfo;
 16using MediaBrowser.Model.Net;
 17using MediaBrowser.Model.Session;
 18
 19namespace MediaBrowser.Controller.MediaEncoding
 20{
 21    // For now, a common base class until the API and MediaEncoding classes are unified
 22    public class EncodingJobInfo
 23    {
 24        public int? OutputAudioBitrate;
 25        public int? OutputAudioChannels;
 26
 27        private TranscodeReason? _transcodeReasons = null;
 28
 29        public EncodingJobInfo(TranscodingJobType jobType)
 30        {
 031            TranscodingType = jobType;
 032            RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
 033            SupportedAudioCodecs = Array.Empty<string>();
 034            SupportedVideoCodecs = Array.Empty<string>();
 035            SupportedSubtitleCodecs = Array.Empty<string>();
 036        }
 37
 38        public TranscodeReason TranscodeReasons
 39        {
 40            get
 41            {
 042                if (!_transcodeReasons.HasValue)
 43                {
 044                    if (BaseRequest.TranscodeReasons is null)
 45                    {
 046                        _transcodeReasons = 0;
 047                        return 0;
 48                    }
 49
 050                    _ = Enum.TryParse<TranscodeReason>(BaseRequest.TranscodeReasons, out var reason);
 051                    _transcodeReasons = reason;
 52                }
 53
 054                return _transcodeReasons.Value;
 55            }
 56        }
 57
 58        public IProgress<double> Progress { get; set; }
 59
 60        public MediaStream VideoStream { get; set; }
 61
 62        public VideoType VideoType { get; set; }
 63
 64        public Dictionary<string, string> RemoteHttpHeaders { get; set; }
 65
 66        public string OutputVideoCodec { get; set; }
 67
 68        public MediaProtocol InputProtocol { get; set; }
 69
 70        public string MediaPath { get; set; }
 71
 72        public bool IsInputVideo { get; set; }
 73
 74        public string OutputAudioCodec { get; set; }
 75
 76        public int? OutputVideoBitrate { get; set; }
 77
 78        public MediaStream SubtitleStream { get; set; }
 79
 80        public SubtitleDeliveryMethod SubtitleDeliveryMethod { get; set; }
 81
 82        public string[] SupportedSubtitleCodecs { get; set; }
 83
 84        public int InternalSubtitleStreamOffset { get; set; }
 85
 86        public MediaSourceInfo MediaSource { get; set; }
 87
 88        public User User { get; set; }
 89
 90        public long? RunTimeTicks { get; set; }
 91
 92        public bool ReadInputAtNativeFramerate { get; set; }
 93
 94        public string OutputFilePath { get; set; }
 95
 96        public string MimeType { get; set; }
 97
 098        public bool IgnoreInputDts => MediaSource.IgnoreDts;
 99
 0100        public bool IgnoreInputIndex => MediaSource.IgnoreIndex;
 101
 0102        public bool GenPtsInput => MediaSource.GenPtsInput;
 103
 0104        public bool DiscardCorruptFramesInput => false;
 105
 0106        public bool EnableFastSeekInput => false;
 107
 0108        public bool GenPtsOutput => false;
 109
 110        public string OutputContainer { get; set; }
 111
 112        public string OutputVideoSync { get; set; }
 113
 114        public string AlbumCoverPath { get; set; }
 115
 116        public string InputAudioSync { get; set; }
 117
 118        public string InputVideoSync { get; set; }
 119
 120        public TransportStreamTimestamp InputTimestamp { get; set; }
 121
 122        public MediaStream AudioStream { get; set; }
 123
 124        public string[] SupportedAudioCodecs { get; set; }
 125
 126        public string[] SupportedVideoCodecs { get; set; }
 127
 128        public string InputContainer { get; set; }
 129
 130        public IsoType? IsoType { get; set; }
 131
 132        public BaseEncodingJobOptions BaseRequest { get; set; }
 133
 134        public bool IsVideoRequest { get; set; }
 135
 136        public TranscodingJobType TranscodingType { get; set; }
 137
 0138        public long? StartTimeTicks => BaseRequest.StartTimeTicks;
 139
 0140        public bool CopyTimestamps => BaseRequest.CopyTimestamps;
 141
 142        public bool IsSegmentedLiveStream
 0143            => TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue;
 144
 0145        public int? TotalOutputBitrate => (OutputAudioBitrate ?? 0) + (OutputVideoBitrate ?? 0);
 146
 147        public int? OutputWidth
 148        {
 149            get
 150            {
 0151                if (VideoStream is not null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
 152                {
 0153                    var size = new ImageDimensions(VideoStream.Width.Value, VideoStream.Height.Value);
 154
 0155                    var newSize = DrawingUtils.Resize(
 0156                        size,
 0157                        BaseRequest.Width ?? 0,
 0158                        BaseRequest.Height ?? 0,
 0159                        BaseRequest.MaxWidth ?? 0,
 0160                        BaseRequest.MaxHeight ?? 0);
 161
 0162                    return newSize.Width;
 163                }
 164
 0165                if (!IsVideoRequest)
 166                {
 0167                    return null;
 168                }
 169
 0170                return BaseRequest.MaxWidth ?? BaseRequest.Width;
 171            }
 172        }
 173
 174        public int? OutputHeight
 175        {
 176            get
 177            {
 0178                if (VideoStream is not null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
 179                {
 0180                    var size = new ImageDimensions(VideoStream.Width.Value, VideoStream.Height.Value);
 181
 0182                    var newSize = DrawingUtils.Resize(
 0183                        size,
 0184                        BaseRequest.Width ?? 0,
 0185                        BaseRequest.Height ?? 0,
 0186                        BaseRequest.MaxWidth ?? 0,
 0187                        BaseRequest.MaxHeight ?? 0);
 188
 0189                    return newSize.Height;
 190                }
 191
 0192                if (!IsVideoRequest)
 193                {
 0194                    return null;
 195                }
 196
 0197                return BaseRequest.MaxHeight ?? BaseRequest.Height;
 198            }
 199        }
 200
 201        public int? OutputAudioSampleRate
 202        {
 203            get
 204            {
 0205                if (BaseRequest.Static
 0206                    || EncodingHelper.IsCopyCodec(OutputAudioCodec))
 207                {
 0208                    if (AudioStream is not null)
 209                    {
 0210                        return AudioStream.SampleRate;
 211                    }
 212                }
 0213                else if (BaseRequest.AudioSampleRate.HasValue)
 214                {
 215                    // Don't exceed what the encoder supports
 216                    // Seeing issues of attempting to encode to 88200
 0217                    return BaseRequest.AudioSampleRate.Value;
 218                }
 219
 0220                return null;
 221            }
 222        }
 223
 224        public int? OutputAudioBitDepth
 225        {
 226            get
 227            {
 0228                if (BaseRequest.Static
 0229                    || EncodingHelper.IsCopyCodec(OutputAudioCodec))
 230                {
 0231                    if (AudioStream is not null)
 232                    {
 0233                        return AudioStream.BitDepth;
 234                    }
 235                }
 236
 0237                return null;
 238            }
 239        }
 240
 241        /// <summary>
 242        /// Gets the target video level.
 243        /// </summary>
 244        public double? TargetVideoLevel
 245        {
 246            get
 247            {
 0248                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 249                {
 0250                    return VideoStream?.Level;
 251                }
 252
 0253                var level = GetRequestedLevel(ActualOutputVideoCodec);
 0254                if (double.TryParse(level, CultureInfo.InvariantCulture, out var result))
 255                {
 0256                    return result;
 257                }
 258
 0259                return null;
 260            }
 261        }
 262
 263        /// <summary>
 264        /// Gets the target video bit depth.
 265        /// </summary>
 266        public int? TargetVideoBitDepth
 267        {
 268            get
 269            {
 0270                if (BaseRequest.Static
 0271                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 272                {
 0273                    return VideoStream?.BitDepth;
 274                }
 275
 0276                return null;
 277            }
 278        }
 279
 280        /// <summary>
 281        /// Gets the target reference frames.
 282        /// </summary>
 283        /// <value>The target reference frames.</value>
 284        public int? TargetRefFrames
 285        {
 286            get
 287            {
 0288                if (BaseRequest.Static
 0289                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 290                {
 0291                    return VideoStream?.RefFrames;
 292                }
 293
 0294                return null;
 295            }
 296        }
 297
 298        /// <summary>
 299        /// Gets the target framerate.
 300        /// </summary>
 301        public float? TargetFramerate
 302        {
 303            get
 304            {
 0305                if (BaseRequest.Static
 0306                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 307                {
 0308                    return VideoStream?.ReferenceFrameRate;
 309                }
 310
 0311                return BaseRequest.MaxFramerate ?? BaseRequest.Framerate;
 312            }
 313        }
 314
 315        public TransportStreamTimestamp TargetTimestamp
 316        {
 317            get
 318            {
 0319                if (BaseRequest.Static)
 320                {
 0321                    return InputTimestamp;
 322                }
 323
 0324                return string.Equals(OutputContainer, "m2ts", StringComparison.OrdinalIgnoreCase) ?
 0325                    TransportStreamTimestamp.Valid :
 0326                    TransportStreamTimestamp.None;
 327            }
 328        }
 329
 330        /// <summary>
 331        /// Gets the target packet length.
 332        /// </summary>
 333        public int? TargetPacketLength
 334        {
 335            get
 336            {
 0337                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 338                {
 0339                    return VideoStream?.PacketLength;
 340                }
 341
 0342                return null;
 343            }
 344        }
 345
 346        /// <summary>
 347        /// Gets the target video profile.
 348        /// </summary>
 349        public string TargetVideoProfile
 350        {
 351            get
 352            {
 0353                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 354                {
 0355                    return VideoStream?.Profile;
 356                }
 357
 0358                var requestedProfile = GetRequestedProfiles(ActualOutputVideoCodec).FirstOrDefault();
 0359                if (!string.IsNullOrEmpty(requestedProfile))
 360                {
 0361                    return requestedProfile;
 362                }
 363
 0364                return null;
 365            }
 366        }
 367
 368        /// <summary>
 369        /// Gets the target video range type.
 370        /// </summary>
 371        public VideoRangeType TargetVideoRangeType
 372        {
 373            get
 374            {
 0375                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 376                {
 0377                    return VideoStream?.VideoRangeType ?? VideoRangeType.Unknown;
 378                }
 379
 0380                if (Enum.TryParse(GetRequestedRangeTypes(ActualOutputVideoCodec).FirstOrDefault() ?? "Unknown", true, ou
 381                {
 0382                    return requestedRangeType;
 383                }
 384
 0385                return VideoRangeType.Unknown;
 386            }
 387        }
 388
 389        public string TargetVideoCodecTag
 390        {
 391            get
 392            {
 0393                if (BaseRequest.Static
 0394                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 395                {
 0396                    return VideoStream?.CodecTag;
 397                }
 398
 0399                return null;
 400            }
 401        }
 402
 403        public bool? IsTargetAnamorphic
 404        {
 405            get
 406            {
 0407                if (BaseRequest.Static
 0408                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 409                {
 0410                    return VideoStream?.IsAnamorphic;
 411                }
 412
 0413                return false;
 414            }
 415        }
 416
 417        public string ActualOutputVideoCodec
 418        {
 419            get
 420            {
 0421                if (VideoStream is null)
 422                {
 0423                    return null;
 424                }
 425
 0426                if (EncodingHelper.IsCopyCodec(OutputVideoCodec))
 427                {
 0428                    return VideoStream.Codec;
 429                }
 430
 0431                return OutputVideoCodec;
 432            }
 433        }
 434
 435        public string ActualOutputAudioCodec
 436        {
 437            get
 438            {
 0439                if (AudioStream is null)
 440                {
 0441                    return null;
 442                }
 443
 0444                if (EncodingHelper.IsCopyCodec(OutputAudioCodec))
 445                {
 0446                    return AudioStream.Codec;
 447                }
 448
 0449                return OutputAudioCodec;
 450            }
 451        }
 452
 453        public bool? IsTargetInterlaced
 454        {
 455            get
 456            {
 0457                if (BaseRequest.Static
 0458                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 459                {
 0460                    return VideoStream?.IsInterlaced;
 461                }
 462
 0463                if (DeInterlace(ActualOutputVideoCodec, true))
 464                {
 0465                    return false;
 466                }
 467
 0468                return VideoStream?.IsInterlaced;
 469            }
 470        }
 471
 472        public bool? IsTargetAVC
 473        {
 474            get
 475            {
 0476                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 477                {
 0478                    return VideoStream?.IsAVC;
 479                }
 480
 0481                return false;
 482            }
 483        }
 484
 485        public int? TargetVideoStreamCount
 486        {
 487            get
 488            {
 0489                if (BaseRequest.Static)
 490                {
 0491                    return GetMediaStreamCount(MediaStreamType.Video, int.MaxValue);
 492                }
 493
 0494                return GetMediaStreamCount(MediaStreamType.Video, 1);
 495            }
 496        }
 497
 498        public int? TargetAudioStreamCount
 499        {
 500            get
 501            {
 0502                if (BaseRequest.Static)
 503                {
 0504                    return GetMediaStreamCount(MediaStreamType.Audio, int.MaxValue);
 505                }
 506
 0507                return GetMediaStreamCount(MediaStreamType.Audio, 1);
 508            }
 509        }
 510
 0511        public bool EnableAudioVbrEncoding => BaseRequest.EnableAudioVbrEncoding;
 512
 0513        public int HlsListSize => 0;
 514
 515        public bool EnableBreakOnNonKeyFrames(string videoCodec)
 516        {
 0517            if (TranscodingType != TranscodingJobType.Progressive)
 518            {
 0519                if (IsSegmentedLiveStream)
 520                {
 0521                    return false;
 522                }
 523
 0524                return BaseRequest.BreakOnNonKeyFrames && EncodingHelper.IsCopyCodec(videoCodec);
 525            }
 526
 0527            return false;
 528        }
 529
 530        private int? GetMediaStreamCount(MediaStreamType type, int limit)
 531        {
 0532            var count = MediaSource.GetStreamCount(type);
 533
 0534            if (count.HasValue)
 535            {
 0536                count = Math.Min(count.Value, limit);
 537            }
 538
 0539            return count;
 540        }
 541
 542        public string GetMimeType(string outputPath, bool enableStreamDefault = true)
 543        {
 0544            if (!string.IsNullOrEmpty(MimeType))
 545            {
 0546                return MimeType;
 547            }
 548
 0549            if (enableStreamDefault)
 550            {
 0551                return MimeTypes.GetMimeType(outputPath);
 552            }
 553
 0554            return MimeTypes.GetMimeType(outputPath, null);
 555        }
 556
 557        public bool DeInterlace(string videoCodec, bool forceDeinterlaceIfSourceIsInterlaced)
 558        {
 0559            var videoStream = VideoStream;
 0560            var isInputInterlaced = videoStream is not null && videoStream.IsInterlaced;
 561
 0562            if (!isInputInterlaced)
 563            {
 0564                return false;
 565            }
 566
 567            // Support general param
 0568            if (BaseRequest.DeInterlace)
 569            {
 0570                return true;
 571            }
 572
 0573            if (!string.IsNullOrEmpty(videoCodec))
 574            {
 0575                if (string.Equals(BaseRequest.GetOption(videoCodec, "deinterlace"), "true", StringComparison.OrdinalIgno
 576                {
 0577                    return true;
 578                }
 579            }
 580
 0581            return forceDeinterlaceIfSourceIsInterlaced;
 582        }
 583
 584        public string[] GetRequestedProfiles(string codec)
 585        {
 0586            if (!string.IsNullOrEmpty(BaseRequest.Profile))
 587            {
 0588                return BaseRequest.Profile.Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries);
 589            }
 590
 0591            if (!string.IsNullOrEmpty(codec))
 592            {
 0593                var profile = BaseRequest.GetOption(codec, "profile");
 594
 0595                if (!string.IsNullOrEmpty(profile))
 596                {
 0597                    return profile.Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries);
 598                }
 599            }
 600
 0601            return Array.Empty<string>();
 602        }
 603
 604        public string[] GetRequestedRangeTypes(string codec)
 605        {
 0606            if (!string.IsNullOrEmpty(BaseRequest.VideoRangeType))
 607            {
 0608                return BaseRequest.VideoRangeType.Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries);
 609            }
 610
 0611            if (!string.IsNullOrEmpty(codec))
 612            {
 0613                var rangetype = BaseRequest.GetOption(codec, "rangetype");
 614
 0615                if (!string.IsNullOrEmpty(rangetype))
 616                {
 0617                    return rangetype.Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries);
 618                }
 619            }
 620
 0621            return Array.Empty<string>();
 622        }
 623
 624        public string[] GetRequestedCodecTags(string codec)
 625        {
 0626            if (!string.IsNullOrEmpty(BaseRequest.CodecTag))
 627            {
 0628                return BaseRequest.CodecTag.Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries);
 629            }
 630
 0631            if (!string.IsNullOrEmpty(codec))
 632            {
 0633                var codectag = BaseRequest.GetOption(codec, "codectag");
 634
 0635                if (!string.IsNullOrEmpty(codectag))
 636                {
 0637                    return codectag.Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries);
 638                }
 639            }
 640
 0641            return Array.Empty<string>();
 642        }
 643
 644        public string GetRequestedLevel(string codec)
 645        {
 0646            if (!string.IsNullOrEmpty(BaseRequest.Level))
 647            {
 0648                return BaseRequest.Level;
 649            }
 650
 0651            if (!string.IsNullOrEmpty(codec))
 652            {
 0653                return BaseRequest.GetOption(codec, "level");
 654            }
 655
 0656            return null;
 657        }
 658
 659        public int? GetRequestedMaxRefFrames(string codec)
 660        {
 0661            if (BaseRequest.MaxRefFrames.HasValue)
 662            {
 0663                return BaseRequest.MaxRefFrames;
 664            }
 665
 0666            if (!string.IsNullOrEmpty(codec))
 667            {
 0668                var value = BaseRequest.GetOption(codec, "maxrefframes");
 0669                if (int.TryParse(value, CultureInfo.InvariantCulture, out var result))
 670                {
 0671                    return result;
 672                }
 673            }
 674
 0675            return null;
 676        }
 677
 678        public int? GetRequestedVideoBitDepth(string codec)
 679        {
 0680            if (BaseRequest.MaxVideoBitDepth.HasValue)
 681            {
 0682                return BaseRequest.MaxVideoBitDepth;
 683            }
 684
 0685            if (!string.IsNullOrEmpty(codec))
 686            {
 0687                var value = BaseRequest.GetOption(codec, "videobitdepth");
 0688                if (int.TryParse(value, CultureInfo.InvariantCulture, out var result))
 689                {
 0690                    return result;
 691                }
 692            }
 693
 0694            return null;
 695        }
 696
 697        public int? GetRequestedAudioBitDepth(string codec)
 698        {
 0699            if (BaseRequest.MaxAudioBitDepth.HasValue)
 700            {
 0701                return BaseRequest.MaxAudioBitDepth;
 702            }
 703
 0704            if (!string.IsNullOrEmpty(codec))
 705            {
 0706                var value = BaseRequest.GetOption(codec, "audiobitdepth");
 0707                if (int.TryParse(value, CultureInfo.InvariantCulture, out var result))
 708                {
 0709                    return result;
 710                }
 711            }
 712
 0713            return null;
 714        }
 715
 716        public int? GetRequestedAudioChannels(string codec)
 717        {
 0718            if (!string.IsNullOrEmpty(codec))
 719            {
 0720                var value = BaseRequest.GetOption(codec, "audiochannels");
 0721                if (int.TryParse(value, CultureInfo.InvariantCulture, out var result))
 722                {
 0723                    return result;
 724                }
 725            }
 726
 0727            if (BaseRequest.MaxAudioChannels.HasValue)
 728            {
 0729                return BaseRequest.MaxAudioChannels;
 730            }
 731
 0732            if (BaseRequest.AudioChannels.HasValue)
 733            {
 0734                return BaseRequest.AudioChannels;
 735            }
 736
 0737            if (BaseRequest.TranscodingMaxAudioChannels.HasValue)
 738            {
 0739                return BaseRequest.TranscodingMaxAudioChannels;
 740            }
 741
 0742            return null;
 743        }
 744
 745        public virtual void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentCo
 746        {
 0747            Progress.Report(percentComplete.Value);
 0748        }
 749    }
 750}

Methods/Properties

.ctor(MediaBrowser.Controller.MediaEncoding.TranscodingJobType)
get_TranscodeReasons()
get_IgnoreInputDts()
get_IgnoreInputIndex()
get_GenPtsInput()
get_DiscardCorruptFramesInput()
get_EnableFastSeekInput()
get_GenPtsOutput()
get_StartTimeTicks()
get_CopyTimestamps()
get_IsSegmentedLiveStream()
get_TotalOutputBitrate()
get_OutputWidth()
get_OutputHeight()
get_OutputAudioSampleRate()
get_OutputAudioBitDepth()
get_TargetVideoLevel()
get_TargetVideoBitDepth()
get_TargetRefFrames()
get_TargetFramerate()
get_TargetTimestamp()
get_TargetPacketLength()
get_TargetVideoProfile()
get_TargetVideoRangeType()
get_TargetVideoCodecTag()
get_IsTargetAnamorphic()
get_ActualOutputVideoCodec()
get_ActualOutputAudioCodec()
get_IsTargetInterlaced()
get_IsTargetAVC()
get_TargetVideoStreamCount()
get_TargetAudioStreamCount()
get_EnableAudioVbrEncoding()
get_HlsListSize()
EnableBreakOnNonKeyFrames(System.String)
GetMediaStreamCount(MediaBrowser.Model.Entities.MediaStreamType,System.Int32)
GetMimeType(System.String,System.Boolean)
DeInterlace(System.String,System.Boolean)
GetRequestedProfiles(System.String)
GetRequestedRangeTypes(System.String)
GetRequestedCodecTags(System.String)
GetRequestedLevel(System.String)
GetRequestedMaxRefFrames(System.String)
GetRequestedVideoBitDepth(System.String)
GetRequestedAudioBitDepth(System.String)
GetRequestedAudioChannels(System.String)
ReportTranscodingProgress(System.Nullable`1<System.TimeSpan>,System.Nullable`1<System.Single>,System.Nullable`1<System.Double>,System.Nullable`1<System.Int64>,System.Nullable`1<System.Int32>)