Skip to content

Instantly share code, notes, and snippets.

@yegor256
Last active February 28, 2025 01:16
Show Gist options
  • Save yegor256/41d1253559bd28d529eb9c0bc06b565f to your computer and use it in GitHub Desktop.
Save yegor256/41d1253559bd28d529eb9c0bc06b565f to your computer and use it in GitHub Desktop.
How to stream live to a few platforms (YouTube + VK)

Supposedly, you are on macOS. You want to stream live to YouTube, VK, and maybe a few other platforms.

First, install OBS, ffmpeg, and mac-local-rtmp-server.

Then, create this script:

#!/bin/bash

vk=9385443863383_8393931956757_jsuqjadrew # your key goes here
youtube=sxhe-iktg-w4cj-44rg-3rgf # replace with your key

ffmpeg -i rtmp://127.0.0.1/live/swordfish \
    -c:v copy -c:a copy -map 0 -f tee \
    "[f=flv]rtmp://ovsu.mycdn.me/input/${vk}|[f=flv]rtmp://a.rtmp.youtube.com/live2/${youtube}"

Start mac-local-rtmp-server, you should see its icon in the menu bar.

Start OBS, go to "Settings/Stream/Destination", and configure it like this:

Server: rtmp://127.0.0.1/live
Stream key: swordfish

Now, click "Start streaming" in OBS.

Finally, run the bash script and let it stream.

BTW, I didn't manage to configure my script to stream to Twitter/X. Do you know how this can be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment