Skip to content

Instantly share code, notes, and snippets.

@josefnpat
Created November 18, 2012 02:00
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 josefnpat/4102798 to your computer and use it in GitHub Desktop.
Save josefnpat/4102798 to your computer and use it in GitHub Desktop.
Ubuntu 10.04 Instructions
#!/bin/bash
INRES="1920x1200" # input resolution
OUTRES="640x480"
OFFSET="0,0"
FPS="15" # target FPS
QUAL="fast" # one of the many FFMPEG preset
STREAM_KEY="your_key_here_sexy"
URL="rtmp://live.justin.tv/app/$STREAM_KEY"
ffmpeg -f x11grab \
-s "$INRES" \
-r "$FPS" \
-i :0.0+$OFFSET \
-ab 192k \
-f alsa \
-ac 2 \
-i pulse \
-crf 30 \
-preset "$QUAL" \
-s "1280x720" \
-vol 11200 \
-acodec libmp3lame \
-ar 44100 -threads 0 \
-f flv "$URL"
This is how to get video working for justin.tv.txt on ubuntu 10.04.
Note: audio doesn't work
Note: some of this may be superfluous
Note: some may be missing, but I tried to trace my steps back.
1) Get rid of your current ffmpeg and x264
sudo apt-get remove ffmpeg x264
2) install dependencies
* sudo apt-get install libavcodec-extra-52
* sudo apt-get install avconv
* sudo apt-get libav-tools
* sudo apt-get libxfixes-dev x11proto-fixes-dev
2) build x264
* git clone git://git.videolan.org/x264.git x264
* cd 264
* ./configure --enable-static
* make
* sudo make install
3) Build ffmpeg from source like so:
* git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
* cd ffmpeg
* ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libtheora --enable-libx264 --enable-x11grab --enable-libvorbis --enable-libmp3lame
* make
* sudo make install
4) make this script
* wget https://raw.github.com/gist/4102798/justin.tv.sh -o justin.tv.sh
* chmod a+x justin.tv.sh
5) * Update the scripts (justin.tv.sh) variables.
* INRES # your screens resolution
* OUTRES # in case you want to do some extra compression?
* OFFSET # in case you have a second monitor?
* FPS # I seem to max out at 24 fps, but 15 is healthy?
* STREAM_KEY # this you can get from http://www.justin.tv/broadcast/adv_other
6) run the script!
* `q` to exit.
* ./justin.tv.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment