Skip to content

Instantly share code, notes, and snippets.

@Taehun
Created October 9, 2012 01:15
Show Gist options
  • Save Taehun/3856003 to your computer and use it in GitHub Desktop.
Save Taehun/3856003 to your computer and use it in GitHub Desktop.
Live stream shell script using ffmpeg in justin.tv
#!/bin/sh
# ref> http://onestep.tistory.com/83
INRES="1920x1080" # input resolution
OUTRES="640x360"
FPS="20" # target FPS
# Justin
STREAM_KEY="live_29225937_MudL5ituoYdWTqHSZkIrMqMxKTi0OG"
URL="rtmp://live.justin.tv/app/$STREAM_KEY"
ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0 \
-f alsa -ac 2 -i pulse -vcodec libx264 -s "$OUTRES" -ar 22050 \
-acodec libmp3lame -ab 64k -threads 0 \
-f flv $URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment