diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-21 15:24:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-21 15:24:41 -0500 |
| commit | 9782f5665ca3d65a8c35aff911cedd49fa38709c (patch) | |
| tree | 6fc62453e0470c770c78a5e2679848eba6aa4378 /MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | |
| parent | f54ed748376184b3d5f4100ad8c64cef732c226a (diff) | |
| parent | ef671725559ef394337343af510ecb557b700d17 (diff) | |
Merge pull request #2362 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs')
| -rw-r--r-- | MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index de055146a..c16d3afbd 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -180,6 +180,17 @@ namespace MediaBrowser.MediaEncoding.Probing { info.Video3DFormat = Video3DFormat.FullSideBySide; } + + var videoStreamsBitrate = info.MediaStreams.Where(i => i.Type == MediaStreamType.Video).Select(i => i.BitRate ?? 0).Sum(); + // If ffprobe reported the container bitrate as being the same as the video stream bitrate, then it's wrong + if (videoStreamsBitrate == (info.Bitrate ?? 0)) + { + var streamBitrates = info.MediaStreams.Where(i => !i.IsExternal).Select(i => i.BitRate ?? 0).Sum(); + if (streamBitrates > (info.Bitrate ?? 0)) + { + info.Bitrate = streamBitrates; + } + } } return info; |
