I have been broadcasting my desktop for a couple of days, mainly because I would need to test my x11grabr. I recalled more than a year ago, I would need to set up things in order to get streaming out. ( You might be seeing a new box showing up at the end of this box, which would be telling you click on the play button! )

1   Justin.tv


Justin.tv was shut down on August 5, 2014.

On Justin.tv you can grab the stream key in channel info page1, scroll down for Stream Key.

I am not going to bore you, so here is the script I am currently using:

# 2011-09-06T06:45:42Z



/path/to/x11grabr/x11grabr -s "$VIDEO_SIZE" -r "$FPS" -bnone |
ffmpeg -f rawvideo -pix_fmt bgra -s "$VIDEO_SIZE" -r "$FPS" -i - \
       -f alsa -ac 1 -ar 11025 -i pulse \
       -vcodec libx264 -vpre baseline \
       -acodec libmp3lame -ab 32k \
       -threads 0 \
       -f flv "$STREAM_URL"
       #-f alsa -ac 2 -ar 22050 -i pulse \
       #-acodec pcm_s16le \
       #-acodec libmp3lame -ab 64k \
       #-acodec aac -strict experimental -ab 64k \
       #-acodec aac -strict experimental \

I use 630x352 because it gives me pixel-to-pixel when viewing on Justin.tv. I broadcast my desktop, so I dont like the image to be re-scaled. Also, you might want to use built-in x11grab in ffmpeg. So you may need to launch ffmpeg like (untested):

ffmpeg -f x11grab -pix_fmt bgra -s "$VIDEO_SIZE" -r "$FPS" -i :0.0 \
       # the rest of stuff

Note that I have submitted two patches, once they get released you would have better control.

1.1   IRC Chat

Justin.tvs webchat is pretty buggy, at least it doesnt like me much. I have seen message being eaten up, I thought why the other person kept talking to self. Another issue was funny, I had to turn off (uncheck) in order to show timestamp. But it seems fixed, right now.

If you use irssi, here is the simple configuration I have added:

servers = (
    address = "livibetter.jtvirc.com";
    chatnet = "jtvme";
    port = "6667";
    password = "<YOUR JTV PASSWORD>";
    use_ssl = "no";
    ssl_verify = "no";

chatnets = {
  jtvme = { type = "IRC"; };

channels = (
  { name = "#livibetter"; chatnet = "jtvme"; autojoin = "yes"; },

When I start broadcasting, I fire up irssi and issue /connect jtvme to connect to my own IRC channel.

If you dont have IRC client, currently stable Firefox allows you to open IRC via third-party website, its ehh, I forgot the name. Anyway, it has no problem to connect to JTVs IRC server. It took me sometime to Google correct information and pieced them up into my configuration.

1.2   Music

Streaming with music is always some vague issues. I love watching StarCraft II [SCII] channels and I have seen some complaints over some channels before, but right now it seems fine because those top-page popular channels play music via GrooveShark or YouTube. I dont know if its somewhat ignored by JTV. I dont believe those labels would let JTV off the hook.

At first, I didnt even have audio stream sent to JTV. I found its boring, so I started to play those music I downloaded from Jamendo before. I still didnt give them proper attribution, though I have put a Last.fm recently played on channel page.

[SCII]Nope, I dont play, I just watch. I use Linux.

2   Ustream

As for Ustream, you need to download the FME XML file, search for <stream>, the string inside is your STREAM_KEY.


# Go Live -> Start Broadcasting


# flashver part is important
STREAM_URL="rtmp://1.486020.fme.ustream.tv/ustreamVideo/486020/$STREAM_KEY flashver=FMLE/3.0\20(compatible;\20FMSc/1.0)"

/path/to/x11grabr/x11grabr -s "$VIDEO_SIZE" -r "$FPS" -bnone |
ffmpeg -f rawvideo -pix_fmt bgra -s "$VIDEO_SIZE" -r "$FPS" -i - \
       -f alsa -ac 2 -ar 22050 -i pulse \
       -vcodec libx264 -vpre baseline \
       -acodec libmp3lame -ab 48k \
       -f flv "$STREAM_URL"
       # can use flv as well
       # -vcodec flv \
       #-b 1000 -vframes 500 \
       # -threads 0 \
       #-f alsa -ac 2 -ar 22050 -i pulse \
       # -acodec pcm_s16le \
       #-acodec libmp3lame -ab 32k \
       #-acodec libmp3lame -ab 64k \
       #-acodec aac -strict experimental -ab 64k \
       #-acodec aac -strict experimental -ab 32k \
       #-acodec aac -strict experimental \

3   Notes

I dont like broadcasting on Ustream, because it requires you to click on Start Broadcasting on the website and you need to keep the Flash on. Which we Linux users all know, Flash has not-so-good performance. If you know how to bypass it, please leave a comment. However, it has nice beginner controls of your stream, I think you can put on overlay text by using it.

And be careful for your stream key, ffmpeg might print out that URL, which would include your key. I think your can lower your log level, but I dont want to do that, read ffmpeg(1) if you need to.

[1]http://www.justin.tv/settings/channel/info/ is gone, because Justin.tv is gone.