obsproject / obsproject/obs-studio

OBS does not de-initialize encoders on RTMP stream start fail

Open
#10,651 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

30.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/6iizipF9Li5buy3e

OBS Studio Crash Log URL

No response

Expected Behavior

If the stream output fails to start, allocated encoders should be de-allocated if they are not being used.

Current Behavior

The encoders sit initialized but not started, as obs_output_begin_data_capture() was never called. In the case of NVENC, this results in an NVENC session lingering around taking up a slot until OBS is shut down or a stream is successfully started.

nvidia-smi:

    Encoder Stats
        Active Sessions                   : 1
        Average FPS                       : 0
        Average Latency                   : 0
Steps to Reproduce
  1. Load OBS
  2. Configure an RTMP or WHIP stream with an invalid stream key/bearer token
  3. Attempt to start stream, it should fail with the "unable to access channel" error message
  4. Observe that the encoder was initialized but never freed.
Anything else we should know?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stream-start failure path described in the reproduction steps and trace how encoder initialization relates to obs_output_begin_data_capture(). Use the linked OBS log and the invalid RTMP or WHIP credential scenario to confirm the encoder remains initialized after failure; done means the encoder is released when stream startup fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.