Skip to content

winter1l/auto-obs-srt-bitrate-rtt-alert

Repository files navigation

auto-obs-srt-bitrate-rtt-alert

2025-01-16.18-59-14.mp4

auto-obs-srt-bitrate-rtt-alert includes both Korean and English versions
auto-obs-srt-bitrate-rtt-alert는 한국어, 영어 버전을 지원합니다.

English | 한국어

English

This program is a Python-based script that currently supports only the SRT(LA) server.

The script fetches bitrate and RTT values from the SRT(LA) stats URL. If these values drop below the thresholds specified in abc_config.json, it displays a source in OBS via the OBS WebSocket and then hides it after the specified duration. The script checks bitrate and RTT every 2 seconds, ignoring the first 15 seconds of unstable values to ensure accurate measurement once connected.

Made using GPT 4o, claude 3.5 sonnet.

How to Use

  1. Download auto-obs-srt-bitrate-rtt-alert_en.zip from the Releases.
  2. Extract the .zip file and open abc_config.json to modify it as needed.
Sample code. Do not use this as is.
{
    "STATS_URL": "http://127.0.0.1:8181/stats",  // SRT Server stats URL
    "PUBLISHER": "live/stream/belabox",          // SRT Stream Key
    "OBS_HOST": "localhost",                     // OBS WebSocket IP. Modify this if OBS is running on a different computer.
    "OBS_PORT": 4455,                            // OBS WebSocket port number
    "OBS_PASSWORD": "password",                  // OBS WebSocket password
    "SOURCE_NAME": "Low bitrate",                // Name of the OBS source to toggle visibility
    "SCENE_NAME": "Live",                        // Scene name containing the source
    "BITRATE_THRESHOLD": 2000,                   // Display OBS source if bitrate falls below this value (kbps) | Must be greater than 0
    "RTT_THRESHOLD": 700,                        // Display OBS source if RTT exceeds this value (ms) | Must be greater than 0
    "COOLDOWN_SECONDS": 600,                     // Cooldown time after activation (seconds) | Must be longer than SOURCE_DISPLAY_TIME
    "SOURCE_DISPLAY_TIME": 30                    // Duration to display the source (seconds) | Must be longer than 1 second
}
  1. Run auto-obs-srt-bitrate-rtt-alert_en.exe

Important

auto-obs-srt-bitrate-rtt-alert_en.exe and abc_config.json must be located in the same folder.

Source Example

image

  1. Create a new Scene (or use a Source Group if preferred).
  2. Add a Color Source for the background and adjust its size appropriately (e.g., 1920x70 in my case).
  3. Add a Text Source and write the desired content.
  4. Visit the Bitrate Overlay Website, input server information, and save it using Download HTML.
  5. In OBS, add a Browser Source.
  6. Enable the Local File option.
  7. Use the Browse and select the downloaded HTML file.
  8. Adjust the size to 450x70.
  9. In an existing scene, use Add SourceScene to include the previously created Scene Source.

Tip

Adding a Slide for Show Transition and Hide Transition in the source can improve the effect.

한국어

이 프로그램은 파이썬으로 동작하는 스크립트이며 현재는 SRT(LA) 서버만 지원합니다.

SRT(LA) stats URL에서 비트레이트와 RTT 값을 가져오며 abc_config.json에 설정된 기준 이하로 떨어지면 OBS Websocket을 통해 OBS 소스를 표시한 후 설정한 시간 뒤에 사라지는 스트립트입니다. 2초 마다 비트레이트와 RTT를 감지하며, 연결되었을때 안정적인 측정을 위해 값이 불안정한 처음 15초는 무시하게 됩니다.

GPT 4o, claude 3.5 sonnet를 이용해 만들었습니다.

사용방법

  1. Releases에서 auto-obs-srt-bitrate-rtt-alert_kr.zip를 받습니다.
  2. .zip을 압축 해제하고 abc_config.json을 열어 수정합니다.
보기용 코드입니다. 이 코드를 사용하지마세요.
{
    "STATS_URL": "http://127.0.0.1:8181/stats",  // SRT Server stats URL
    "PUBLISHER": "live/stream/belabox",          // SRT Stream Key
    "OBS_HOST": "localhost",                     // OBS Websocket IP. 이 파일을 실행하는 컴퓨터와 OBS를 실행하는 컴퓨터가 다르다면 수정
    "OBS_PORT": 4455,                            // OBS Websocket 포트 번호
    "OBS_PASSWORD": "password",                  // OBS Websocket 비밀번호
    "SOURCE_NAME": "Low bitrate",                // 보기 상태를 토글할 OBS 소스 이름
    "SCENE_NAME": "Live",                        // 소스가 있는 장면 이름
    "BITRATE_THRESHOLD": 2000,                   // 이 비트레이트 미만이면 OBS 소스를 표시 (kbps) | 0보다 커야함
    "RTT_THRESHOLD": 700,                        // 이 RTT 값 이상이면 OBS 소스를 표시 (ms) | 0보다 커야함
    "COOLDOWN_SECONDS": 600,                     // 작동 후 쿨타임 (초) | SOURCE_DISPLAY_TIME보다 길어야됨
    "SOURCE_DISPLAY_TIME": 30                    // 소스를 표시할 시간 (초) | 1초보다 길어야됨
}
  1. auto-obs-srt-bitrate-rtt-alert_kr.exe를 실행합니다.

Important

auto-obs-srt-bitrate-rtt-alert_kr.exeabc_config.json은 같은 폴더에 위치해야 합니다.

소스 예시

image

  1. 장면 만들기 (소스 그룹으로 만드셔도 상관없습니다.)
  2. 뒷 배경이 될 색상 소스를 추가하고 적절한 사이즈로 조절 (저의 경우에는 1920x70)
  3. 텍스트를 추가해 내용 작성
  4. 비트레이트 오버레이 사이트에서 서버 정보를 입력 후 Download HTML로 저장
  5. OBS에서 브라우저를 추가
  6. 로컬 파일활성화
  7. 로컬 파일 찾아보기에서 저장한 파일을 불러오기
  8. 사이즈를 450x70으로 조절
  9. 기존에 쓰던 장면에서 소스 추가장면으로 장면 소스 추가

Tip

소스에서 표시 화면전환, 숨김 화면전환에서 슬라이드를 추가하여 트랜지션 효과를 줄 수 있습니다.

Libraries and Licenses