You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prime_encoder is network encoder for SageTV which tunes and streams video from an HDHomerunPrime.
3
+
prime_encoder is network encoder for SageTV
4
4
5
-
prime_encoder is currently considered beta. There are some things that need to be cleaned up in
6
-
the code, but it has been my primary method of recording shows for the last few months with no problems.
5
+
prime_encoder has been my primary method of recording shows for about five years and it has been
6
+
very reliable.
7
7
8
8
## Background
9
9
10
-
When the Silicon Dust HDHomerunPrime was released using a Cable Card suddenly seemed like a possible
11
-
option with SageTV since some cable providers have channels marked as "copy freely". However, getting
12
-
a working Linux driver for the Prime seemed to be challenging.
10
+
When the Silicon Dust HDHomerun Prime was released using a Cable Card with SageTV suddenly seemed like
11
+
a possibility since some cable providers have channels marked as "copy freely". However, there was no
12
+
direct suport in SageTV for the Prime and no Linux drivers for it (as it is a network attached device).
13
13
14
-
I realized that the hdhomerun_config setup script allowed you to stream content from the Prime directly
15
-
(other tools like ffmpeg can do this as well) - I just needed a way to get SageTV to tune the Prime.
16
-
Luckily, SageTV support the concept of "network encoders" - other devices on the local network that act
17
-
as tuner that SageTV can direct.
14
+
The Silicon Dust hdhomerun_config setup script allowed you to stream content from the Prime directly
15
+
(other tools like ffmpeg can do this as well) so I just needed a way to get SageTV to tune the Prime and
16
+
start steaming. Luckily, SageTV supports the concept of "network encoders" - other devices on the local
17
+
network that act as tuner/recorders that SageTV can direct.
18
18
19
-
So I created prime_encoder to do this middle-man task.
19
+
I created prime_encoder to do this middle-man task.
20
20
21
-
prime_encoder script doesn't have to run on the same box as the master SageTV server. As long as you
22
-
have it running somewhere on your network and have the recording directories set up correctly you
23
-
should be fine. I happen to run the script on the same box as the SageTV server because the overhead of
24
-
running it is fairly small and doesn't seem to impact the main SageTV performance.
21
+
Originally I was using prime_encoder for recording from an HDHomerun Prime device, but it has
22
+
been refactored to be more generic so that any command that generates video can be used.
25
23
26
-
The SageTV server will automatically discover network encoders. It sends commands to the network encoders
27
-
to record video and tells the encoders where to dump the video file, so the only config option that needs to
28
-
be changed on the SageTV server is to enable discovery.
24
+
The full set of network encoding commands is not supported. Primarily this means you can't "preview"
25
+
channels from the Setup Video Sources screen.
29
26
30
-
Be sure to install a startup script so that prime_encoder is started at boot time. A basic example Ubuntu script (<tt>prime_encoder.init</tt>) is included.
27
+
## Install
31
28
32
-
Or, you can add this to the bottom of /opt/sagetv/server/sagesettings, and the encoder will start when
29
+
### Notes
30
+
31
+
prime_encoder script doesn't have to run on the same host as the master SageTV server. You only need to
32
+
have it running somewhere on your network and have the recording directories set up correctly using SMB or
33
+
another sharing protocol.
34
+
35
+
I run the script on the same host as the SageTV server because the overhead of running it is fairly small
36
+
and doesn't seem to impact SageTV performance. This has the added advantage of not having to deal with
37
+
network shares or mapping the recording paths across hosts.
38
+
39
+
When it starts, the SageTV server will automatically discover network encoders. It sends commands to
40
+
the network encoders to record video and tells the encoders where to store the video file. The only config
41
+
option that needs to be changed on the SageTV server is to enable network encoder discovery.
42
+
43
+
### Running at startup
44
+
45
+
prime_encoder needs to start before the main SageTV process starts.
46
+
47
+
The easiest way to do this is to use the basic example Ubuntu script (<tt>prime_encoder.init</tt>).
48
+
49
+
Alternatively, you can add this to the bottom of /opt/sagetv/server/sagesettings, and the encoder will start when
33
50
the SageTV process starts:
34
51
35
52
if [[ ! $(ps aux |grep "[p]rime_encoder: Master") ]]; then /opt/sagetv/hdhomerun/prime_encoder; fi
36
53
37
-
Note that not all commands are currently supported. Primarily this means you can't yet "preview" channels
38
-
from the Setup Video Sources screen.
39
-
40
-
## Instructions
54
+
### Assumptions
41
55
42
56
These directions assume a few things:
43
57
@@ -46,8 +60,9 @@ These directions assume a few things:
46
60
47
61
IPC::Run
48
62
Proc::Daemon
63
+
YAML::Tiny
49
64
50
-
(these are libipc-run-perl and libproc-daemon-perl on Ubuntu)
65
+
(these are libipc-run-perl, libproc-daemon-perl, and libyaml-tiny-perl on Ubuntu)
51
66
52
67
* You have a non-root user to run prime_encoder as. I use the user name 'sagetv' in the instructions below.
53
68
* The sagetv user can write to the recording directories that the SageTV server uses. This might require
@@ -58,9 +73,9 @@ These directions assume a few things:
58
73
* If your Linux box is running a host firewall, you'll need to open holes for UDP port 8271 and TCP
59
74
ports you define later for each encoder.
60
75
61
-
## Install steps
76
+
## Installation
62
77
63
-
* Create a place for the script:
78
+
* Create a place for everything:
64
79
65
80
mkdir -p /opt/sagetv/hdhomerun
66
81
chown sagetv:sagetv /opt/sagetv/hdhomerun
@@ -70,31 +85,40 @@ These directions assume a few things:
0 commit comments