Join 3,512 readers in helping fund MetaFilter (Hide)


Resource-friendly Linux app to stream audio and video over LAN (not VLC or FFserver)?
July 14, 2010 2:56 AM   Subscribe

Any suggestions for some resource-friendly linux software to stream live video (from a webcam) and audio (from a line-in) over the LAN (other than VLC and FFserver)?

I have successfully managed to stream video and audio from my webcam and line-in (mic) using both VLC and FFserver/FFmpeg. The problem is, they both absolutely kill my CPU, since they are trying to transcode the feeds. I would ideally like to stream the rawvideo and audio, with no transcoding, since I am using VLC to view, so formats wont be a problem.

I was just wondering if anyone knows of any alternatives that don't kill the CPU. Using two apps to create to streams (one for audio and one for video) is fine. Everything I have tried just maxes out the CPU...

This is for a home-made baby monitor I am trying to fix up - uses one of those webcams with IR LEDs for nightvision. Works great, but the CPU is really getting hammered (and audio delayed by 10 secs!!).
posted by prupert to Computers & Internet (9 answers total)
 
I don't understand why you're not simply telling VLC to stream without transcoding.
posted by flabdablet at 4:22 AM on July 14, 2010


Icecast.
posted by mhoye at 5:37 AM on July 14, 2010


As far as I was aware, that was exactly what I was doing, but CPU usage still maxes out. I suppose at this point I should own up and admit that I am trying to do this on a Transmeta Crusoe 750Mhz processor (its an old HP T5700 thin client)...
posted by prupert at 8:50 AM on July 14, 2010


Icecast can do video as well? I need to check that - which client (to actually capture the video / audio) do you recommend. I could only see ices2 and ices0 in the Ubuntu repos and they seemed audio only.....
posted by prupert at 8:51 AM on July 14, 2010


Well, I have found a kinda cheat. Using cpulimit discovered from this post: http://kakku.wordpress.com/2007/10/31/ubuntu-windows-limit-cpu-usage-control-that-bully-ipod-tip/ I have been able to limit the cpuload to 75% so far and am keeping on trying to see how far I can get it. I know it isn't the same thing, but in practice it works well amazingly. No effect on the stream as yet!

And if anyone can tell me how to reply to individual comments on askmetafi, that would be great, since I can't figure that out at all!
posted by prupert at 8:53 AM on July 14, 2010


I'm going to rudely glom on here, but I have kind of the same problem, though nowhere near the CPU usage of the OP, though I am also satisfying myself with a 2/3 reduction in video dimensions. I use around 40% CPU steadily on an eeeBox running Ubuntu server.

The relevant part of my VLC command line is: :sout="#transcode{vcodec=mp2v,scale=0.33,vb=1600,acodec=
mpga,ab=32}:std{access=http,mux=ts,dst=0.0.0.0:1234}

Can anyone suggest the parameters to be used in VLC to stream video & audio at the same time without transcoding? Can you just use mux=ts, acodec=mpga, but fail to supply parameters for the vcodec?
posted by rocketpup at 10:45 AM on July 14, 2010


Are you sure that VLC/etc. is transcoding? I'd imagine that your Transmeta is getting taxed from merely decoding, since, in addition to it being a lower MHz CPU, its architecture is such that it emulates whatever chip the OS thinks it's running on. You're running a low-speed emulator to play live video. This can be a big ask.

In what format is the webcam supplying "rawvideo?" Is this configurable? I'm gonna say that any level of MPEG will likely be a dead end as far as performance goes with your current hardware. If you're restricted to the signals you current have, only to find a way to display those on the HP, a possible next step would be to try to find a USB video capture device to offload the de- or trans-coding.
posted by rhizome at 10:53 AM on July 14, 2010


BTW, prupert, my application is exactly the same as yours. My eeeBox uses an AtomN270 which probably has significantly more muscle than your Transmeta. But the transcoding options in my command line above were about the lightest on CPU that I was able to come up with, though I am by no means an expert. Theora killed my CPU. DIV3 wasn't too bad.

I also started out using Palantir which I think would have been even lighter on CPU if I had gotten it to work properly. Video worked great but I was never quite able to get the audio working. You might have better luck if you want to try it out. Note that you can view the video stream natively in most browsers, but to hear the audio you need to use the Windows client.
posted by rocketpup at 11:28 AM on July 14, 2010


OK, this might be all techy, but here is the ouput from FFmpeg when I pass the webcam input and the mic input to it, to send to FFserver:

The Mic
Input #0, alsa, from 'hw:0,0':
Duration: N/A, start: 81382.999898, bitrate: N/A
Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s

The Video
Input #1, video4linux2, from '/dev/video0':
Duration: N/A, start: 1279132029.912693, bitrate: 6144 kb/s
Stream #1.0: Video: rawvideo, yuyv422, 320x240, 6144 kb/s, 5 tbr, 1000k tbn, 5 tbc

This is the output it is sending it to (the stream set up by FFserver):
Stream #0.0: Audio: libmp3lame, 22050 Hz, 1 channels, s16, 8 kb/s
Stream #0.1: Video: flv, yuv420p, 320x240, q=2-31, 128 kb/s, 1000k tbn, 5 tbc

And here is the part of the ffserver.conf that produces the stream that FFmpeg uses. This is so far the only stream I have got to work:


Feed feed1.ffm
Format flv
VideoCodec flv
#AudioCodec mp3
AudioBitRate 8
#AudioSampleRate 48000
#AudioChannels 1
VideoBitRate 128
#VideoBufferSize 1000
VideoFrameRate 5
#VideoQMin 1
#VideoQMax 5
VideoSize 320x240
PreRoll 0


You are right, VLC isn't transcoding it at all, since I am using the stout standard option. I guess it is as good as I can expect.

My main issue is that with the FFserver solution, the audio is horribly delayed, by about 60 seconds, and I haven'tt got VLC to stream audio and video, only audio.....
posted by prupert at 11:37 AM on July 14, 2010


« Older I would like to find a good so...   |  Where in London can I get nice... Newer »
This thread is closed to new comments.