Skip to content

Instantly share code, notes, and snippets.

@nk23x
Created February 19, 2023 16:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nk23x/7d0abd553905ca9001aa7d0e0829de7f to your computer and use it in GitHub Desktop.
Save nk23x/7d0abd553905ca9001aa7d0e0829de7f to your computer and use it in GitHub Desktop.
ffmpeg: stream 128k icecast radio to twitter broadcast rtmp source

twitter broadcast w. ffmpeg

step 1

you need to create a source in studio.twitter.com

step 2

use ffmpeg to create a black video stream with audi from a different (network-)source stream (icecast)

ffmpeg -f lavfi -y -i color=c=black@0:rate=30 \
  -i "{http[s]://STREAM_URL}" \
  -c:v libx264 -b:v 1600k -preset ultrafast \
  -c:a aac -b:a 128k -s 1920×1080 -x264opts keyint=50 \
  -g 25 -pix_fmt yuv420p -f flv \
  "rtmp://sg.pscp.tv:80/x/{BROADCAST_KEY}"

step 3

create a broadcast with the previously created source: public, no broadcast recording, ...

step 4

use the broadcast url with an url shortener like https://is.gd/ or something and post the shortened url on twitter if you want, without hashtags or something

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