Configuring a streaming video

In order to provide video streaming from a USB device in our multimedia setup, we have to first install some software that will allow the BeagleBone to act as a server. The software that I chose to use is called MJPG Streamer. If you want to add more functionality than I have here, the instructions are available at http://shrkey.com/installing-mjpg-streamer-on-beaglebone-black/ and at Sourceforge (http://sourceforge.net/projects/mjpg-streamer/).

The first thing we have to do is install the tools and dependencies that we will need to compile the software.

I make it a habit to always do an apt-get update to make sure that all the repositories are up to date. The following commands will install the required tools and dependencies. If your tools are already installed and up to date, they will not be overwritten. All the commands assume that you are logged in as root:

  1. Run the following command:
    apt-get install g++ curl pkg-config libv4l-dev libjpeg-dev build-essential libssl-dev vim cmake
    
  2. Then, run this:
    apt-get install imagemagick
    
  3. Next, we have to get the code from the website I mentioned earlier:
    wget https://github.com/shrkey/mjpg-streamer/raw/master /mjpg-streamer.tar.gz
    
  4. Now that we have the tar ball, we can expand it in the directory of our choice:
    tar -xvf ./mjpg-streamer.tar.gz
    
  5. The next step is to compile the mjpg-streamer code:
    cd mjpg-streamer
    
    make USE_LIBV4L2=true
    
    make install
    
  6. Now, from the directory that we compiled in, we can run a quick test by typing the following:
    /mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"
    

This will start the server running from port 8080 of the BeagleBone. The input_uvc.so file is the input device driver used by mjpg_streamer, and output_http.so is the output device driver. The final argument is the directory, where the web page is located, that the video should be sent to.

You will see a screen much like what is shown in the following screenshot; the actual messages shown will depend on the capabilities of your particular camera:

MJPG Streamer Version: svn rev:
    i: Using V4L2 device.: /dev/video0
    i: Desired Resolution: 640 x 480
    i: Frames Per Second.: 5
    i: Format............: MJPEG
    o: www-folder-path...: ./www/
    o: HTTP TCP port.....: 8080
    o: username:password.: disabled
    o: commands..........: enabled

If you now go to the web interface described earlier and click on the Streaming Video button, you should see the output of your webcam.

The following screenshot is from a cheap dollar store camera (it came with an exercise video for about $3.00):

Configuring a streaming video
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.245.1