[mythtv-users] JWPlayer over OPENVPN

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Jul 3 03:43:15 UTC 2020

On Thu, 2 Jul 2020 17:33:22 -0500, you wrote:

>On 7/2/20 5:12 PM, Doug Lytle wrote:
>> On 7/2/20 5:58 PM, Jack McGee wrote:
>>> I am using the port 6544 and some few shows (PBS) seem to play OK 
>>> most of the time.   Most of the other shows do not.  Lots of pausing. 
>> You don't provide your uplink speeds.  I get a downlink of 50mbit, but 
>> only an uplink speed of 4mbit.  Makes streaming from remotely, over 
>> OpenVPN difficult with a HD recording.
>> Good point.  Just ran a speed test and saw 1Mbps.

Running your OpenVPN on your router is usually a bad idea if you want
good speed.  Routers work fast by using special routing hardware to
handle the packets - the CPU is usually only involved in setting up a
connection on the arrival of the first packet.  Some routers also have
encryption hardware that allows them to do IPSEC encryption at
reasonable speed.  But I do not know of any router that you could
afford for home use that has encryption hardware that works with
OpenVPN.  So the OpenVPN encryption (and likely also OpenVPN packet
routing) will be being done on your router's CPU, and router CPUs are
not generally very powerful.  So the speed of your encrypted
connections is likely to be much slower than your normal Internet
connection speed.

If your router supports Wireguard, that is easier for routers to
handle and will give a faster connection, but it will only be good if
Wireguard has been optimised for your router.  So the best option is
to run OpenVPN or Wireguard on a PC with a decent CPU.  I am not sure
if OpenVPN has been fixed to take advantage of multiple CPU cores.  I
suspect not.  So the best CPU to run it on is the one with the best
single core performance.  The decryption speed also matters, but most
modern laptops will be able to do OpenVPN much faster than a home
router.  Mine certainly does.

I run my OpenVPN server on my MythTV box, which is getting a little
old now, but has a decent CPU (AMD BullDozer FX-4100 3.60 GHz quad
core).  My home Internet connection is 1 gigabit fibre (but only has
500 Mbit/s upload speed).  When I am away on holiday, I always try
playing programmes directly from home over whatever Internet
connection I have, and a couple of years ago I had a decent VDSL
connection and was able to play all my SD recordings over OpenVPN.  HD
recordings still did not work properly, but I was able to copy them to
my laptop in just over real time - about an hour and 15 minutes for a
one hour HD recording (actually 65 minutes of recording with pre- and
post-roll).  I never did know the actual speed of the VDSL connection,
as I did not have access to the router to see its connection and
statistics pages, so I am not sure if I had hit the maximum speed of
the connection, or the maximum speed of my OpenVPN server.  I think it
was most likely the connection speed.

To play HD recordings over an Internet connection, you need not just
the average bit rate of the recording, but instead you need to have
the peak rate, which can be more than twice the average rate.  I would
not expect HD recordings to work properly with less than 8 Mbit/s
network speed, and I would really want 12 Mbit/s to be fairly sure
that fast action and scene changes would not judder.

More information about the mythtv-users mailing list