RPi Video Streaming: Ffmpeg/Ffserver

Ffmpeg is the other video streaming software we used on the Raspberry Pi. We chose to experiment with this software because of its extensive documentation online (here). We also chose to use Ffmpeg because of it's streaming capabilities. Unlike Motion, Ffmpeg has Java streaming capabilities already built into Java syntax. Since our UI is going to be written entirely (well, almost entirely) in Java we thought that having a simple code to grab images from the Pi would be useful. One of the drawbacks to Ffmpeg is its size. Ffmpeg is massive and therefore runs into problems while trying to stream on the Pi. It has hundreds of options which can be changed for your liking. We made up our minds on it's usefulness pertaining to our project, but first check it our for yourself.

The compiling and configuration of Ffmpeg is more difficult than for Motion, but if you follow the directions below it shouldn't be a problem


1. VLC


1. Add the following sources to your /etc/apt/sources.list page

2. Update the Pi (I know this is the umpteenth time you've updated, but it is a good way to make sure your code doesn't cause you any problems)

3. Download dependencies

4. Remove the second line you added above (it should look line the screen below)

5. Download the source code.

6. cd into the ffmpeg directory

7. Configure and install


1. Create a file in /etc called ffserver.conf

2. Add configuration settings (similar to the ones below). You can change these in a number of ways.

3. Now create a file in /usr/sbin called subcam.sh

4. And add this code:

5. Make it executable over the command line:

Running Ffmpeg:

1. Type in the following to start the server. The following stream output appear (2nd image)

2. Open up VLC and first navigate to the Open Network option and then type in the following url:

  • http://<my ip address>:8090/subcam.[video formate] (.asf, .swf, .mjpeg)

Navigating VLC
Opening up the stream

3. Now you have your ffmpeg stream! Yay!

Example Ffmpeg stream

Although Ffmpeg is great for many projects we realized that it is not right for ours. It has many capabilities that we do not need. This adds to the size of the program which is then related to the speed at which the Raspberry Pi can run it. The video we got using Ffmpeg was slow and laggey (not what we're looking for). Since this software did not work out for us we're going to try using MJPG-Streamer. It looks very promising. Stay updated to learn which streaming software we chose to use.


  1. Love to read it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks.
    servidor de streamingde video

  2. Amazing Article, thank you!. I am very glad to read your informative & practical blog. Kindly keep updating your blog. Java Developer is a wonderful career for
    IT students.To start Dream Career to become a Java developer learn from Java Training in Chennai.
    or learn thru Java Online Training from India .