QNAP QPKG for DVR Record Engine

Downloads & Instructions
Post Reply
demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

QNAP QPKG for DVR Record Engine

Post by demonrik »

The sources for creating the QPKG are provided to Silicondust and available in their github repository here, details on building below
Unofficial QPKG binaries are made available by @demonrik and details to install follow with support via this thread or via discord

Unofficial QPKG Installation Instructions
  1. Download the latest .qpkg file from Google Drive, DropBox, OneDrive, or advanced users can build from source (see below). The .md5 file allows advanced users to verfiy that the file has not been modified in transit but is otherwise not needed.
  2. Log on to your QNAP QTS Desktop via the web interface.
  3. Once on the QTS Desktop you need to open the App Center - either via the desktop icon or menu
    Image
  4. With the appcenter open, select the button to 'install manually'
    Image
  5. this will open a dialog for you to select the built/downloaded QPKG and then install
    Image
  6. Once installed you will have an icon in the appcenter
    Image
    And the QTS desktop menu
    Image
  7. You can open these and be presented with the UI which allows you to browse the logs, see your HDHR devices, and see the status of the DVR engine.
    Image
    And some diagnostics
    Image
  8. You can see new user and share via control panel
    Image
    Image
  9. And new share will have latest engine and a log file
    Image
--------------------------
Starting and Stopping the Record Engine
Via App Center
  1. Log on to your QNAP QTS Desktop via the web interface.
  2. Once on the QTS Desktop you need to open the App Center - either via the desktop icon or menu
    Image
  3. Find the HDHomeRunDVR app which should have a green indicator underneath saying "Open"
    Image
  4. Click the drop down menu icon to the right of "Open" and select "Stop" to stop the engine
  5. Once stopped the icon will be grayed out and the text of the little indicator below will change to "Start"
    Image
  6. To restart the engine click the "start" button
--------------------------
About
The windows installer for the QNAP NAS requires a lot of steps that are unnecessary and for some complex. It is also missing a number of features to integrate fully into the QTS Desktop, and provide startup/shutdown routines, etc.

Thus I started up a quick project with the purpose to build a proper QPKG installer for QNAP to allow easy deployment of the DVR engine to QNAP users NAS boxes, while also adding some additional UI features to allow simpler configuration and status information of the DVR Engine. I'm making unofficial builds with the DVR engine included available via my various mechanisms shared above.

Thankfully @Nickk set up a silicondust DVR installer project on github and I've contributed my QDK project to build that QNAP installer in the qnap subfolder
https://github.com/Silicondust/dvr_install

License of the QDK sources is public domain. License of the HDHomeRun DVR Record Engine remains the property of SiliconDust and use of this QDK sources does in no way permit the user the right to redistribute the binaries without SiliconDust's permission and/or permit any breaking of SiliconDust's license restrictions on the DVR record engine.
Last edited by demonrik on Tue Sep 21, 2021 1:01 am, edited 8 times in total.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

Known Issues/Workarounds
No UI through QTS
Some users have reported on installing that they don't get the UI at the QTS Desktop.
I've not managed to replicate the issue and suspect a permissions issue with latest QTS desktop versions.. however because I cannot replicate I do not have a fix.
The workaround is to use the direct URL <ip of NAS>/HDHomeRunDVR

No Web UI
Some have reported that the UI doesn't open. This is usually because the web server has been disabled, and you will need to enable it.
This can be found under 'Control Panel' -> 'Applications' -> 'Web Server'

No UI in QTS Desktop - web server is running
This is likely caused by an update QNAP did to the Apache Config file
You will need to SSH to your NAS
The confirm you have the suitably broken apache.conf file by typing

Code: Select all

grep -iC4 x-frame-option /etc/config/apache/*
If you get something - you have the error..
Now modify the file indicated
Find the following line under <IfModule_headers_module>

Code: Select all

Header always append X-Frame-Options SAMEORIGIN "env=!share-iframe"
and comment it out with a # that line so it looks more like

Code: Select all

<IfModule headers_module>
#Header always append X-Frame-Options SAMEORIGIN "env=!share-iframe"
Header always edit Set-Cookie ^(.*)$ $1;HttpOnly
</IfModule>
then restart apache

Code: Select all

/etc/init.d/Qthttpd.sh restart

Recordings Folder
By default the recordings are going to be placed a HDHomeRunDVR subfolder in one of the following locations depending on what is detected by the installation script - in order:
  • /share/Recordings
  • /share/Multimedia
  • /share/Public
  • <QPKG base folder>
You can change this in the UI by updating the Record Path and then restarting the record engine.
Last edited by demonrik on Wed Feb 13, 2019 1:40 pm, edited 9 times in total.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

All sources for the DVR QPKG are available on Silicondusts Github project https://github.com/Silicondust/dvr_install
It contains the QDK sources to build the QPKG. The project does not contain a copy of SiliconDust's HDHomeRun DVR Record Engine Binary. Builders must get this binary separately from the SiliconDust forums

License of the QDK sources is public domain. License of the HDHomeRun DVR Record Engine remains the property of SiliconDust and use of this QDK sources does in no way permit the user the right to redistribute the binaries without SiliconDust's permission and/or permit any breaking of SiliconDust's license restrictions on the DVR record engine.

QPKG Build Instructions
The follow are instructions on how to build a QPKG using the sources in the project.

Prerequisites
QDK - at time of writing was v2.2.5

Tested Platforms
QNAP-x51 with QTS 4.2 (linux)

Build Instructions
Once you have cloned the package to your system ..
1. cd to the qnap project directory
2. Run the fetch_record_engine.sh script to get the latest DVR binary from SiliconDust
3. Build the QPKG with 'qbuild'

This will create the QPKG in the build subfolder. install via the QTS Desktop app center, or via the commandline on the NAS

Code: Select all

sh build/HDHomeRunDVR.ver.qpkg

Support
Support for the QPKG sources will be done via this thread or via discord channel
https://discord.gg/0uzKaTiMjCwvanxM
Just ask and I will do my best to answer as quickly as I can :)
Last edited by demonrik on Mon Nov 26, 2018 8:04 am, edited 9 times in total.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

Transitioning from Silicondust NAS Installer to QPKG

The Silicondust installer package for NAS will have done a few things to your NAS that we need to work on.
  1. Creation of a HDHomeRun share
  2. Copying the hdhomerun_record_linux binary to the HDHomeRunshare as hdhomerun_record
  3. Creation of the hdhomerun.conf file with the RecordPath set to HDHomeRun share
To move to the QPKG you will need to complete the following steps
  1. Shutdown the old record engine
  2. remove the binary and config file
  3. Install the QPKG
  4. Optionally shutdown the new record engine and reconfigure the Record Path
  5. Optionally shutdown the new record engine and move recordings
  6. Optionally clean up the share
1. Shutting down the old record engine
The fastest and easiest way to do this is reboot the NAS.
If you don't want to do this, SSH to the NAS and login as the Admin user.
You will need to then move to the HDHomeRun share and stop the engine, i.e.

Code: Select all

> cd /share/HDHomeRun
> ./hdhomerun_record stop

2. Removing the old binary and conf files
This can be done either in the File Station or via SSH.

In File Station open up the HDHomeRun share and delete the following 2 files which are no longer needed
  • hdhomerun_record
  • hdhomerun.conf
For SSH - SSH to the NAS and login as the Admin user.
You will need to then move to the HDHomeRun share and delete the engine, i.e.

Code: Select all

> cd /share/HDHomeRun
> rm hdhomerun_record hdhomerun.conf

3. Install the QPKG
Follow the instructions in the original post to install the QPKG
viewtopic.php?p=186335#p186335

4. Optionally shutdown the new record engine and reconfigure the Record Path
With the new QPKG installed you have a few things you can do with the data from the old installation.
If you have no recordings - nothing to do here.. simply go to step 6 and remove the old share
If you have recordings and don't care about where they exist.. go to step 5 and move the recordings to the new RecordPath
If you have recordings and don't want to move them.. this step is for you :)

The first thing to do is to shutdown the new engine.
If you just installed the QPKG then you will need to shut this down from SSH as the UI controls are blocked by the automatic loading of the record engine on package install or NAS reboot.
So SSH to the NAS and login as admin
We need to check where the engine is installed

Code: Select all

>getcfg HDHomeRunDVR Install_Path -f /etc/config/qpkg.conf
/share/CACHEDEV1_DATA/.qpkg/HDHomeRunDVR
With the location known we can now shutdown the engine

Code: Select all

/share/CACHEDEV1_DATA/.qpkg/HDHomeRunDVR/HDHomeRunDVR.sh stop
With the engine stopped its time to change the RecordPath.
Open the HDHomeRunDVR UI and update the RecordPath to the old recordings location (default was /share/HDHomeRun )
The start the engine from the UI.

5. Optionally shutdown the new record engine and move the Recordings
If you are going to change the RecordPath from the default the first thing to do is to shutdown the new engine.
More on this in a moment.

If you are not going to change the RecordPath you do NOT need to stop the engine. Just simply move the folders under the SiliconDust created share (default is /share/HDHomeRun) to the default RecordPath shown in the UI.

If you just installed the QPKG then you will need to shut this down from SSH as the UI controls are blocked by the automatic loading of the record engine on package install or NAS reboot.
So SSH to the NAS and login as admin
We need to check where the engine is installed

Code: Select all

>getcfg HDHomeRunDVR Install_Path -f /etc/config/qpkg.conf
/share/CACHEDEV1_DATA/.qpkg/HDHomeRunDVR
With the location known we can now shutdown the engine

Code: Select all

/share/CACHEDEV1_DATA/.qpkg/HDHomeRunDVR/HDHomeRunDVR.sh stop
Then optionally update the RecordPath in the UI

With the engine stopped you are now free to move all the recordings from the Silicondust share (default is /share/HDHomeRun) to your choice of directory and update the RecordPath in the UI.

Once the files are moved you can restart the engine via the UI.

5. Optionally clean up the share
... WIP ...
Last edited by demonrik on Thu Jul 27, 2017 10:33 am, edited 4 times in total.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

Quick update

If you want to modify the RecordPath in the configfile subsequent upgrades of the QPKG will honor those changes and not change the conf file.

TO update the Record Path you will need to edit the config file at
/share/CACHEDEV1_DATA/.qpkg/HDHomeRunDVR/HDHomeRunDVR.conf

Then restart the record engine through either the commandline or the QTS Desktop App Center (stop then start)

Commandline to restart is

Code: Select all

>/etc/init.d/HDHomeRunDVR.sh restart
Currently UI is broken.. Will fix in the next update along with the ability to change the RecordPath from the UI.

bts0004
Posts: 229
Joined: Thu May 14, 2015 8:20 am

Re: QNAP QPKG for DVR Record Engine

Post by bts0004 »

Thank you for taking this on! It's nice to have an actual package to wrap this up. Out of curiosity, was there any particular reason you chose to use a different recording directory other than the default that SD set? It sounds like you're going to provide an option to specify it, so I'm assuming this is probably hard coded to use your personal settings? That would make sense. Otherwise, just wondering why you'd pick a directory that likely the majority of users would end up having to go back and change.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

bts0004 wrote:Thank you for taking this on! It's nice to have an actual package to wrap this up. Out of curiosity, was there any particular reason you chose to use a different recording directory other than the default that SD set? It sounds like you're going to provide an option to specify it, so I'm assuming this is probably hard coded to use your personal settings? That would make sense. Otherwise, just wondering why you'd pick a directory that likely the majority of users would end up having to go back and change.
Recordings is a default share on QNAP systems.
So rather than figure out how I can script the creation of a new one I decided to simply reuse one that exists on the system that nominally fits the use.

TBH I was 50/50 whether to use Multimedia or Recordings.
Creating a new HDHomeRun to me is completely unnecessary.

Edit - should add - I'm open to suggests to change the default

bts0004
Posts: 229
Joined: Thu May 14, 2015 8:20 am

Re: QNAP QPKG for DVR Record Engine

Post by bts0004 »

Makes sense. I've only used a Synology before, so the QNAP I bought for this is still new to me and figuring out how it works is still a work in progress for me.

JerryB
Posts: 108
Joined: Wed Aug 05, 2009 2:00 pm

Re: QNAP QPKG for DVR Record Engine

Post by JerryB »

demonrik wrote:Recordings is a default share on QNAP systems.
So rather than figure out how I can script the creation of a new one I decided to simply reuse one that exists on the system that nominally fits the use.

TBH I was 50/50 whether to use Multimedia or Recordings.
Creating a new HDHomeRun to me is completely unnecessary.

Edit - should add - I'm open to suggests to change the default
I agree with your decision. I understand why SD is keeping things simple but ideally a program designed for a QNAP should use the built in QNAP defaults. Personally I use Multimedia and then point my Plex server to that directory but, as you said, it's a 50/50 decision whether to use the built in Multimedia or Recordings directory.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

0.4.1 Update made

UI now works again.
Prints out the location of the config file (is default)
And the value of the Record Path.

Also lists the HDHomeRun DVR engine that was installed..

----
v0.4.1 QPKG can be downloaded from https://drive.google.com/open?id=0B9Rir ... HQyQzM1WG8

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

0.4.2 Update is live

Updated to allow the UI to set the RecordPath in the config file.
At this time the UI does not support the stop/start/restart of the record engine, so you will have to do this yourself via either the AppCenter or on the command line.

Also to make this work I've had to make the conf file world writable.. looking to see if I can avoid this for a future release.

Next update will be to add the engine controls to make the updating of the path much easier.

----
QPKG builds can be downloaded from https://drive.google.com/open?id=0B9Rir ... HQyQzM1WG8
Download and install manually via your QTS Desktop App Center

joemillerftw
Posts: 5
Joined: Thu Feb 04, 2016 4:21 am

Re: QNAP QPKG for DVR Record Engine

Post by joemillerftw »

Just wanted to add my thanks to you for taking this project on. I just bought a TVS-471 and am excited to try out the qpkg solution you've been working on.

Out of curiosity, i'd like to know of anyone's experience running Plex and the record engine on the same QNAP. I currently have been using the record engine and Plex on an old Dell OptiPlex 780 with a Core 2 Duo and that's been fine so i'd assume the i3 in the TVS-471 could handle things even better.

JerryB
Posts: 108
Joined: Wed Aug 05, 2009 2:00 pm

Re: QNAP QPKG for DVR Record Engine

Post by JerryB »

joemillerftw wrote:Out of curiosity, i'd like to know of anyone's experience running Plex and the record engine on the same QNAP.
I have no problem running Plex and the recording engine on my QNAP (TS-453 Pro).

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

joemillerftw wrote:Just wanted to add my thanks to you for taking this project on. I just bought a TVS-471 and am excited to try out the qpkg solution you've been working on.
Cool - looking for feedback :)
Out of curiosity, i'd like to know of anyone's experience running Plex and the record engine on the same QNAP. I currently have been using the record engine and Plex on an old Dell OptiPlex 780 with a Core 2 Duo and that's been fine so i'd assume the i3 in the TVS-471 could handle things even better.
I have a TS-651, based on Celeron J which has both running well.
However - I make sure I use direct play all the time so the NAS doesn't transcode.. And this is where things can go wrong because Plex isn't enabled to use the QuickSync Video engine to transcode, so it uses the CPU only. And if you do transcode you could run into issues where the CPU is overloaded if the record engine needs to record.

If you do need to transcode then I would recommend you install the CodexPack under HybridDesk Station. This installs a version of ffmpeg which has QSV enabled and thus you can either use the automated transcode, or run the special ffmpeg via command line/scripts.

joemillerftw
Posts: 5
Joined: Thu Feb 04, 2016 4:21 am

Re: QNAP QPKG for DVR Record Engine

Post by joemillerftw »

If you do need to transcode then I would recommend you install the CodexPack under HybridDesk Station. This installs a version of ffmpeg which has QSV enabled and thus you can either use the automated transcode, or run the special ffmpeg via command line/scripts.
I may look into that. I was planning to use MCE Buddy on a separate box to strip the commercials from everything and convert it to h.264 so I wouldn't have to transcode recordings in Plex. I do however, use the HDHR Viewer plugin in Plex to get live channels off network so I would still be transcoding for that purpose. Part of my goal is to share my cable subscription with a friend using this setup.

Post Reply