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

From DIYWiki
Jump to navigation Jump to search
(More WIP)
(Added comments from the group, new sections and moved networking stuff to a different article.)
 
(5 intermediate revisions by the same user not shown)
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.  
 
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.  
+
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 program 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:
+
Some might argue in these days of streaming platforms and "catch up" TV services, the PVR is no longer relevant. 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 high quality content even without a good internet connection and without a subscription to a streaming service.
Line 10: Line 10:
  
 
=== The DIY PVR project ===
 
=== 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?
+
This article is all about building a network aware PVR that can record live TV, and share the recordings all around your home. 
  
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.  
+
You might ask, 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 offer a less than optimal user experience (sometimes the result of digital rights management restrictions placed on the manufacturers by broadcasters and copyright holders). As a result it is often only possible to play back recorded content on the device that made the recording, and there may be no official 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.  
 +
 
 +
Note that there are some integrated TV Tuner / PVR solutions that may meet your PVR needs out of the box. Check the [[Integrated TV Tuners and Recorders]] article for details. 
  
 
==== The goals ====
 
==== 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.  
 
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
+
* The ability to record multiple programs concurrently
 
* To store them in common non encrypted video file formats
 
* 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.  
 
* To make them available by any TV or device on the home network with no restrictions.  
Line 42: Line 48:
 
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.
 
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.
+
The tiny (and very cheap) Raspberry Pi can also make a an effective PVR server. There is even a [https://www.raspberrypi.com/products/raspberry-pi-tv-hat/ Dedicated Pi TV tuner card] available now, which means it can act as the tuner as well.
  
 
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.
 
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.
Line 55: Line 61:
 
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.  
 
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 ==
+
== Hardware Selection ==
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.  
+
Deciding what hardware you need is a decision that can be driven from a number of different angles. It might be "What have I got spare?", and then "What can I get it to do?". Alternatively you might have a favoured software solution, and the question might become "What hardware do I need to run it?". It might even be "What can I afford?", and "What can I buy for that much?".  
  
=== Addresses ===
+
One of the advantages of a DIY solution is that you can get exactly what you want, but it may take some research (or following in others footsteps!) to select a good combination of hardware that works well as a system.
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.
+
== Setting it up ==
  
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".  
+
=== Sort out network addresses ===
 +
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. One thing that you can do when setting up your PVR to make it easier to configure and operate is to use [[Networking#Network Addressing|Static IP Addresses]] for all the "server" type parts of the network like the TV Tuner and network storage device.  
  
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.  
+
=== Installing PVR software ===
 +
Once you have your devices setup, you are ready to start installing the PVR software. For network appliances like NAS boxes, this is often as easy as going to the management page and choosing the software from the Apps store.  
  
Setting a Static IP via DHCP
+
E.g. install Plex on a Netgear ReadyNAS:
  
=== Installing PVR software ===
+
[[image:InstallingPlexNetgear.png|512px]]
 +
 
 +
 
 +
Installing Plex on a QNAP NAS
 +
 
 +
[[image:InstallingPlexQnap.png|512px]]
  
 
== Building a system ==
 
== Building a system ==
Line 77: Line 89:
 
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.  
 
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.  
+
The goal here is:
 +
 
 +
* Easy to setup  
 +
* Use intermediate level hardware to give good performance
 +
* Have low running costs.
 +
 
 +
==== About Plex ====
 +
Plex is a very versatile media management tool. It can search for and catalogue your entire music, video, and photo collection for you. Presenting it all in an attractive format with added meta data. So not only can you see your movie, but also see the cover art, a synopsis, a list of the cast and links to other media you may have with the same actors. Your albums can be catalogued by artist or by title (and many other ways), and you have full track lists. In addition to all this it can also integrate with network TV tuners to provide a capability to watch live TV on any network device, and schedule recordings, and let you playback existing recordings. 
 +
 
 +
(Note although Plex is free for general use, to enable the facilities for TV recording and access to the online electronic program guides you will need a "plex pass" subscription. This can either be a per month / year subscription or a one off "lifetime" pass)
 +
 
 +
==== The setup process ====
 +
Configure TV tuner. At its simplest this just means connecting it up to an aerial and your network and giving it an IP address.
 +
 
 +
Next configure your NAS device. Chances are you will be using this for other things like share network file stores and not just a PVR, but the setup process will normally be similar: set its IP address, give it a network name, and change the default admin password.
 +
 
 +
Next you can create some shared folders for your stuff and your recordings.
 +
 
 +
Then go to the apps page and download Plex follow the prompts to install that.
 +
 
 +
Lastly you can now access the Plex page on the NAS using a web browser on your computer or phone. Go into the Settings page, and then the Live TV and PVR section. Now you can add a TV tuner, and have it scan the available channels.
 +
 
 +
[[image:PlexTunerSetup.png|512px|link=Special:FilePath/PlexTunerSetup.png]]
 +
 
 +
==== What you get ====
 +
Once Plex is up and running, you can point it at you collections of video and music (either things you have downloaded or ripped from your own CD and DVD collection, or stuff you have recorded). It will then set about indexing it all, and finding meta data to go with it. It can be surprisingly good at identifying what each file represents - getting details for a film from its file name and length, and for your music from other clues like the track lengths and the name of the folder they are in. 
 +
 
 +
Plex showing a list of Movies: 
 +
 
 +
[[image:PlexFilmLibrary.png|512px|link=Special:FilePath/PlexFilmLibrary.png]] 
 +
 
 +
Click on movie for more detailed information: 
 +
 
 +
[[image:PlexMovieDetailPage.png|512px|link=Special:FilePath/PlexMovieDetailPage.png]] 
 +
 
 +
(Note all I did here was place a rip of my DVD in a network movies folder - plex got all the rest itself). 
 +
 
 +
Have a look at the music collection: 
 +
 
 +
[[image:PlexMusicArtistByTitle.jpg|512px]] 
 +
 
 +
Click on an artist: 
 +
 
 +
[[image:PlexEloTopPage.png|512px|link=Special:FilePath/PlexEloTopPage.png]] 
 +
 
 +
Then an album: 
 +
 
 +
[[image:PlexEloOOTBAlbum.png|512px|link=Special:FilePath/PlexEloOOTBAlbum.png]]   
 +
 
 +
What about watching live TV or setting up a recording: 
 +
 
 +
Browse what is on as an overview: 
 +
 
 +
[[image:PlexDVRCategoryGuide.jpg|512px]] 
 +
 
 +
Or as a program guide: 
 +
 
 +
[[image:PlexDVRGridGuide.jpg|512px]]
 +
 
 +
See something you want to record? Click on it and tell it whether you want a one off recording or the whole series:
  
 +
[[image:PlexDVRRecordSeries.jpg|512px]]
  
 +
==== Watching and Listening ====
 +
Now using any computer I can navigate directly to my recordings folder and watch a recording or any other media. I can also use the Plex client software on any smart TV to watch or listen to programs. The client can also "cast" playback to other devices on the network, say using a mobile phone to browse and select tracks, but having them played back on the HiFi or in the garden.
  
Work in progress - ignore for now!
+
=== Example system 2 ===
 +
A system with lower hardware requirements, implemented using [https://xbian.org/ XBian] running on a Raspberry Pi 4 with a USB based DVB-T2 tuner, and running [https://tvheadend.org/ TVHeadend]
  
[[image:PlexDVRGridGuide.jpg]]
+
[[Category:Computing]]
[[image:PlexDVRCategoryGuide.jpg]]
+
[[Category:Projects]]
[[image:PlexDVRRecordSeries.jpg]]
+
[[Category:Software]]
[[image:PlexServerCPULoadHDPlayback.jpg]]
+
[[Category:TV]]

Latest revision as of 17:29, 9 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 program 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 PVR is no longer relevant. 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

This article is all about building a network aware PVR that can record live TV, and share the recordings all around your home.

You might ask, 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 offer a less than optimal user experience (sometimes the result of digital rights management restrictions placed on the manufacturers by broadcasters and copyright holders). As a result it is often only possible to play back recorded content on the device that made the recording, and there may be no official 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.

Note that there are some integrated TV Tuner / PVR solutions that may meet your PVR needs out of the box. Check the Integrated TV Tuners and Recorders article for details.

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 programs 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. There is even a Dedicated Pi TV tuner card available now, which means it can act as the tuner as well.

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.

Hardware Selection

Deciding what hardware you need is a decision that can be driven from a number of different angles. It might be "What have I got spare?", and then "What can I get it to do?". Alternatively you might have a favoured software solution, and the question might become "What hardware do I need to run it?". It might even be "What can I afford?", and "What can I buy for that much?".

One of the advantages of a DIY solution is that you can get exactly what you want, but it may take some research (or following in others footsteps!) to select a good combination of hardware that works well as a system.

Setting it up

Sort out network addresses

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. One thing that you can do when setting up your PVR to make it easier to configure and operate is to use Static IP Addresses for all the "server" type parts of the network like the TV Tuner and network storage device.

Installing PVR software

Once you have your devices setup, you are ready to start installing the PVR software. For network appliances like NAS boxes, this is often as easy as going to the management page and choosing the software from the Apps store.

E.g. install Plex on a Netgear ReadyNAS:

InstallingPlexNetgear.png


Installing Plex on a QNAP NAS

InstallingPlexQnap.png

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:

  • Easy to setup
  • Use intermediate level hardware to give good performance
  • Have low running costs.

About Plex

Plex is a very versatile media management tool. It can search for and catalogue your entire music, video, and photo collection for you. Presenting it all in an attractive format with added meta data. So not only can you see your movie, but also see the cover art, a synopsis, a list of the cast and links to other media you may have with the same actors. Your albums can be catalogued by artist or by title (and many other ways), and you have full track lists. In addition to all this it can also integrate with network TV tuners to provide a capability to watch live TV on any network device, and schedule recordings, and let you playback existing recordings.

(Note although Plex is free for general use, to enable the facilities for TV recording and access to the online electronic program guides you will need a "plex pass" subscription. This can either be a per month / year subscription or a one off "lifetime" pass)

The setup process

Configure TV tuner. At its simplest this just means connecting it up to an aerial and your network and giving it an IP address.

Next configure your NAS device. Chances are you will be using this for other things like share network file stores and not just a PVR, but the setup process will normally be similar: set its IP address, give it a network name, and change the default admin password.

Next you can create some shared folders for your stuff and your recordings.

Then go to the apps page and download Plex follow the prompts to install that.

Lastly you can now access the Plex page on the NAS using a web browser on your computer or phone. Go into the Settings page, and then the Live TV and PVR section. Now you can add a TV tuner, and have it scan the available channels.

PlexTunerSetup.png

What you get

Once Plex is up and running, you can point it at you collections of video and music (either things you have downloaded or ripped from your own CD and DVD collection, or stuff you have recorded). It will then set about indexing it all, and finding meta data to go with it. It can be surprisingly good at identifying what each file represents - getting details for a film from its file name and length, and for your music from other clues like the track lengths and the name of the folder they are in.

Plex showing a list of Movies:

PlexFilmLibrary.png

Click on movie for more detailed information:

PlexMovieDetailPage.png

(Note all I did here was place a rip of my DVD in a network movies folder - plex got all the rest itself).

Have a look at the music collection:

PlexMusicArtistByTitle.jpg

Click on an artist:

PlexEloTopPage.png

Then an album:

PlexEloOOTBAlbum.png

What about watching live TV or setting up a recording:

Browse what is on as an overview:

PlexDVRCategoryGuide.jpg

Or as a program guide:

PlexDVRGridGuide.jpg

See something you want to record? Click on it and tell it whether you want a one off recording or the whole series:

PlexDVRRecordSeries.jpg

Watching and Listening

Now using any computer I can navigate directly to my recordings folder and watch a recording or any other media. I can also use the Plex client software on any smart TV to watch or listen to programs. The client can also "cast" playback to other devices on the network, say using a mobile phone to browse and select tracks, but having them played back on the HiFi or in the garden.

Example system 2

A system with lower hardware requirements, implemented using XBian running on a Raspberry Pi 4 with a USB based DVB-T2 tuner, and running TVHeadend