Skip to content

frontend: Sanitize filenames in Advanced mode - #14046

Open
Johnsoac671 wants to merge 1 commit into
obsproject:masterfrom
WSU-CptS-481-Fall-2026:13786-advanced-mode-filename-sanitization
Open

Johnsoac671 wants to merge 1 commit into
obsproject:masterfrom
WSU-CptS-481-Fall-2026:13786-advanced-mode-filename-sanitization

Conversation

@Johnsoac671

Copy link
Copy Markdown
Contributor

Description

Modified AdvancedOutput::StartRecording() to sanitize filename formatting to match how SimpleOutput::ConfigureRecording() handles filenames.

Motivation and Context

Fixes #13786

If a filename format was set with characters not allowed in Windows filenames while running OBS on Windows, any recording with Advanced output mode enabled would fail to start, due to a failure to create the associated video file.

17:29:24.633: [mp4 output: 'adv_file_output'] Unable to open file '.../2026-10-17 17:29:24.mp4'

Simple output mode avoided this failure by sanitizing filename formats to replace disallowed characters with underscores, however this was not performed during Advanced output mode.

How Has This Been Tested?

Testing Environment: AMD Ryzen 5 9600X, AMD Radeon RX 9070 XT, Windows 11, build from master off commit f1c0a11 with this change applied.

I tested the change by starting and ending a recording, and confirming whether a video was properly output to the intended file destination under these circumstances:

  • Simple output mode: filename format with allowed character (%CCYY-%MM-%DD %hh_%mm_%ss)
  • Simple output mode: filename format with disallowed character (%CCYY-%MM-%DD %hh:%mm:%ss)
  • Advanced output mode: filename format with allowed character (%CCYY-%MM-%DD %hh_%mm_%ss)
  • Advanced output mode: filename format with disallowed character (%CCYY-%MM-%DD %hh:%mm:%ss)
  • Advanced output mode: filename format with sub-folder and allowed character (%CCYY/%MM-%DD %hh_%mm_%ss)
  • Advanced output mode: filename format with sub-folder and disallowed character (%CCYY/%MM-%DD %hh:%mm:%ss)

All functioned as expected (video recorded and saved), with disallowed characters replaced with underscores

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

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

Simple output mode replaces characters in filename formats not supported
in Windows filenames with underscores, but Advanced output mode
recordings leave them as is, causing them to fail to start on
Windows.

Apply the same sanitization on filename formats in Advanced output mode
so both modes handle characters consistently.
@WizardCM WizardCM added the kind/bug Categorizes issue or PR as related to a bug. label Oct 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filenames for recordings don't get sanitised, replay buffers do

2 participants