obsproject / obsproject/obs-studio

Media source hangs (RTSP), but OBS is unaware

Open
#11,537 0 comments 4 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

Ubuntu 24.04

Other OS

KDE Neon 6.2, based on Ubuntu 24.04

OBS Studio Version

30.2.3

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/rJKXLhOZLn5wgVuh

OBS Studio Crash Log URL

No response

Expected Behavior

OBS should be able to find out that the source streams stopped producing frames and restart the source reading

Current Behavior

RTSP stream may stop producing frames, but underlying FFMPEG probably keeps going. The result is the stream being stuck forever. I have to change some property to make OBS restart the source.

Steps to Reproduce
  1. Find a RTSP stream
  2. Add it as source media
  3. Wait for the source media to stop producing frames, while not stopping FFMPEG at the same time (this can be tricky I guess and take forever, making reproduction impossible)
Anything else we should know?

In the OBS log there is no log from ffmpeg, so the event that occured it's basically invisible in the log. The stream died at around 03:06:59 am, in the log file there is nothing between 02:14:58 and 09:40:20. Can I enable more logging somehow?

Anyway.

I was working on a hobby project once that was recording streams using FFMPEG. I had a situation where the stream stopped producing frames, but FFMPEG kept running. As a result, nothing was recorded and this situation was ignored.

So I made a fix and I was observing frame= lines:

frame=    0 fps=0.0 q=0.0 size=       0kB time=N/A bitrate=N/A speed=N/A    
frame=   30 fps= 20 q=33.0 size=    1024kB time=00:00:00.46 bitrate=17976.4kbits/s speed=0.314x    
frame=   58 fps= 29 q=33.0 size=    1536kB time=00:00:00.93 bitrate=13482.1kbits/s speed=0.468x    

And if no such line in the ffmpeg log was produced for 5 seconds - I was considering the recording broken and I was restarting ffmpeg. I think OBS should do the same. The timeout can be configurable I guess, but usually no frames for 5 seconds means the stream is dead.

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 by reviewing the supplied OBS log and the RTSP media-source behavior described in the issue, focusing on the gap where the stream stopped producing frames. Compare that with the reported FFmpeg frame-progress output. Done means OBS detects a sustained lack of frames and restarts the source, with the behavior verified against an RTSP stream.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
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.