I’ve been working on fitting a webcam streaming server on a thin client.
Using Debian, I managed to get the base distribution down to 150 megabytes with my own kernel and stripping out unwanted packages like aptitude, logrotate, vim, and the default kernel with all of it’s modules.
After installing ffmpeg and openssh server, the distribution was brought to just under 200 megabytes.
Once I have the kernel installed and detecting my webcam, I can use ffmpeg and ffserver to stream video from the webcam to my network.
I created this ffserv.conf file in my root home directory –
That conf file will setup the parameters, and stream settings for ffserver to use when it starts streaming.
The first stanza sets up the port that the server will listen on, and the address.
The other 3 lines are self explanatory.
The Feed stanza is just defining the feed name and file it will use, while the stream stanza sets up the stream.
I am using mjpeg format as it’s light on the CPU but you can use other formats like FLV or ASF.
Once the config file has been created, you can use this command to start the streaming server.
ffserver -f /root/ffserv.conf & ffmpeg -v verbose -r 5 -s 320x240 -f video4linux2 -i /dev/video0 http://localhost:81/webcam.ffm
That command with start ffserver with the parameters in /root/ffserv.conf, and then start ffmpeg with a verbosity level of verbose, a default frame rate of 5, a size of 320×240, format of video4linux2, and an input device of /dev/video0, streaming it to http://localhost:81/webcam.ffm.
If you want to add audio to the stream, add the parameters –
-f oss -i /dev/dsp
Once the server has started streaming, you should be able to open the stream with a browser if the webcam is being streamed via mjpeg using the address of http://yourwebcamserver:81/webcam.mjpeg – replacing ‘yourwebcamserver’ with the IP address of the server hosting the stream.
You can also use a player like VLC to open a FLV or ASF stream.
Any questions of feedback ?
Please leave me a comment 🙂