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

encoder/ffmpeg: Add split framerate with integer fractions #921

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

Xaymar
Copy link
Contributor

@Xaymar Xaymar commented Sep 14, 2022

Explain the Pull Request

It seems to be possible to encode with a different framerate than what libOBS is configured for. While technically any framerate appears to be possible, it is currently limited to integer fractions only in order to make the implementation much easier. Integer fractions only require skipping N frames and multiplying the denominator by N, where N is the configured integer. For sanity reasons, the limit of N is currently 10.

This allows power users to split their streaming and recording framerates with relative ease, and opt for things such as:

  • 30 FPS (1/4) streaming with 120 FPS (1/1) recording.
  • 30 FPS (1/10) streaming with 300 FPS (1/1) recording.
  • 30 FPS (1/10) streaming with 100 FPS (1/3) recording.
  • and so on.

While some of these combinations are just stupid, they are now available to power users.

Completion Checklist

  • I have added myself to the Copyright and License headers and files.
  • I will maintain this code in the future and have added myself to CODEOWNERS.
  • I have tested this change on the following platforms:
    • MacOS 10.15
    • MacOS 11
    • MacOS 12
    • Ubuntu 20.04
    • Ubuntu 22.04
    • Windows 10
    • Windows 11

@Xaymar Xaymar linked an issue Sep 14, 2022 that may be closed by this pull request
@Xaymar Xaymar force-pushed the feature/846-framerate-adjustment-for-encoders branch 3 times, most recently from ad10fe1 to e2a9782 Compare September 14, 2022 21:26
It seems to be possible to encode with a different framerate than what libOBS is configured for. While technically any framerate appears to be possible, it is currently limited to integer fractions only in order to make the implementation much easier. Integer fractions only require skipping N frames and multiplying the denominator by N, where N is the configured integer. For sanity reasons, the limit of N is currently 10.

This allows power users to split their streaming and recording framerates with relative ease, and opt for things such as:
- 30 FPS (1/4) streaming with 120 FPS (1/1) recording.
- 30 FPS (1/10) streaming with 300 FPS (1/1) recording.
- 30 FPS (1/10) streaming with 100 FPS (1/3) recording.
- and so on.
While some of these combinations are just stupid, they are now available to power users.
@Xaymar Xaymar force-pushed the feature/846-framerate-adjustment-for-encoders branch from e2a9782 to 3783d06 Compare September 14, 2022 21:42
@Xaymar Xaymar merged commit 5938ec8 into master Sep 14, 2022
@Xaymar Xaymar deleted the feature/846-framerate-adjustment-for-encoders branch September 14, 2022 22:15
@Xaymar Xaymar added this to the FFmpeg Encoders (Component) milestone Dec 11, 2023
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.

Framerate adjustment for Encoders
1 participant