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

Recording does not check whether the target path exists already #10750

Open
zenorbi opened this issue May 29, 2024 · 5 comments
Open

Recording does not check whether the target path exists already #10750

zenorbi opened this issue May 29, 2024 · 5 comments

Comments

@zenorbi
Copy link

zenorbi commented May 29, 2024

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

Other

OBS Studio Version (Other)

29.1.3

OBS Studio Log URL

The 2 logs are provided in the description

OBS Studio Crash Log URL

No response

Expected Behavior

Have 1 file per recording (so 2 files, one of them with some suffix number)

Current Behavior

Only 1 file is produced in total that has inter-mangled data.

Steps to Reproduce

  1. Start 2 OBS instances
  2. Have 2 different video content for the 2 OBS instances
  3. Click the Start Recording button in the same second so that the resulting file would have the same exact name

Anything else we should know?

OBS 1:

15:41:54.213: ==== Recording Start ===============================================
15:41:54.213: [ffmpeg muxer: 'adv_file_output'] Writing file 'C:/Users/Specto/Videos/2024-05-29 15-41-54.mkv'...
16:42:08.155: [ffmpeg muxer: 'adv_file_output'] Output of file 'C:/Users/Specto/Videos/2024-05-29 15-41-54.mkv' stopped
16:42:08.155: Output 'adv_file_output': stopping
16:42:08.155: Output 'adv_file_output': Total frames output: 216774
16:42:08.155: Output 'adv_file_output': Total drawn frames: 216835 (216836 attempted)
16:42:08.155: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 1 (0.0%)
16:42:08.156: Video stopped, number of skipped frames due to encoding lag: 1/216834 (0.0%)
16:42:08.157: ==== Recording Stop 

OBS 2:

15:41:54.853: ==== Recording Start ===============================================
15:41:54.853: [ffmpeg muxer: 'adv_file_output'] Writing file 'C:/Users/Specto/Videos/2024-05-29 15-41-54.mkv'...
15:42:23.743: User switched to scene 'Zoom Only'
15:42:32.772: User switched to scene 'Presentation Only'
16:05:43.747: User switched to scene 'Zoom Only'
16:10:03.685: User switched to scene 'Picture in Picture'
16:14:39.364: User switched to scene 'Presentation Only'
16:42:08.954: [ffmpeg muxer: 'adv_file_output'] Output of file 'C:/Users/Specto/Videos/2024-05-29 15-41-54.mkv' stopped
16:42:08.954: Output 'adv_file_output': stopping
16:42:08.954: Output 'adv_file_output': Total frames output: 216785
16:42:08.954: Output 'adv_file_output': Total drawn frames: 216846
16:42:08.954: ==== Recording Stop 

2024-05-29 15-07-36.txt
2024-05-29 15-07-42.txt

@RytoEX
Copy link
Member

RytoEX commented May 29, 2024

We do not accept bug reports for older versions of OBS Studio. Please test and provide logs for OBS Studio 30.1.2 or newer.

@zenorbi
Copy link
Author

zenorbi commented May 29, 2024

I have retested with OBS 30.1.2, the issue remains, here are the new logs:

https://obsproject.com/logs/fNBPyO0ASU5Qtka6
https://obsproject.com/logs/oJo8YbOBVlXql726

@derrod
Copy link
Member

derrod commented May 29, 2024

OBS does check if a file already exists unless the "Overwrite if file eixsts" option is enabled in advanced settings. It's possible that you're running into a race condition where the file simply does not exist yet by the time the check runs. Just use different output folders or filename formats.

@zenorbi
Copy link
Author

zenorbi commented May 29, 2024

I do not have the "Overwrite if file exists" option checked and I am clicking the 2 buttons manually with around 300ms in between (according to the logs).

Just for testing I have changed the format to always collide and I can confirm that given enough time between the 2 button presses, OBS will create a second file with (2) in the filename, so this looks to be a race condition.

Next time I will write to different folders but this was just bad luck where I have lost one of my recordings due to this, but I believe in reporting issues even if I already know the solution (for example, wait 1 second between starting each recording session).

@derrod
Copy link
Member

derrod commented May 29, 2024

There are some things we could try to prevent this at least, e.g. the first instance to decide on a filename could touch the file so it exists as a 0-byte placeholder until the output and encoder are ready to start writing actual data.

We can probably leave this open for now.

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

No branches or pull requests

3 participants