Skip to content

Commit

Permalink
network: Check max recommended bitrate from service
Browse files Browse the repository at this point in the history
This adds a warning if the maximum recommended video bitrate from the selected service has been exceeded.
  • Loading branch information
prgmitchell committed Jun 24, 2024
1 parent 077c1a4 commit 75740d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions checks/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,19 @@ def checkStreamDelay(lines):
if (len(delayLines) > 0):
return [LEVEL_INFO, "Stream Delay", "Stream Delay may currently be active. This means that your stream is being delayed by a certain number of seconds. If this is not what you intended, please disable it in Settings -> Advanced -> Stream Delay."]
return None


def checkServiceRecommendations(lines):
for i, line in enumerate(lines):
if "User is ignoring service bitrate limits. Max Video Bitrate:" in line:
maxVideoBitrateMatch = re.search(r'Max Video Bitrate: (\d+|None)', line)
if not maxVideoBitrateMatch or maxVideoBitrateMatch.group(1) == 'None':
continue
maxVideoBitrate = int(maxVideoBitrateMatch.group(1))
for j in range(i + 1, len(lines)):
if "bitrate:" in lines[j]:
currentBitrate = int(re.search(r'bitrate:\s+(\d+)', lines[j]).group(1))
if currentBitrate > maxVideoBitrate:
return [LEVEL_WARNING, "Max Video Bitrate Limit Exceeded", "Current bitrate " + str(currentBitrate) + "kbps exceeds max video bitrate limit " + str(maxVideoBitrate) + "kbps. This may result in the streaming service not displaying the video from your stream or rejecting it entirely."]
break
return None
3 changes: 2 additions & 1 deletion loganalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ def doAnalysis(url=None, filename=None):
checkPortableMode(logLines),
checkSafeMode(logLines),
checkSnapPackage(logLines),
checkMacPermissions(logLines)
checkMacPermissions(logLines),
checkServiceRecommendations(logLines)
])
messages.extend(checkVideoSettings(logLines))
m = parseScenes(logLines)
Expand Down

0 comments on commit 75740d9

Please sign in to comment.