TV Fool  

Go Back   TV Fool > Over The Air Services > Enthusiast's Exchange

Notices

Reply
 
Thread Tools
Old 20-Jul-2019, 5:09 PM   #1
GroundUrMast
Moderator
 
GroundUrMast's Avatar
 
Join Date: Oct 2010
Location: Greater Seattle Area
Posts: 4,773
Streaming Live HD TV over the Internet

My interest in extending TV reception to a location with poor or no reception was renewed by a friend who is considering cutting the cord.

In an older thread, https://forum.tvfool.com/showthread.php?t=1286 I attempted to outline an idea that I had re. use of WiFi and a network attached tuner.

My friend is in a location that could be described as 'a deep hole'. There would be some reception, but the majority of major networks would be unreliable or simply unreceivable. So I got to work, trying to build a working example of streaming uncompressed TV signal from my network attached tuner to a laptop or PC located at any remote site with adequate Internet service.

Resolution of the pdf version is much greater than the png.
Attached Images
File Type: png RemoteConnectionToHDHR.png (46.9 KB, 3496 views)
Attached Files
File Type: pdf RemoteConnectionToHDHR.pdf (19.8 KB, 1873 views)
__________________
If the well is dry and you don't see rain on the horizon, you'll need to dig the hole deeper. (If the antenna can't get the job done, an amp won't fix it.)

(Please direct account activation inquiries to 'admin')

Last edited by GroundUrMast; 7-Aug-2019 at 4:05 PM.
GroundUrMast is offline   Reply With Quote
Old 20-Jul-2019, 5:42 PM   #2
GroundUrMast
Moderator
 
GroundUrMast's Avatar
 
Join Date: Oct 2010
Location: Greater Seattle Area
Posts: 4,773
The SiliconDust tuners that I own are not engineered to send data through the public Internet. There are probably several reasons that caused SiliconDust to make that design choice, perhaps some legal issues but just a few years ago, most 'high speed' Internet service was likely inadequate to support the data rate of an HD TV broadcast. Whatever the reason, I needed to set up a reliable VPN connection from the remote location into the location of the tuner.

I run Linux on my Media-Center-PC and laptop. So I settled on using Secure Shell (SSH) to establish an encrypted tunnel connection into my network. The first step was to enable dynamic-DNS (DDNS) so that the public IP address of my gateway router could be reached from a remote location. After signing up for DDNS service, I added my domain name and account credentials into the configuration of my gateway router. At that point, I was able to find the public IP address of my gateway router when I was at a remote location such as a coffee shop or my friends house.

The next step was to configure port forwarding on my gateway router so that SSH tunnel packets would be allowed into my network and forwarded to my Media-Center-PC. I opted to map a non-standard port from the public side of my gateway router to the well-known SSH port 22 on my Media-Center-PC.

On the Media-Center-PC and the laptop, I opted to generate/install encryption keys and then configure the SSH service to not allow username/password authentication... Only connections using pre-shared keys are allowed. Once I was able to 'SSH' into my Media-Center-PC from a public location I moved on to connecting to the tuner.

To connect to the TV tuner I needed the tuner to think it was talking to my Media-Center-PC which is on the same private LAN. The 'trick' is to us the tunnel feature of SSH. The command used on the remote laptop is actually not much different than the basic command used to connect to a shell (command prompt) on the Media-Center-PC/SSH-server...
__________________
If the well is dry and you don't see rain on the horizon, you'll need to dig the hole deeper. (If the antenna can't get the job done, an amp won't fix it.)

(Please direct account activation inquiries to 'admin')

Last edited by GroundUrMast; 20-Jul-2019 at 6:30 PM. Reason: sp.
GroundUrMast is offline   Reply With Quote
Old 20-Jul-2019, 5:59 PM   #3
GroundUrMast
Moderator
 
GroundUrMast's Avatar
 
Join Date: Oct 2010
Location: Greater Seattle Area
Posts: 4,773
The command used on the remote laptop looks like this...

Code:
shh -D4567 myddnsname.ddns.net -p 6789
In this case, the -D option (with the port number immediately following) tells SSH that any data sent to the specified TCP port on the laptop should be sent to the Media-Center-PC. Once the packet of data arrives at the Media-Center-PC, it will be sent out onto the LAN using the Media-Center-PC's IP address as the source address.

The -p option is used to tell SSH to use the non-standard port I opened on my gateway router. If I had opted to forward the default port (TCP 22) through my gateway router this option would not be needed.

So this allows the laptop to use the Media-Center-PC to act as it's proxy... I can connect to any IP address on the home LAN, in fact, I can even surf the web and appear to be using the IP connection of the Media-Center-PC.
__________________
If the well is dry and you don't see rain on the horizon, you'll need to dig the hole deeper. (If the antenna can't get the job done, an amp won't fix it.)

(Please direct account activation inquiries to 'admin')

Last edited by GroundUrMast; 20-Jul-2019 at 9:08 PM. Reason: -p option explaination
GroundUrMast is offline   Reply With Quote
Old 20-Jul-2019, 6:12 PM   #4
GroundUrMast
Moderator
 
GroundUrMast's Avatar
 
Join Date: Oct 2010
Location: Greater Seattle Area
Posts: 4,773
To stream live TV to the laptop I need to do one more thing... I'm using VLC to display the video and audio so I need to tell VLC to send it's request to connect to the remote tuner to the VPN/proxy connection. Using the GUI menu of VLC, I choose Tools>Preferences>Show Settings(All)>Input/Codecs scroll to the Socks proxy section and set the Socks server to 127.0.0.1:4567

Now, when I use the GUI menu Media>Open Network Stream and enter the URL of my SiliconDust HDHR-Extend tuner, the connection request will be forwarded through an encrypted SSH tunnel to my Media-Center-PC which will connect to the tuner.

An alternate option I've tested uses the command-line

Code:
Example:

vlc --socks 127.0.0.1:4567 http://192.168.0.50:5004/auto/v4.1?transcode=none
This method of launching VLC does not permanently set the proxy option, so for normal use, VLC will not need to be reconfigured to the default of no proxy.
__________________
If the well is dry and you don't see rain on the horizon, you'll need to dig the hole deeper. (If the antenna can't get the job done, an amp won't fix it.)

(Please direct account activation inquiries to 'admin')

Last edited by GroundUrMast; 18-Aug-2019 at 4:42 AM. Reason: Added command line example
GroundUrMast is offline   Reply With Quote
Old 20-Jul-2019, 6:20 PM   #5
GroundUrMast
Moderator
 
GroundUrMast's Avatar
 
Join Date: Oct 2010
Location: Greater Seattle Area
Posts: 4,773
The URL of an HDHR-Extend looks like this...

Code:
http://192.168.1.50:5004/auto/v4.1?transcode=none
The 'v4.1' in this example refers to vitual channel 4.1... Port number 5004 is the port used by SiliconDust to provide streaming service on the HDHR platform.

https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1
__________________
If the well is dry and you don't see rain on the horizon, you'll need to dig the hole deeper. (If the antenna can't get the job done, an amp won't fix it.)

(Please direct account activation inquiries to 'admin')

Last edited by GroundUrMast; 20-Jul-2019 at 6:39 PM. Reason: Added link to HDHR tuner
GroundUrMast is offline   Reply With Quote
Old 20-Jul-2019, 6:25 PM   #6
GroundUrMast
Moderator
 
GroundUrMast's Avatar
 
Join Date: Oct 2010
Location: Greater Seattle Area
Posts: 4,773
I was showing this to friends at a coffee shop a few nights ago. The coffee shop WiFi bandwidth tested out at about 45 Mb/s. My home upload speed is 30 Mb/s.

We had flawless 'reception' and observed data rates at 10 to 16 Mb/s while watching HD programs on several stations.

I was impressed and I think they were as well.
__________________
If the well is dry and you don't see rain on the horizon, you'll need to dig the hole deeper. (If the antenna can't get the job done, an amp won't fix it.)

(Please direct account activation inquiries to 'admin')
GroundUrMast is offline   Reply With Quote
Old 23-Jul-2019, 7:53 PM   #7
ckwsp101_tv
Member
 
Join Date: Feb 2015
Posts: 39
GroundUrMast

Nice experiment.

Long running ssh sessions can be disrupted by ISP routers in the path between source and consumption endpoint.
ISP router throttling upsets ssh.

I used ssh tunnel with rsync for off site backup.

When establishing long running ssh sessions I limited source transmission rate to avoid throttling.

Remote backup worked with 2 day long ssh sessions.
ckwsp101_tv is offline   Reply With Quote
Old 23-Jul-2019, 9:05 PM   #8
GroundUrMast
Moderator
 
GroundUrMast's Avatar
 
Join Date: Oct 2010
Location: Greater Seattle Area
Posts: 4,773
Quote:
Originally Posted by ckwsp101_tv View Post
GroundUrMast

Nice experiment.

Long running ssh sessions can be disrupted by ISP routers in the path between source and consumption endpoint.
ISP router throttling upsets ssh.

I used ssh tunnel with rsync for off site backup.

When establishing long running ssh sessions I limited source transmission rate to avoid throttling.

Remote backup worked with 2 day long ssh sessions.
Thanks for the comment...

While researching for this I recall a few articles that mentioned this issue. One, which I would have to search for again, suggested a persistent SSH utility that monitors the state of an SSH connection and re-establishes it if it fails.

I was also contemplating RSYNC as a useful tool for low bandwidth connections. One could run a media server at the antenna/tuner location and then upload recorded programs to the remote site for delayed viewing.
__________________
If the well is dry and you don't see rain on the horizon, you'll need to dig the hole deeper. (If the antenna can't get the job done, an amp won't fix it.)

(Please direct account activation inquiries to 'admin')

Last edited by GroundUrMast; 23-Jul-2019 at 9:08 PM.
GroundUrMast is offline   Reply With Quote
Old 16-Aug-2019, 8:14 PM   #9
rickbb
Senior Member
 
Join Date: Dec 2014
Posts: 341
Interesting, I use a 2 channel Hauppauge OTA tuner card in a Windows PC and with the serial number of the card you can use their software to setup your system to serve both live and recorded OTA tv to the internet.

After you register your software you are setup to pass through their server using their public IP with your system code appended to the end. You can watch from any internet connected device through the browser.

Of course the better the bandwidth at both ends the better the viewing. I use it when I'm in a non-English speaking country for getting the news and some of my PBS shows I like.
rickbb is offline   Reply With Quote
Old 12-Sep-2019, 9:32 PM   #10
TheFu
Junior Member
 
Join Date: Aug 2012
Posts: 10
more ssh and scripts for HDHR

I have a few HDHR network tuners connected to the network. In the USA, ATSC is mpeg2 TS. Not the most efficient video codec available today. Either h.264 or h.265 are dramatically better. h.264 uses about 50% less bandwidth than mpeg2. h.265 uses about 50% less than h.264 - those are rough estimates. YMMV.

It is possible to have the HDHR "record" and pipe that output into ffmpeg to transcode it into either h.264 or h.265 video before streaming over ssh or a VPN.

I haven't used this in about a year, but it worked previously:
Code:
#!/bin/bash

CH=69.1
in=test-$CH
/usr/bin/timeout 1.25h \
wget -q -O - http://hdhr4:5004/auto/v$CH | \
 ffmpeg      -i -       -c:v libx264       -crf 19.5 \
         -vf scale=-1:720 \
         -preset veryfast \
         -c:a libvorbis -q:a 6 "$in.mkv"
The ability for live transcoding is determined by the system running the ffmpeg task. I for only 720p resolutions and use vorbis for audio.
On the remote system, we just need to playback the created mkv file. h.264 can work well on dual core pentium/celeron systems. h.265 can't keep up without a more powerful CPU than I have for this.

timeout will end the wget pulling the stream from the HDHR in 1.25 hours.
The veryfast option sacrifices file size for speed.

Don't forget that the ~/.ssh/config file can hold any options for a specific connection, just use a different alias for the stanza
Code:
host tv-record
  user thefu
  hostname 123.4.5.6 
  port 62428


host tv-root
   user root
  hostname 123.4.5.6 
  port 62428
No need to ever use the userid, IP or non-standard port again. Every ssh tool honors this file. sftp, scp, rsync, ssh, x2go, sshfs, and the 50 backup tools as well. The ssh_config manpage spells out all the options for this client-side config file. The hostname can be a DNS name too, if you like. Only the first "host" part needs to be unique. Different ssh-keys can be specified, as can ssh port forwarding.

Instead of using this transcode script, I just let the plex server transcode the mpeg2 into h.264 and control the bandwidth needed by the plex web server settings. I'm using the plex web-app and don't have a plex userid or plex account. To access the plex web-app on the home LAN, I use:
Code:
#!/bin/bash

PORT=62001
# Only start SOCKS proxy if necessary
if  [ $(ps -eaf |grep ssh |grep -c $PORT ) = 0 ] ; then
   # Setup SOCKS proxy through home server
   echo "Starting ssh SOCKS Proxy"
   ssh -f -C -D $PORT  123.4.5.6  -NT &
fi 

# Star private firejail with chromium, going through 
# just setup SOCKS proxy
sleep 3;
echo "Starting Firejail chromium with private & proxy "
export http_proxy="socks5://localhost:$PORT "; 
firejail --private chromium-browser \
         --proxy-server="socks5://localhost:$PORT " &
I didn't intend to put so much here. Sorry. Hopefully, someone will find it useful.

I have no idea how to accomplish the same using Windows. We are a Unix household.
TheFu is offline   Reply With Quote
Old 13-Sep-2019, 12:06 AM   #11
GroundUrMast
Moderator
 
GroundUrMast's Avatar
 
Join Date: Oct 2010
Location: Greater Seattle Area
Posts: 4,773
TheFu, Thanks for sharing this. Given the hardware transcoding capability of my HDHomeRun EXTEND
(Model: HDTC-2US), I had not considered the need for ffmpeg. Using either the command line or GUI to launch vlc I have had no problem choosing transcoding when I have been at locations that lacked adequate bandwidth for streaming an MPEG2 HD program.

My reason for using a non-standard port to transport SSH across the Internet was based on reducing the security risk of port scans by amateur hackers.
__________________
If the well is dry and you don't see rain on the horizon, you'll need to dig the hole deeper. (If the antenna can't get the job done, an amp won't fix it.)

(Please direct account activation inquiries to 'admin')
GroundUrMast is offline   Reply With Quote
Old 13-Sep-2019, 1:59 AM   #12
TheFu
Junior Member
 
Join Date: Aug 2012
Posts: 10
Quote:
Originally Posted by GroundUrMast View Post
TheFu, Thanks for sharing this. Given the hardware transcoding capability of my HDHomeRun EXTEND
(Model: HDTC-2US), I had not considered the need for ffmpeg. Using either the command line or GUI to launch vlc I have had no problem choosing transcoding when I have been at locations that lacked adequate bandwidth for streaming an MPEG2 HD program.

My reason for using a non-standard port to transport SSH across the Internet was based on reducing the security risk of port scans by amateur hackers.
I have HDHR2, HDHR4 and an HDHR-Quad. The 4 and Quad are DLNA "servers". The HDHR2 uses whatever the old-school protocol was that needed special drivers that required compiling and linking. Since SiliconDust changed all the names I can't keep up with what each does. Their overview page is only slightly useful. https://www.silicondust.com/hdhomerun/


For any lurkers, definitely NOT using 22/tcp for ssh is a smart idea. Running fail2ban and only allowing ssh-keys for authentication will effectively block any brute force attempts that happen to find the high port. If your WAN router supports it, having it do the port translation to the LAN system 22/tcp for ssh means just installing fail2ban doesn't need any extra configuration. Setting up ssh-keys and pushing the public key to the remote ssh-server is really easy on Unix these days.
Code:
ssh-keygen -t ed25519
ssh-copy-id -i ~/.ssh/id_ed25519.pub userid@remote
The ed25519 type is about as secure as 3k RSA ssh-keys.
TheFu is offline   Reply With Quote
Reply

Bookmarks

Go Back   TV Fool > Over The Air Services > Enthusiast's Exchange



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT. The time now is 9:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright © TV Fool, LLC