Skip to content

Instantly share code, notes, and snippets.

@waltz
Created May 8, 2020 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waltz/80b2dc29c051f0b65d1bb55f3ddfcc14 to your computer and use it in GitHub Desktop.
Save waltz/80b2dc29c051f0b65d1bb55f3ddfcc14 to your computer and use it in GitHub Desktop.
FFMPEG to Twitch
#! /usr/bin/env bash
STREAM_KEY=""
echo Streaming: $1
TWITCH="rtmp://live.twitch.tv/app/${STREAM_KEY}"
INSTA="rtmps://live-upload.instagram.com:443/rtmp/$STREAM_KEY"
ffmpeg \
-re \
-i "$1" \
-ac 2 \
-r 30 \
-c:v libx264 \
-b:v 300000 \
-preset ultrafast \
-pix_fmt yuv420p \
-s 1280x720 \
-c:a aac \
-b:a 160k \
-ar 44100 \
-f flv "${INSTA}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment