Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Beaglebone Media Center

You're reading from  Beaglebone Media Center

Product type Book
Published in Jan 2015
Publisher
ISBN-13 9781784399993
Pages 164 pages
Edition 1st Edition
Languages
Author (1):
David Lewin David Lewin
Profile icon David Lewin

Table of Contents (15) Chapters

BeagleBone Media Center
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Transforming Your BeagleBone Black into a Media Server Media Management, Shares, and Social Activities Examples of Real-world Situations Getting Your Own Video and Feeds Building Your Media Player Illuminate Your Imagination with Your Own Projects Troubleshooting and Tricks to Improve Your Server Ideas to Improve Your Server Index

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.

How to know your webcam

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.

Installing MJPG-Streamer

Before installing MJPG-Streamer, we will install all the necessary dependencies:

debian@arm:~$ install subversion libjpeg8-dev imagemagick

Next, we will retrieve the code from the project:

debian@arm:~$ svn checkout http://svn.code.sf.net/p/mjpg-streamer/code/ mjpg-streamer-code

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:

  1. Create a database for Leed

  2. Download the project code and set permissions...

Summary


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...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Beaglebone Media Center
Published in: Jan 2015 Publisher: ISBN-13: 9781784399993
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}