Best codecs for video and how to encode

Encode your movies

Encode movies

Provided you're legally entitled to do so, getting your data off an optical disc and onto your streaming server or portable device isn't difficult. There are two stages.

The first decodes the disc and grabs the raw data from it, so you'll need the hardware required by your media. This step might be redundant if the source of your material is a legitimate unlocked download, or perhaps a recording from a digital television receiver or PC-based DVB card.

The second stage takes this raw data and runs it through the number crunching routines that generate the final file. Success on the first part depends on the protection used by the source disc. If there's none, then you'll be able to copy and encode your movies in a single step. If there's encryption, then you'll first need to remove this from the data before you can begin the transcoding stage.

Selling software that side-steps this protection is legally dubious, especially in the UK, but there are free tools available that will do the job, leaving you with either a copy of the DVD on your hard disk, or a new ISO burned to disk.

The best tool we've found for transcoding is called Handbrake. This is an open source application that harnesses the power of several free codecs, including FFMPEG, x264 and libtheora, and turns your video data into a file you can easily stream or move to a portable device. You don't even need to worry about the intricacies of codec configuration.

Handbrake includes a list of profiles you can use to quickly select the end device to load the best values into the codecs. These can be previewed and altered before you commit yourself to the final process.

Encoding a film, especially in high definition, can easily take several hours. But the length of time is dependent on the power of your system, so this might be a good time to upgrade that aging Core2Duo you're sitting at.

How to encode your movies with Handbrake

1. Select a source

HB step 1

We installed the the nightly build of Handbrake because it often has cutting edge features and speed improvement, but the official release is more stable. When you run it, you need to select the source location for your movie. After clicking in the 'Source' icon, select the optical drive, folder or file you want to convert.

2. Choose a profile

HB step 2

Once Handbrake has scanned for chapter information, select a preset for the destination format and choose a title from the source. If your presets don't include Android devices, choose 'Reset' from the Options menu. Handbrake defaults to the longest title, which is probably what you need unless you're after the outtakes.

3. Tweak presets

HB step 3

Adjust the video and audio encoding options to suit your own requirements (see the main text for some hints), and use the 'Picture' page to change the resolution, if required. You can use the 'Preview' window to generate a 10-second clip with your settings, then click 'Start' to generate the final file.

How to build the best media PC

CPU

Transcoding a video from one format to another takes a lot of CPU power, so a powerful machine will save you hours of waiting and, eventually, your sanity. But before you hand over your credit card details to your favourite retailer, you should first consider whether an upgrade is really necessary and how often you're likely to want to encode a movie.

Initially you'll want to transfer as much of your current collection as you still watch to your digital library. That's a big hurdle, but also a finite one. It might not be worth investing in the best hardware if it's only going to save you a couple of weeks of pain.

Your super video transcoding PC might become a costly white elephant whose resources you're unlikely to test again after an initial splurge. If you only buy a few movies a month, there's no real need to upgrade your hardware. Anything from the last five years will handle even a high definition movie overnight. That said, if you want an excuse to upgrade your machine, a big encoding job is the perfect opportunity.

Processor overheads

As with any upgrade, the best place to start is with the CPU. Most of the codecs we've mentioned use the free x264 library, which is widely considered to be one of the best available, regardless of price. It will use as much processing power as you throw at it, so the CPU question is easily answered with 'the best you can afford'.

If money is no limit, that means something sporting Intel's Sandy Bridge architecture, with its requirement for a LGA1155 CPU slot and memory accelerating potential of up to quad-speed DDR3-1333. We'd recommend the Intel Core i7 2600k, which can now be had for around £240. It has four cores and it's fast.

If you're looking for something a little cheaper, or a CPU that might not require a complete architecture overhaul, AMD's six-core Phenom II X6 Thuban represents great value for money for that amount of processing power, as it can now be bought for around £120.

Video encoding is also hungry for memory, so fit as much as either your motherboard or wallet can take. The more you add, the less your system will have to read either your slow optical drive, or the hard disk.

Unfortunately, graphics cards don't change the CPU equation, despite the promise of GPU-accelerated movie encoding. Modern graphics cards, and the APIs their vendors have built to access their raw number crunching abilities, have failed to offer the advantages that seemed imminent in 2008.

The current consensus on the encoding software that's able to shoe-horn a GPU into encoding duties is that the quality of the output just isn't good enough. As a result, CPU grinding is still the best route for the serious media collector.

The only good news is that this could save you a few pounds, because the latest Sandy Bridge Intel CPU's offer SoC - systems on a chip - and these include graphics. They might not be good enough for the latest games, but they're definitely good enough to show you what you're doing while you fine-tune your Handbrake codec parameters, and for playback.

It might also be worth investing in a screen capable of 1,920 x 1,080 if you want to check the encoding quality of your high definition material without moving it to your television.

Finally, for the hardware, don't forget to add an optical drive that can read your media. SATA II Blu-Ray players can be bought for as little as £50.

With your hardware sorted out, you just need to choose your operating system. There's nothing wrong with whatever version of Windows you've already got, but you will need the latest updates to version 7 for the modern chip designs and drivers, and a 64-bit installation is essential if you've got more than 4GB of RAM at your disposal.

Storage issues

Storage

There's no getting around the fact that movies take up a lot of space, which means your storage provision is just as important as the rest of your hardware. Capacity is probably the most important feature to consider, because you may be storing your entire collection on the same machine.

However, you don't need to store all your films on an internal drive. A portable remote drive attached to a PogoPlug is a great solution, as external drives are readily available with 2TB of space, for example, for about £60. Failing that, look for a NAS that offers streaming built-in.

For the internal drive, speed becomes a more important factor. The faster the drive, the more quickly your super-fast CPU will be able to crunch through the data. The fastest drives you can get are solid state, and while they're relatively limited in terms of storage capacity, as long as you're not planning to store the resulting files on the same drive, you won't encouter any problems. You can now get 120GB of SSD storage with a SATA II interface and a 3.5-inch form factor for £140.

Media playback hardware

The hardware you use to access your newly complied media collection is utterly dependent on the device it's being connected to. Our recommended storage solution is a Pogoplug, which is capable of streaming media using a wide variety of protocols. If you're playing your movies on an Android or iOS device, you can download a free app that can access your data through the cloud and stream content directly from your storage device, for example.

Unless you're happy connecting your laptop directly to your TV, you'll need a hardware streaming client. The premium version of Pogoplug, like many other streaming servers, can send video data using the UPnP protocol, and dozens of devices will be able to transform this into high definition video.

You might already have a suitable device sitting under your TV, because two of the most readily accessible devices are Microsoft's Xbox 360 and Sony's PlayStation 3 games consoles. If you do need a separate unit, we recommend investing in one of the latest Popcorn Hour boxes, which are quiet, simple to use and capable of playing virtually any codec you throw at them.