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

obs-outputs: Attempt to generate path if one is not specified #11517

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

Conversation

tt2468
Copy link
Member

@tt2468 tt2468 commented Nov 13, 2024

Description

Changes the MP4 muxer to attempt to use the path generation logic if a path is not explicitly specified. This allows MP4 muxer outputs to be configured with file splitting, without requiring both the path and directory+format fields to be specified.

Motivation and Context

Currently, the UI generates the initial recording path, then lets the output do it upon file splits. While this is great, it's not very friendly to usage of the output outside of the UI (saving effort on the side of developers of custom plugins).

How Has This Been Tested?

Used a script to create a custom mp4_output output in OBS, and configured it with just directory, format, and extension fields, no path field. Output started correctly as expected, generating a path for the recording.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

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.

Changes the MP4 muxer to attempt to use the path generation logic if
a path is not explicitly specified. This allows MP4 muxer outputs to
be configured with file splitting, without requiring both the `path`
and `directory`+`format` fields to be specified (saving effort on
the side of developers of custom plugins).
@tt2468 tt2468 added the Enhancement Improvement to existing functionality label Nov 13, 2024
@tt2468 tt2468 requested a review from derrod November 13, 2024 10:10
Comment on lines +263 to +264
const char *path = obs_data_get_string(settings, "path");
if (path && *path) {
Copy link
Member

Choose a reason for hiding this comment

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

I suppose this could be replaced with if (obs_data_has_user_value(settings, "path")) { but it's probably fine either way.

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

Successfully merging this pull request may close these issues.

2 participants