Skip to content

obs-ffmpeg: Refactor muxer file path code #8795

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

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

Conversation

tt2468
Copy link
Member

@tt2468 tt2468 commented Apr 23, 2023

Description

Refactors parts of the mux outputs which deal with file paths.

General idea:

  • Allows the path settings field to be unset, provided the appropriate directory, format, and extension fields have been set
    • If path is not set, it will generate its own initial file name
  • Moves general path storage to stream->path
  • Gets rid of a lot of unnecessary passing around of path strings between functions
  • Adds a last_file field to the file_changed output signal for future usage by the UI for auto-remux and other features when file splitting is enabled

Motivation and Context

This allows us to optionally move path generation to the output, away from the UI. This has benefits, notable for code deduplication and also for synchronizing behavior. It is also required for other features like inserting the part number into a file name for file splitting.

How Has This Been Tested?

Unfortunately, this does touch a lot of code paths with little immediate user-facing benefits. I've done the best I can do testing this and I am not seeing any changed behavior, crashes, or memory leaks- so that's good I guess.

  • Tested normal recording
  • Split file recording
  • HLS streaming
  • Replay buffer start/stop/save
  • Other things like closing OBS while recording is running

Types of changes

  • Tweak (non-breaking change to improve existing functionality)
  • Code cleanup (non-breaking change which makes code smaller or more readable)

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.

@tt2468 tt2468 added Enhancement Improvement to existing functionality Code Cleanup Non-breaking change which makes code smaller or more readable Seeking Testers Build artifacts on CI labels Apr 23, 2023
@tt2468 tt2468 force-pushed the enhancement/ffmpeg-output-path-refactor branch from cd11ea0 to 7178b73 Compare April 24, 2023 04:40
@tt2468 tt2468 force-pushed the enhancement/ffmpeg-output-path-refactor branch from 7178b73 to 9455c51 Compare May 21, 2023 00:20
@tt2468 tt2468 force-pushed the enhancement/ffmpeg-output-path-refactor branch from 9455c51 to 3ee0bd8 Compare May 5, 2024 03:06
Refactors parts of the mux outputs which deal with file paths. This
allows us to optionally move path generation to the output, away from
the UI. This has benefits, notable for code deduplication and also for
synchronizing behavior. It is also required for other features like
inserting the part number into a file name for file splitting.

General idea:
- Allows the `path` settings field to be unset, provided the
appropriate `directory`, `format`, and `extension` fields have been set
  - If `path` is not set, it will generate its own initial file name
- Moves general path storage to `stream->path`
- Gets rid of a lot of unnecessary passing around of path strings
between functions
- Adds a `last_file` field to the `file_changed` output signal for
future usage by the UI for auto-remux and other features when file
splitting is enabled
@tt2468 tt2468 force-pushed the enhancement/ffmpeg-output-path-refactor branch from 3ee0bd8 to ac77c10 Compare May 5, 2024 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Non-breaking change which makes code smaller or more readable Enhancement Improvement to existing functionality Seeking Testers Build artifacts on CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants