Chapter 4. Getting Your Own Video and Feeds
"One server to satisfy them all" could have been the name of this chapter. We now have a great media server where we can share any media, but we would like to be more independent so that we can choose the functionalities the server can have. The goal of this chapter is to let you cross the bridge, where you are going to increase your knowledge by getting your hands dirty. After all, you want to build your own services, so why not create your own contents as well.
More specifically, here we will begin by building a webcam streaming service from scratch, and we will see how this can interact with what we have implemented previously in the server. We will also see how to set up a service to retrieve RSS feeds. We will discuss the services in the following sections:
Installing and running MJPG-Streamer
Detecting the hardware device and installing drivers and libraries for a webcam
Configuring RSS feeds with Leed
Detecting the hardware device and installing drivers and libraries for a webcam
Even though today many webcams are provided with hardware encoding capabilities such as the Logitech HD Pro series, we will focus on those without this capability, as we want to have a low budget project. You will then learn how to reuse any webcam left somewhere in a box because it is not being used. At the end, you can then create a low cost video conference system as well.
As you plug in the webcam, the Linux kernel will detect it, so you can read every detail it's able to retrieve about the connected device.
We are going to see two ways to retrieve the webcam we have plugged in: the easy one that is not complete and the harder one that is complete.
| "All magic comes with a price." | |
| --Rumpelstiltskin, Once Upon a Time |
Note
Often, at a certain point in your installation, you have to choose between the easy or the hard way. Most of the time, powerful Linux commands or tools are not thought...
Installing and running MJPG-Streamer
Now that we have checked the chain from the hardware level up to the driver, we can install the software that will make use of Video4Linux for video streaming. Here comes MJPG -Streamer.
This application aims to provide you with a JPEG stream on the network available for browsers and all video applications.
Besides this, we are also interested in this solution as it's made for systems with less advanced CPU, so we can start MJPG-Streamer as a service. With this streamer, you can also use the built-hardware compression and even control webcams such as pan, tilt, rotations, zoom capabilities, and so on.
Before installing MJPG-Streamer, we will install all the necessary dependencies:
Next, we will retrieve the code from the project:
You can now build the executable from the sources you just...
Configuring RSS feeds with Leed
Our server can handle videos, pictures, and music from any source and it would be cool to have another tool to retrieve news from some RSS providers. This can be done with Leed, a RSS project organized for servers. You can have a final result, as shown in the following screenshot:
This project has a "quick and easy" installation spirit, so you can give it a try without harness. Leed (for Light Feed) allows you to you access RSS feeds from any browser, so no RSS reader application is needed, and every user in your network can read them as well. You install it on the server and feeds are automatically updated.
Note
Well, the truth behind the scenes is that a cron
task does this for you. You will be guided to set some synchronisation after the installation.
Creating the environment for Leed in three steps
We already have Apache, MySQL, and PHP installed, and we need a few other prerequisites to run Leed:
Create a database for Leed
Download the project code and set permissions...
In this chapter, we had some good experiments with the hardware part of the server "from the ground," to finally end by successfully setting up the webcam service on boot. We discovered hardware detection, a way to "talk" with our local webcam and thus to be able to see what happens when we plug a device in the BeagleBone.
Through the topics, we also discovered video4linux to retrieve information about the device, and learned about configuring devices. Along the way, we encountered MJPG-Streamer. Finally, it's better to be on our own instead of being dependent on some GUI interfaces, where you always wonder where you need to click. Finally, our efforts have been rewarded, as we ended up with a web page we can use and modify according to our tastes.
RSS news can also be provided by our server so that you can manage all your feeds in one place, read them anywhere, and even organize dedicated groups.
Plenty of concepts have been seen for hardware and software. Then think of this chapter...