Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding: Fix low bitrate check #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Penwy
Copy link
Contributor

@Penwy Penwy commented Apr 30, 2024

Description

This fixes the "Low Stream Bitrate" check to work with the new encoder names, and reworks it to work with all of obs' default encoders, and be less disruptible.

Motivation and Context

The "Low Stream Bitrate" check is currently nonfunctional, due to the encoders rename in OBS 28.

How Has This Been Tested?

This was tested by manually feeding the lines to the function and checking it gets the right values.
It was tested with

  • x264
  • "new" nvenc and ffmpeg nvenc
  • qsv11
  • texture amf and fallback amf

Types of changes

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@Penwy Penwy force-pushed the fix-low-bitrate branch from d8d4ebc to 8ef3ffb Compare May 8, 2024 16:12
@Penwy Penwy mentioned this pull request May 8, 2024
6 tasks
@RytoEX
Copy link
Member

RytoEX commented Nov 21, 2024

Do you have logs to test this against?

@Penwy
Copy link
Contributor Author

Penwy commented Nov 21, 2024

here's for :

Those are the encoders I have easy access to right now, if you want more I can find, but it'll take a bit more time.
(took the time to fix a few oversights I found while testing those).

Copy link
Member

@Fenrirthviti Fenrirthviti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look fine to me conceptually. No reason to have a specific check per-encoder for this. The intent might have been at some point to expand this check to do other things, but we're probably well past that.

@RytoEX
Copy link
Member

RytoEX commented Dec 10, 2024

here's for :

* [x264](https://obsproject.com/logs/0OIN1QXHbhM2iDxx)

* [obs-nvenc](https://obsproject.com/logs/efolcmOvAbVAV0c5)

* [fallback qsv](https://obsproject.com/logs/nOhEeUqhsjOAjGZx)

* [new obs-nvenc (31.x)](https://obsproject.com/logs/49Esc0sWSG5FMgyb)

The fallback qsv log causes an error with this PR:

Traceback (most recent call last):
  File "C:\dev\obsproject\loganalyzer\loganalyzer.py", line 220, in <module>
    main()
  File "C:\dev\obsproject\loganalyzer\loganalyzer.py", line 214, in main
    msgs = doAnalysis(url=flags.url, filename=flags.file)
  File "C:\dev\obsproject\loganalyzer\loganalyzer.py", line 166, in doAnalysis
    checkStreamSettings(logLines),
  File "C:\dev\obsproject\loganalyzer\checks\encoding.py", line 67, in checkStreamSettings
    match = params_re.search(lines[line])
IndexError: list index out of range

@Penwy
Copy link
Contributor Author

Penwy commented Dec 10, 2024

fixed the regex, and added a try except so that, if another unforeseen issue happens with the regexp it fails the check gracefully instead of stopping the whole analysis.

@@ -3,6 +3,9 @@
import re


params_re = re.compile(r"\t(?P<key>\w+):?\s*(?P<value>\S+)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any known case where the colon is missing/optional? :?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, none that I can see, was an attempt to possibly catch future changes in formatting, but I agree it's probably a bit too greedy.
would you rather I remove the ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can make it non-optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants