Alright, so I've been looking for a good way to stream stuff from linux... and I mean a Good way. Popular stuff on microsoft windows like join.me and livestream suck... a lot. Fillies and gentlecolts, I present to you such a method: avconv+ffserver.
For the following command, config, and everything related, I'm using avconv on my Ubuntu 13.04 box. Debian and Ubuntu use avconv, which is a fork of ffmpeg. If you use a distro that prefers ffmpeg then the setup and commands should be pretty close to the same.
First, lets set up the server... first I made the following directory and file ~/.ffserver/ffserver.conf and put the following pastebin in it...
http://pastebin.com/na6EAa8x save and then launch the server with
ffserver -d -f ~/.ffmpeg/ffserver.conf
Alright, server should be running. Now, for the actual part that records the desktop and audio and sends it to ffserver:
Ok, this is kind of an intensive command, and a lot of it is dependent on desired affect and computer setup. So lets go over it...
avconv -f pulse -i default -f x11grab
Pull audio from pulseaudio (default on Ubuntu) and video from the desktop (X11)
-r 22
-r 22 is just defining 22 frames/second... its not really common, 24 or 25 might be more desirable in most cases. 25 is the default value if -r is not specified
-s 1920x1080 -i :0.0+1920,0 -vf scale=1280:720
Before explaining this, I should mention that I have three 1080p computer screens. This part of the command captures the middle screen and scales it down to 720p for streaming. Huh, now that I'm looking at this, 1280:720 and 1280x720 seem to work the same... *shrug*
pretty simple, spawn 4 threads for encoding, use the libx264 library to encode in H.264 video, and... uh.. -pix_fmt yuv420p is just to get rid of a warning message... async -1 tells it to not to try syncing the audio with the video. I think without this it tries too hard to keep the audio and video in sync thus desyncing everything.
There are a few audio codecs that are usable, AAC is the nicest. libvo_aacenc is probably better to use, and would not need the -strict experimental flag. aac both encodes and decodes, where libvo_aacenc only encodes. -ab and -ar define the audio bitrate and sampling frequency.
http://127.0.0.1:1076/pony.ffm
The last part... we are just telling avconv to pipe the output to ffserver on a local machine. This can be replace with a file, or it could pipe the output to both a file and ffserver.
After that just make sure pulseaudio is attaching the correct audio stream with the avconv command.
All that is cool, but not all... I can also grab video from a webcam basically the same way...
Now, instead I'm pulling video from a 720p webcam, and otherwise is identical to the first command.
But thats not all... with pulseaudio you can mix streams and output it as a single stream. So if you want to be able to stream and talk to all the ponies listening in, or just insult them, with music from fillydelphia radio playing in the background. I have not set this up, but it should work... http://www.pclinuxos.com/forum/index.php?topic=105968.0 (there may be better methods to doing this too)
Connecting to the stream... with the configuration I have, I just put http://tiwake.com:1076/stream.flv in VLC. Other media players might work, I have yet to test how many it will work with besides VLC. Evidently quicktime does not like it though.
Alright, what does all this mean? Well... I can now stream live from my webcam to all the ponies that want to watch laser stuff, and afterwards put it on youtube (this will be happening soon). I can also stream me arting with inkscape as well.