Before you start
This series was written with the developer in mind. You should be comfortable working with PHP and Web applications. You don't need to be an expert to go through this series, but not a lot of time will be spent explaining PHP syntax and Web application concepts. If you're unfamiliar with either, but keen to learn, feel free to dive right in. It wouldn't hurt to have some basic understanding of digital video, but we'll explain most of what you need to know.
Part 1 covers the putting together of the pieces, installing the components, dealing with video conversion, and preparing for the application. We lay out lot of groundwork here. There's a lot to learn about digital video, and we'll need to get set up for doing all the coding in Part 2.
In Part 2, you build a basic application to manage the uploaded files and the tagging. You'll be using a PHP framework — CakePHP to be exact — to help jump-start this process. The application won't be another video-sharing site. The focus will be on managing your own files and getting them up there for people to see.
In Part 3, you add some advanced features and create a slick user interface. We'll smooth out the UI and look at using APIs from popular video-sharing sites to disseminate your videos. If Part 1 is about getting up to speed, and Part 2 is about making it all work, then Part 3 is about making it awesome.
In Part 1 of a three-part series on creating an on-demand video site with PHP, we begin by looking at the different flavors of digital video and their particular nuances. When creating video for the Web, the overarching issue you need to keep in mind is whether you want your video to be small and easy to download or whether you want it to be the best quality possible. We'll also look at converting your video to the Flash Video (FLV) format and examine some options for streaming. There's not a lot of coding to be done at this stage, but we do have to get the framework installed and set up the database.
To work with digital video in this series, you'll need to set up a few things. (installation of basic components won't be covered here):
- Some digital video content — It can be video you've found, shot, or imported from another medium.
- A Microsoft® Windows® XP box — The examples provided use some software written for Windows XP.
- FFmpeg is an open source command-line video-conversion utility.
- Riva FLV Encoder V2.0 for Windows is a video-conversion utility that is no-cost for the first 30 days of use.
- Wikipedia for FLV-conversion programs for other platforms.
- Red5 is a Java™-based open source Flash server.
- JW FLV Media Player V3.15 is a small, embeddable Flash media player.
For the Web application, you'll also need:
- An HTTP server that supports sessions (and preferably
mod_rewrite) — This series was written using Apache V1.3 with
- The 1.2 beta version of CakePHP.
- PHP V5.1.4 or greater — Not all the frameworks being examined require this release level of PHP, but all frameworks will use the same PHP installation. This series was written using PHP V5.2.3.
- A reasonably recent version of MySQL — Several other database options are available and supported, but this series and the sample application were written using MySQL V5.0.37.
If you don't know anything about writing code, PHP, databases, etc., you will find this series challenging. You should get up to speed a little on writing Web applications in PHP first. (See Resources for links to each project.)