Difference between revisions of "DIY Personal Video Recorder (PVR)"

From DIYWiki
Jump to navigation Jump to search
(More WIP)
Line 1: Line 1:
 +
Home based video recording of TV broadcasts revolutionised the way in which people could watch television, no longer being restricted to watching programs at set times, and being able to view programs broadcast simultaneously on different channels.
 +
 +
The digital PVR took these freedoms and elevated them to new levels of usability and convenience, being able to intelligently record multiple programs at once, and automatically record linked programs and series with one instruction from the user. All directed from detailed digital programme guides. Commercial devices made famous by Humax and Topfield made digital TV recording easy and user friendly.
 +
 +
Some might argue in these days of streaming platforms and "catch up" TV services, the days of the PVR are numbered as they lose relevance. However there are a number of key benefits you get with a PVR that you don't get with streaming services:
 +
 +
* The ability to record high quality content even without a good internet connection and without a subscription to a streaming service.
 +
* The ability to record programs from the many TV channels that don't have catch up services
 +
* Long term access to recorded content that is not "withdrawn" at the whim of the streaming service.
 +
 +
=== The DIY PVR project ===
 +
So if you can buy a digital TV recorder "off the shelf" why go to the bother of a DIY solution?
 +
 +
The answer is that many of the COTS options are less than optimal. This is frequently the result of digital rights management restrictions placed on the manufacturers of the devices by the content production "industry" and broadcasters. As a result it is often only possible to play back recorded content on the device that made the recording, and there if often no facility to copy recorded programs from the recorder for longer term archival or for making those recordings available to multiple devices on a home network. Most commercial solutions can usually only record a maximum of two programs at once, which may seem restrictive with the hundreds now available.
 +
 +
==== The goals ====
 +
This article will discuss ways to implement your own PVR platform that can do all the things the commercial products do, but also add some very nice to have extra capabilities.
 +
 +
* The ability to record multiple programmes concurrently
 +
* To store them in common non encrypted video file formats
 +
* To make them available by any TV or device on the home network with no restrictions.
 +
* Be driven from a full featured digital program guide that also allows rich additional media content to be added to each recording.
 +
* Make it easy to have near unlimited storage for content if required.
 +
* Optionally make recorded content available to you from anywhere in the world when away from home
 +
 +
=== Getting started - what you will need ===
 +
The foundation for a DIY PVR is a network TV tuner. Typically this is a small box that contains a number of TV tuners (typically 2 or 4), and local processing power to present the digital TV streams in real time on a TCP/IP based network. Many of these will allow live TV to be watched in a web browser, and may also come bundled with software that can record TV and do other tricks.
 +
 +
In addition we will need something to act as a storage server - providing the storage space to hold the programs we record, and the capability to run the server software required to make the platform function as a usable service.
 +
 +
Lastly we need client devices - i.e. something to watch the recordings on. This might be a computer, tablet, phone or smart TV, but might also include an older "dumb" TV or computer monitor.
 +
 +
==== TV Tuners ====
 +
Popular tuners for this application are the HDHomeRun devices from SiliiconDust, and the various Win TV tuners from Hauppauge
 +
 +
==== Servers ====
 +
The term server, really means two things in this context. Something with lots of spare disk space, and something to run our PVR software. The server may play back recordings directly to a locally connected screen, but will more typically make them available to clients on the network, which will either access the server via a web interface, or using bespoke client software.
 +
 +
===== Hardware =====
 +
Many of the better Network Attached Storage devices (NAS) from the likes of Netgear, QNAP, Synology etc already have a number of suitable server applications already available and ready to download and install.
 +
 +
You could also use and old PC or laptop, however note that the ideal server will be something that has very low power consumption since this will likely be left running long term.
 +
 +
The tiny (and very cheap) Raspberry Pi can also make a an effective PVR server.
 +
 +
For storage, the ubiquitous Hard Disk Drive (HDD) is ideal here, it's plenty fast enough, and can offer loads of storage at a low cost. This is one of the few applications where there a not that many advantages for using modern Solid State Disk (SSD) drives, since the price per GB is higher. However there may be some cases where the reduced power consumption and silent operation could make them attractive.
 +
 +
===== Software =====
 +
There are a number of popular platforms for this job. Many are derived from the open sauce Xbox Media Media Centre (XBMC), and include applications like Plex, and Kodi.
 +
 +
==== Clients ====
 +
Clients can include anything that can run a web browser capable of displaying video, a smart TV (or a [[Digital TV|SMART TV add on dongle]])
 +
 +
==== One Box Solution ====
 +
You can also get TV tuners as an expansion card or on a USB device to add a tuner to your PC. Mac, or Linux computer. This then also raises the possibility of implementing all the parts of the PVR in one box.
 +
 +
== Network Basics ==
 +
In the majority of cases our PVR will be implemented to run on a home network, that will usually consist of a network router connected to the internet, and then a number of other devices that can run our PVR server and clients. There are a couple of basic principles that can use when setting up your PVR to make it easier to setup and operate.
 +
 +
=== Addresses ===
 +
All of the computers, phones, tablets, and smart TVs and other devices on your network need a unique network address to be able to function properly. For normal home networks there is no need to give this any consideration due to the marvels of what it called the Dynamic Host Configuration Protocol (DHCP). Every time a device powers up and connects to the network, it will simply broadcast a message to every other device on the network with a DHCP request for an address, hoping there is a DHCP server listening that will be able to help. Normally this will be running on your internet router. It will look to see what addresses it has been told it is allowed to hand out, and will give out the next free address. It will keep a note of the addresses it has allocated so that it does not hand out the same one again (you must never have one network address used by more than one device at a time).
 +
 +
Addresses are typically handed out with a "lease" time on them, meaning that the device using it can only have it for a certain amount of time (this might be a number of hours, or a few days - but 1 day is typical), after that time the device will need to ask the router to renew the lease if it still needs it. That way when a device drops off the network, the router can reclaim the address once it's lease has expired and use it again.
 +
 +
This behaviour is all fine and dandy for network devices that are "consumers" of services - e.g. those that visiting web pages or stream music or video. It's not so well suited for devices that are servers. For servers, it is better to allocate a fixed network address to the device. That way all the client devices can be told where to find it, and know that it will always be at the same address regardless of what other devices are on the network, and which order they powered up in. This type of address is known as a "Static IP address".
 +
 +
Allocating a Static IP addresses to a server is usually fairly simple, but it does take a bit of planning. There two basic ways of doing this. The first is (possibly counter intuitively) using DHCP, and the second is to do it manually.
 +
 +
Setting a Static IP via DHCP
 +
 +
=== Installing PVR software ===
 +
 +
== Building a system ==
 +
Please note that there is no "one right way" to do this. There are a huge range of possibilities, so you can build a system that works exactly the way you want and within your budget. Note that some options are very easy to setup, and some will need a bit more tinkering.
 +
 +
=== Example system 1 ===
 +
In this example we will discuss building an implementation of a PVR using a [https://www.silicondust.com/hdhomerun/ SiliconDust HDHomeRun] duo TV tuner, and a [https://www.qnap.com/en-uk/product/series/home QNAP NAS] as the server running [https://www.plex.tv/ Plex] as the software platform.
 +
 +
The goal here is ease of setup using intermediate level hardware, and low running costs.
 +
 +
 +
 
Work in progress - ignore for now!
 
Work in progress - ignore for now!
  

Revision as of 13:04, 7 November 2021

Home based video recording of TV broadcasts revolutionised the way in which people could watch television, no longer being restricted to watching programs at set times, and being able to view programs broadcast simultaneously on different channels.

The digital PVR took these freedoms and elevated them to new levels of usability and convenience, being able to intelligently record multiple programs at once, and automatically record linked programs and series with one instruction from the user. All directed from detailed digital programme guides. Commercial devices made famous by Humax and Topfield made digital TV recording easy and user friendly.

Some might argue in these days of streaming platforms and "catch up" TV services, the days of the PVR are numbered as they lose relevance. However there are a number of key benefits you get with a PVR that you don't get with streaming services:

  • The ability to record high quality content even without a good internet connection and without a subscription to a streaming service.
  • The ability to record programs from the many TV channels that don't have catch up services
  • Long term access to recorded content that is not "withdrawn" at the whim of the streaming service.

The DIY PVR project

So if you can buy a digital TV recorder "off the shelf" why go to the bother of a DIY solution?

The answer is that many of the COTS options are less than optimal. This is frequently the result of digital rights management restrictions placed on the manufacturers of the devices by the content production "industry" and broadcasters. As a result it is often only possible to play back recorded content on the device that made the recording, and there if often no facility to copy recorded programs from the recorder for longer term archival or for making those recordings available to multiple devices on a home network. Most commercial solutions can usually only record a maximum of two programs at once, which may seem restrictive with the hundreds now available.

The goals

This article will discuss ways to implement your own PVR platform that can do all the things the commercial products do, but also add some very nice to have extra capabilities.

  • The ability to record multiple programmes concurrently
  • To store them in common non encrypted video file formats
  • To make them available by any TV or device on the home network with no restrictions.
  • Be driven from a full featured digital program guide that also allows rich additional media content to be added to each recording.
  • Make it easy to have near unlimited storage for content if required.
  • Optionally make recorded content available to you from anywhere in the world when away from home

Getting started - what you will need

The foundation for a DIY PVR is a network TV tuner. Typically this is a small box that contains a number of TV tuners (typically 2 or 4), and local processing power to present the digital TV streams in real time on a TCP/IP based network. Many of these will allow live TV to be watched in a web browser, and may also come bundled with software that can record TV and do other tricks.

In addition we will need something to act as a storage server - providing the storage space to hold the programs we record, and the capability to run the server software required to make the platform function as a usable service.

Lastly we need client devices - i.e. something to watch the recordings on. This might be a computer, tablet, phone or smart TV, but might also include an older "dumb" TV or computer monitor.

TV Tuners

Popular tuners for this application are the HDHomeRun devices from SiliiconDust, and the various Win TV tuners from Hauppauge

Servers

The term server, really means two things in this context. Something with lots of spare disk space, and something to run our PVR software. The server may play back recordings directly to a locally connected screen, but will more typically make them available to clients on the network, which will either access the server via a web interface, or using bespoke client software.

Hardware

Many of the better Network Attached Storage devices (NAS) from the likes of Netgear, QNAP, Synology etc already have a number of suitable server applications already available and ready to download and install.

You could also use and old PC or laptop, however note that the ideal server will be something that has very low power consumption since this will likely be left running long term.

The tiny (and very cheap) Raspberry Pi can also make a an effective PVR server.

For storage, the ubiquitous Hard Disk Drive (HDD) is ideal here, it's plenty fast enough, and can offer loads of storage at a low cost. This is one of the few applications where there a not that many advantages for using modern Solid State Disk (SSD) drives, since the price per GB is higher. However there may be some cases where the reduced power consumption and silent operation could make them attractive.

Software

There are a number of popular platforms for this job. Many are derived from the open sauce Xbox Media Media Centre (XBMC), and include applications like Plex, and Kodi.

Clients

Clients can include anything that can run a web browser capable of displaying video, a smart TV (or a SMART TV add on dongle)

One Box Solution

You can also get TV tuners as an expansion card or on a USB device to add a tuner to your PC. Mac, or Linux computer. This then also raises the possibility of implementing all the parts of the PVR in one box.

Network Basics

In the majority of cases our PVR will be implemented to run on a home network, that will usually consist of a network router connected to the internet, and then a number of other devices that can run our PVR server and clients. There are a couple of basic principles that can use when setting up your PVR to make it easier to setup and operate.

Addresses

All of the computers, phones, tablets, and smart TVs and other devices on your network need a unique network address to be able to function properly. For normal home networks there is no need to give this any consideration due to the marvels of what it called the Dynamic Host Configuration Protocol (DHCP). Every time a device powers up and connects to the network, it will simply broadcast a message to every other device on the network with a DHCP request for an address, hoping there is a DHCP server listening that will be able to help. Normally this will be running on your internet router. It will look to see what addresses it has been told it is allowed to hand out, and will give out the next free address. It will keep a note of the addresses it has allocated so that it does not hand out the same one again (you must never have one network address used by more than one device at a time).

Addresses are typically handed out with a "lease" time on them, meaning that the device using it can only have it for a certain amount of time (this might be a number of hours, or a few days - but 1 day is typical), after that time the device will need to ask the router to renew the lease if it still needs it. That way when a device drops off the network, the router can reclaim the address once it's lease has expired and use it again.

This behaviour is all fine and dandy for network devices that are "consumers" of services - e.g. those that visiting web pages or stream music or video. It's not so well suited for devices that are servers. For servers, it is better to allocate a fixed network address to the device. That way all the client devices can be told where to find it, and know that it will always be at the same address regardless of what other devices are on the network, and which order they powered up in. This type of address is known as a "Static IP address".

Allocating a Static IP addresses to a server is usually fairly simple, but it does take a bit of planning. There two basic ways of doing this. The first is (possibly counter intuitively) using DHCP, and the second is to do it manually.

Setting a Static IP via DHCP

Installing PVR software

Building a system

Please note that there is no "one right way" to do this. There are a huge range of possibilities, so you can build a system that works exactly the way you want and within your budget. Note that some options are very easy to setup, and some will need a bit more tinkering.

Example system 1

In this example we will discuss building an implementation of a PVR using a SiliconDust HDHomeRun duo TV tuner, and a QNAP NAS as the server running Plex as the software platform.

The goal here is ease of setup using intermediate level hardware, and low running costs.


Work in progress - ignore for now!

PlexDVRGridGuide.jpg PlexDVRCategoryGuide.jpg PlexDVRRecordSeries.jpg PlexServerCPULoadHDPlayback.jpg