{"id":26661292,"url":"https://github.com/dlukt/srtmiddleware","last_synced_at":"2026-04-11T16:15:21.185Z","repository":{"id":283815676,"uuid":"947992909","full_name":"dlukt/srtmiddleware","owner":"dlukt","description":"srt middleware proxy and data rate monitor with obs scene switcher","archived":false,"fork":false,"pushed_at":"2025-03-22T11:11:28.000Z","size":133,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T11:27:34.933Z","etag":null,"topics":["grpc","live-streaming","obs","proxy","scene-switcher","srt"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dlukt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-13T15:15:59.000Z","updated_at":"2025-03-22T11:11:31.000Z","dependencies_parsed_at":"2025-03-22T11:39:28.443Z","dependency_job_id":null,"html_url":"https://github.com/dlukt/srtmiddleware","commit_stats":null,"previous_names":["dlukt/srtmiddleware"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlukt%2Fsrtmiddleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlukt%2Fsrtmiddleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlukt%2Fsrtmiddleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlukt%2Fsrtmiddleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlukt","download_url":"https://codeload.github.com/dlukt/srtmiddleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245467617,"owners_count":20620216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","live-streaming","obs","proxy","scene-switcher","srt"],"created_at":"2025-03-25T13:15:52.280Z","updated_at":"2026-04-11T16:15:21.180Z","avatar_url":"https://github.com/dlukt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SRT Middleware\nSRT Middleware is\na proxy and scene switcher for SRT and OBS.\n\nWhat it's not:\n- Using encrypted streams.\n\nIt\n- switches to BRB if no signal,\n- switches to LBR if bitrate is below 300kbps\n- switches to Live otherwise.\n- can optionally listen to Twitch chat via Twitch EventSub WebSockets and switch scenes on authorized `!commands`.\n\nStarting and stopping the stream is done with other tools (OBS Blade etc.)\n\n## Installing\n\n```bash\ngo install github.com/dlukt/srtmiddleware@latest\nmv ~/go/bin/srtmiddleware /usr/local/bin/\n```\n\nor\n\n```bash\ngit clone https://github.com/dlukt/srtmiddleware.git\ncd srtmiddleware\ngo build\nmv srtmiddleware /usr/local/bin/\n```\n\nor\n\nDownload pre-built binaries for your OS/arch from the [GitHub releases page](https://github.com/dlukt/srtmiddleware/releases)\n## Running\n**The proxy MUST be running before starting the monitor.**\n\n### Monitor config\n`monitor` now supports a YAML config file. The default path is `~/.srtmiddleware.yaml`.\n\nExample:\n\n```yaml\nmonitor:\n  grpc_addr: 127.0.0.1:50051\n  obs:\n    ws_addr: localhost:4455\n    ws_pass: \"\"\n  auto_scenes:\n    live: Live\n    lbr: LBR\n    brb: BRB\n  twitch:\n    enabled: true\n    client_id: your-client-id\n    client_secret: your-client-secret\n    redirect_url: http://127.0.0.1:8099/callback\n    listen_addr: 127.0.0.1:8099\n    access_token: \"\"\n    refresh_token: \"\"\n    expires_at: \"\"\n    scene_commands:\n      \"!live\": Live\n      \"!lbr\": LBR\n      \"!brb\": BRB\n      \"!intro\": Starting Soon\n```\n\n### systemd\n- copy the service files from the contrib directory\n- adjust the command line arguments\n\n## Proxy Arguments\n`--from=\"\"` and `--to=\"\"`\nmust be a SRT URL.\n### Examples\n```bash\nsrtmiddleware --from=\"srt://0.0.0.0:12345?mode=listener\" --to=\"srt://0.0.0.0:23456?mode=listener\"\nsrtmiddleware --from=\"srt://remote.ip.addr:12345?mode=caller\" --to=\"srt://127.0.0.1:23456?mode=listener\"\nsrtmiddleware --from=\"srt://0.0.0.0:12345?mode=listener\" --to=\"srt://127.0.0.1:10080?mode=caller\"\n```\nYou can also set a `passphrase` parameter if you're using listener mode.\n```bash\nsrtmiddleware --from=\"srt://0.0.0.0:5555?mode=listener\u0026passphrase=my_secret\" --to=\"srt://127.0.0.1:10080\"\n```\nSee also [further SRT options](https://github.com/datarhei/gosrt/blob/main/config.go)\nOr the [Haivision document](https://github.com/Haivision/srt/blob/master/docs/apps/srt-live-transmit.md)\n\n\n`--grpcaddr=\"\"`\ndefault `localhost:50051`\nis the address the proxy provides stats at.\n\n## Monitor Arguments\n`--config=\"\"`\ndefaults to `~/.srtmiddleware.yaml`\nand is the primary monitor configuration file.\n\n`--grpcaddr=\"\"`\ndefault `127.0.0.1:50051`\nis the address the monitor connects to for getting the stats from the proxy.\n\n`--wsaddr=\"\"`\ndefault `localhost:4455`\nis the OBS websocket instance the monitor connects to, to manage scenes. \n\n`--wspass=\"\"`\nis the password to use to connect to obs websocket.\nRead [how to secure obs websocket](https://blog.icod.de/2025/01/03/secure-obs-websocket-with-nginx/).\nIt's advised to either use a VPN is connecting from the outside or put it behind nginx for TLS termination, for privacy and security reasons.\n\n`--sceneLive=\"Live\"` `--sceneLBR=\"LBR\"` `--sceneBRB=\"BRB\"`\nare the scene names in OBS, they are case sensitive.\n![obs scenes image](assets/obs.png)\n\nThe monitor flags still work and override values from the config file.\n\n## Twitch Chat Control\nThis uses Twitch chat APIs and EventSub WebSockets, not IRC.\n\n1. Create a Twitch application with a redirect URL that matches your local callback, for example `http://127.0.0.1:8099/callback`.\n2. Fill in `monitor.twitch.client_id`, `monitor.twitch.client_secret`, `monitor.twitch.redirect_url`, `monitor.twitch.listen_addr`, and `monitor.twitch.scene_commands` in the config file.\n3. Run `srtmiddleware monitor login --config ~/.srtmiddleware.yaml`.\n4. Complete the browser login as the broadcaster account.\n5. Start the monitor with `srtmiddleware monitor --config ~/.srtmiddleware.yaml`.\n\nAuthorized Twitch users:\n- the broadcaster\n- moderators in that channel\n\nBehavior:\n- a configured `!command` switches to the mapped OBS scene and enables manual mode\n- while manual mode is active, bitrate-based switching is paused\n- `!auto` resumes bitrate-based switching\n- the monitor replies in chat after successful or failed actions\n\nRelevant flags:\n- `--twitch-enabled`\n- `--twitch-client-id`\n- `--twitch-client-secret`\n- `--twitch-redirect-url`\n- `--twitch-listen-addr`\n- `--scene-command !intro=Starting Soon`\n\n## Thank you\n\nTo [datarhei](https://github.com/datarhei), who wrote this fantastic go native SRT package.\nTo Marlow on Discord for the 300kbps Information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlukt%2Fsrtmiddleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlukt%2Fsrtmiddleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlukt%2Fsrtmiddleware/lists"}