Categories
Uncategorized

Over The Air (OTA) US Broadcast TV from anywhere

Background

In the middle of the summer of 23′, my wife reminded me that we were paying too much for a basic TV package and she was right. As a techie, I needed an internet package with plenty of bandwidth so I opted for the fastest my ISP provided. I also am interested in current affairs, so wanted a way to watch the local news broadcast on my TVs and mobile devices. I needed a package that included high speed internet, basic local TV channels and a way to watch them on my tablets and phones so that I could watch local news. The company offered a plan at the time with a maximum speed of 400 Mbps download and 20 Mbps upload. The basic TV package included the local channels I was looking for and about twenty to thirty other “cable” channels. The extra channels were nice but not needed and were almost always underutilized. The local cable provider also had a stipulation that I needed to rent at least one cable box, to get IPTV (cable on my mobile devices). After it was all said and done, my regular bill with Taxes, fees and surcharges was approximately $116. This was OK, until it wasn’t. Over time this price eventually increased to a monthly amount of $170.

Lets save some money

The company did not have a way to reduce the price without making serious sacrifices. They said that I could either remove the cable TV service, downgrade internet access or remove internet entirely. In my opinion, neither option was reasonable. I recalled watching a video of someone describing how to setup a system where you could capture the Over the Air (OTA) signal from TV stations and be able to view these broadcasts on your local network. After much searching, I not only found the video that inspired me; but also, discovered additional resources that when combined, allowed me to setup my own Over the Air TV capture and replay system for all of my devices and TVs. As a bonus, it also included DVR functionality.

Video review: Raspberry Pi Multicast TV server

Then I found it, the video that inspired me by Tall Paul Tech. The title of this video should have been called: Configuring DVBlast for two channels on a new Raspberry Pi installation in Brisbane, Australia. This video demonstrates how to configure both a new Raspberry Pi installation with a DVB TV Tuner and use DVBlast to connect to one of two stations in Brisbane, Australia. This required that you can pick up a terrestrial TV broadcast from that city. While this video was very informative, it required you to perform additional research elsewhere, if you wanted to follow along. Below I will highlight the items that were and were not covered:

  • Prerequisites (not covered):
    • Hardware:
      • AverMedia USB DVB TV Tuner
      • Raspberry Pi 2 Model B or greater.
      • Windows PC
      • SDHC card reader
      • Empty SDHC card
      • 5V, 2.5A Micro USB power supply
      • Ethernet cable (either a category 5, 5e, 6 or 6a cable)
      • Home network or router with a running DHCP server
      • Available port on your router
    • Software:
      • Port scanning software
      • Putty
      • SD Card Formatter
      • Win32 Disk Imager
      • Raspbian Image file
    • Network:
      • Free port on your Network Switch or Router.
      • DHCP Server running on your network.
  • Preparing a new Raspberry Pi image on your SDHC card
    • formatting a memory card with SD Card Formatter
    • why use SD Card Formatter and not windows (not covered)
    • adding the Raspbian image to the SDHC card
    • Configuring SSH on first boot (not covered)
  • Connect and power up your Pi
    • Plug in SDHC card
    • plug in your Ethernet cable to the Pi
    • plug in your Ethernet cable to a free port on your network
    • connect your 5V, 2.5A Micro USB power supply to the Pi
    • connect your 5V, 2.5A Micro USB power supply to an outlet/mains (not covered).
  • Identify your Pi’s IP address (not covered)
  • Configure your Pi 1:14
    • SSH to your Pis IP address
    • accept ssh cert
    • default pw raspberry @ 1:30
    • sudo rasbi-config @ 1:34
    • expands filesystem
    • Change User Password, optional 1:43
    • Says to change pw if you want 1:43
    • look at boot options 1:48
    • look at country and time zone settings 1:55
    • adds a hostname 2:08
    • reboot 2:22
  • Installing a USB DVB TV Tuner 2:31
    • begin setup of specifics for tv server
    • connects antenna to avermedia tuner
    • connects tuner to USB port on the Pi 2:39
    • ssh into pi 2:50
    • look for card with command with grep
    • Identified missing firmware error
    • copies firmware from another box to TV server
    • copies to exact location
    • reboot
  • Determine if the USB TV Tuner driver is installed properly
    • Ssh to box
    • look for device, shows no error
  • Update Operating System
    • Updates system 4:35
  • Install dvb Apps
    • install dvblast program for streaming dvb multicast
    • sudo apt-get install dvb-apps
    • Has utilities to perform dvb-type activities, ex: scan for channels.
  • Install dvblast
    • scan area for what’s available
    • Look in directory for x with parameter
    • see cities with lots of parameters 5:45
    • Says he is in Brisbane 5:54
    • opens a file showing frequency being broadcast and parameters it uses to scan
    • uses scan command 6:22
    • shows a final output of a bunch of parameters 7:00
    • identifies a channel to target 7:05
    • shows how to scan and output to a file 7:34
    • makes config file for dvblast to use and two channels 7:55
    • re-review config file 8:02
    • identified pid and frequency
    • creates config file for one channel 8:25
    • syntax is: multicast group, 1 then the PID
    • created a simple config file for dvblast, for two channels 9:04
    • showed command to run dvblast config file
    • syntax: dvblast -a X(adapter) -f Y(frequency) -c Z(configuration file) -m A(modulation) -b C(bandwidth) -e (no variable, udp data) 9:29
    • Runs the config, puts UDP data on the network 9:47
  • Connecting to the Stream
    • begins a test with VLC 9:58
    • open stream and add rtp://ipaddress:multicast_group
    • click play
    • VLC will show the title of the TV Program
    • to change channels, open stream and change the multicast group 10:19
  • Brief discussion of multicast
    • must ensure the network can handle multicast, offers to explain this in another video 10:31
    • talks a little about multicast group, gateway and route 10:41
    • must have a gateway added in order for multicast to leave the device 11:00
  • Shows LCDs attached to pis, reporting channels and frequencies 11:29

After watching this video I realized that while it was useful, it left many gaps of knowledge. Some I knew and others I didn’t. Some things I would have to continue researching are:

  • What equipment do I need, to set this up?
  • How to identify your Pi’s IP address?
  • What is DVB?
  • Does this work for the US?
  • I did not see any mention of ATSC, isn’t that was US uses?
  • How to enable SSH on first boot up?

I also felt that this was not the right video for me after the geographic location of the narrator was confirmed a few times throughout the video. For example at 5:54 he says he is in Brisbane and at 9:43 the narrator say it was a config for Australia. Neither place had anything to do with the US.

Video review: Raspberry Pi Multicast TV server – Part 2

Tall Paul Tech created a followup performance test video. This short video quickly demonstrated:

  • what would happen if you kept adding TV tuners to a Raspberry Pi
  • a single computer with fourteen VLC windows running different TV channels
  • LibreNMS monitoring traffic from all the Raspberry Pis.

I’ll save you some time, the raspberry Pi that was used, eventually fails to load. While it was good to know that the Raspberry Pi’s have a limit for simultaneous TV tuners, I did not care much for that and was more interested in the final product. I was looking for a way to broadcast a TV stream from a server on my network and watch the TV stream with a video player on a client computer. This video was demonstrating exactly what I wanted. Based on the prior video, it looked like I would have to have a complex back-end setup with lots of configs for all the various channels. I was not looking forward to this level of complexity.

Blog review: Stream TV from your Raspberry Pi with Tvheadend

This blog post from PiMyLifeUp claims to show you how to stream TV from your Raspberry Pi. Right away I can see that it has a DVB USB TV tuner adapter plugged in. From two out of two videos and I can see that DVB may be very important in this journey. I used this video for most of my config but that one gave me a bunch of other questions, especially as I finished that project, such as:

  • How do I playback a .TS file?
  • Is this the server or the client?
  • Is this a US solution?

Vendor Post: Running WinTV TV tuners and HD PVR 2 under Linux

This excellent post from Vendor Hauppauge, walks you through adding TV viewing abilities on an Ubuntu desktop. The video clip has text: DVB-S2. At 8:32 in the video, it shows you how to scan for ATSC TV channels. This video also lead me to believe that DVB must be important in the US.

  • What is DVB and why is it on all of these videos?
    • DVB is a non-US standard. It is listed in these videos as this is the primary standard outside of the US.
  • Is DVB available in the US?

Forum Post: Recommendation for ATSC TV tuner that works out of the box with PI4?

Another good link to a forum lead me to a solution posted 12/20/2020 that references installing a TVHeadEnd Server. The post was specific to providing an ATSC TV tuning solution for LibreELEC. While this was getting close to what I wanted, I did not want to be tied to a particular Operating System such as LibreELEC but it was nice to know that there was a solution out there, if I wanted one. I also was not planning to run LibreELEC at all. For me, the most important part of this were text and links that mentioned: TVHeadEnd. Now I had to do some additional research:

  • What is TVHeadEnd?

DVB

Founded in 1993, the DVB Project is an industry-led consortium of the world’s leading media and technology companies working together to design open technical specifications for digital media delivery.

https://dvb.org/about/

That was great, but does the US, use DVB for broadcast digital media? After digging around this official looking page, I clicked on a link labeled History and found the following facts:

Europe and European were mentioned ten times.

Planning for DVB began in 1991 and various working parties came together to a “a group that would oversee the development of digital television in Europe,” the European Launching Group (ELG). This group “…drafted the Memorandum of Understanding (MoU) establishing the rules by which this new and challenging game of collective action would be played.”

In 1992 a separate group named the “Working Group on Digital Television Broadcasting (WGDTB), put together a “highly respected report” to the ELG with concepts and proposal that were relevant for several different consumer markets.

In 1993, the MoU was signed and the ELG was renamed: “…the Digital Video Broadcasting Project (DVB).” Standards were later developed and used such as: 1994: DVB-S in France, 1998: DVB-T in Sweden and the UK, 2002: DVB-T in parts of Germany and in 2003 “…Europe’s first analogue switch off in Berlin.”

In 1997 the DVB Project promoted “…its open standards globally” and later the “…DVB standards were adopted worldwide.”

https://dvb.org/about/history/

While the word: “worldwide” was used, it is not clear if that include the US, can I see a map of where these standards were adopted? Yes. While the official DVB pages were very informative and they mentioned worldwide adoption, it was clear with the map that DVB does not have anything to do with the US. Great, one puzzle down. Now when I search for TV tuners, I can ignore all of the ones that mention any form of DVB.

ATSC

This is the standard used in America for digital television transmission over terrestrial, cable and satellite networks. Source.

.TS files

A TS file is a Video Transport Stream file that stores video data. It’s compressed with MPEG-2 video compression. Read here for more information.

MPEG-2

is a standard for “the generic coding of moving pictures and associated audio information. –Source.

Stream live TV from a Raspberry Pi to any device inside your network in the US.

Here is where I work my magic and give you the A-Z. By the end of this article, you will be able to setup a server that will capture terrestrial TV stations and either play them on the network or enable you to record them like a PVR.

  • Prerequisites:
    • Hardware
      • A computer with Windows installed (technician PC)
      • AverMedia USB DVB TV Tuner
      • Raspberry Pi 2 Model B or greater.
      • Windows PC
      • SDHC card reader
      • Empty SDHC card
      • 5V, 2.5A Micro USB power supply
      • Ethernet cable (either a category 5, 5e, 6 or 6a cable)
      • Home network or router with a running DHCP server
      • Available port on your router
    • Software
  • Configure your Technician PC
    • Install software
      • 7-Zip
      • Angry IP Scanner
      • Putty
      • SD Card Formatter
      • Win32 Disk Imager
    • Connect hardware
      • Connect the SDHC card reader to the PC
    • Extract the Raspberry PI OS Image file
      • Open the folder where you downloaded the Raspberry PI OS compressed file.
      • Look for a file ending in .xz
      • Right click the file and select the option to Extract here
      • After the extraction is complete, you should have a file ending in .img
    • Prepare to write to your SDHC card
      • Plug the SDHC card into the SHDC card reader
      • Launch the Application, SD Card Formatter
      • Format the SDHC card
      • Safely remove the SDHC card from the computer
      • Plug the SDHC card back into the SHDC card reader
    • Burn the Raspberry PI OS Image file onto the Card
      • Launch the software, Win32 Disk Imager
      • Select Image
      • Browse your computer for the .img file
      • Click image
    • Setup SSH on first boot
      • Open the application, Explorer
      • Open the SDHC card
      • create a new text document called SSH.txt
      • Save this file to the SDHC card
      • Safely remove the SDHC card
    • Put the Raspberry Pi together
      • insert the SDHC card into the raspberry Pi
      • connect the ethernet cable to your network
      • connect the ethernet cable to your Pi
      • connect the power adapter to your Raspberry Pi
      • connect the power adapter to an outlet
    • Identify the IP address of the Pi
      • Ensure that your Technician PC is on the same network as the Raspberry Pi
      • your Technician PC, ;aunch the software, Angry IP Scanner
      • Scan your network for the Raspberry Pi
      • Identify the Raspberry Pi with MAC Address ending in …
    • SSH into your Rapsberry Pi
      • Launch the Putty app
      • Type in the IP address of your Pi
      • select option…
      • Click Connect