Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the latest updated Ubuntu 12.04 and I would like to know how I can stream my second monitor to an RTMP address. (

Is there any kind of streaming on Linux I can set up, or an up to date guide that shows how to do it in 12.04?

share|improve this question

Red5 Install red5-server

This is a free RTMP server for recording and streaming to a Flash client. Its features according to the project's home page are:

  • Streaming Audio/Video (FLV and MP3)
  • Recording Client Streams (FLV only)
  • Shared Objects
  • Live Stream Publishing (live h264 supported now)
  • Remoting ( AMF0/ AMF3)

The application is mainly intended to setup your own RTMP server. We have no experience on how to set up sending a stream to a remote streaming server and if we are able to do this for Some documentation exists on the project's home page indicating that this can be done.

A (somehow quite nested) documentation can be found on the projects pages:

share|improve this answer
Thanks for this list. I am a complete Ubuntu Novice. Can you link to the documentation that explains how to stream to RTMP? I'm very overwhelmed with all these foreign commands / documentation. – Michaeljwjr Jul 25 '12 at 20:42
How come there are two upvotes, but no explanation how to do this exactly? – keiki Jul 8 '14 at 16:47

A good google search finds a bit. Best to do that first. Anyhow its not easy but take a look at this:

share|improve this answer
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Eliah Kagan Jul 25 '12 at 8:13
Noted Eliah, Thanks! – Vromoth Jul 25 '12 at 8:24
If you want to improve your answer, you can always edit it (the edit link is under the answer, near the left side). – Eliah Kagan Jul 25 '12 at 8:31
That, like all of the other tutorials I've already found through google searches, are obsolete. – Michaeljwjr Jul 25 '12 at 19:52

You can stream directly to an RMTP address using ffmpeg or avconv provided you have the necessary authentication (stream key).

An condensed example of using ffmpeg to stream to the RMTP server would be as follows:

# stream key. You can set this manually.
STREAM_KEY=$(cat ~/.twitch_key)

# stream url. Note the formats for and
# twitch:"rtmp://$STREAM_KEY"
# justin:"rtmp://$STREAM_KEY"

ffmpeg \
-f alsa -ac 2 -i "pulse" \
-f x11grab -s $(xwininfo -root | awk '/geometry/ {print $2}'i) -r "30" -i :0.0 \
-vcodec libx264 -pix_fmt yuv420p -s "640x360" -vpre "fast" \
-acodec libmp3lame -threads 6 -qscale 5 -b 64KB \
-f flv -ar 22050 "$STREAM_URL"

For more information on how to stream to popular platforms like and see this askubuntu answer.

A gist of an extended version of the above script can be found here:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.