diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-20 00:23:33 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-20 00:23:33 -0500 |
| commit | 27c4c30082d8b8d122041f1c6080148bd4c92382 (patch) | |
| tree | 01c2261c02e93c8985461841be751ba2f9cb0323 /MediaBrowser.MediaEncoding | |
| parent | d588ed705ff2141dfe96d2c8c66f919b11c20eac (diff) | |
update media info bitrate
Diffstat (limited to 'MediaBrowser.MediaEncoding')
| -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 de055146a8..c16d3afbda 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; |
