obsproject / obsproject/obs-studio
[Media Source] Playback of intra-refresh video is inconsistent
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
28.0.1
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/Z9gc2nE1-H-WTNyf
OBS Studio Crash Log URL
No response
Expected Behavior
A MPEGTS Stream with the flag "intra-refresh=1" should playback correctly when opening it in Media Source.
Current Behavior
Playback of an intra-refresh mpegts stream* does not load first try.
To load an intra-refresh video you have to start your stream with the flag removed or disabled. Then end that stream. If you don't refresh the playback of the media source and then start the stream again with the flag "intra-refresh=1" it will play correctly.**
Playback of .ts video files recorded with this flag playback correctly on first load.
*using UDP MPEGTS (libx264, HEVC_NVENC and h264_NVENC)
** Using SRT you are unable to "hotswap" the SRT stream with new settings without refreshing the Media Source (If doing P2P)
Steps to Reproduce
- Create a UDP/SRT MPEGTS stream output in OBS using either (libx264, HEVC_NVENC or h264_NVENC)
- Add "intra-refresh=1" to the Video Encoder Settings/x264 Options
- Attempt to playback the stream using Media Source in OBS
- If done correctly audio should play however no video just blackscreen.
If using UDP you can temp fix this issue by:
1a. Stopping the stream you are currently playing in the Media Source
2a. Disable/Remove "intra-refresh"
3a. Start the stream again. (It will now play correctly)
4a. Stop the stream again.
5a. Add/Enable "intra-refresh" Then start the stream again without touching the media source and then the video will playback correctly with intra-refresh.
Anything else we should know?
intra-refresh changes how keyframes are encoded. Rather than using I frames at specific intervals, intra-refresh will "keyframe" the video as a progressive scan. (left to right with x264) (top to bot with NVENC) This makes is more ideal when broadcasting low latency content or content that needs more consistant data per frame. Also better resiliance to packet loss.
Enabling "Use hardware decoding when available" makes x264 work perfectly. (HOWEVER playback of NVENC with hardware decoding will ignore the rolling keyframe data and just show p frame/motion data)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in OBS Media Source with a UDP or SRT MPEGTS stream using intra-refresh=1, following the listed steps and checking the provided log. Compare first-load playback with the described workaround; done means video renders correctly on the initial load without refreshing or changing the stream settings.
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