How to integrate OScam with TVHeadend

OScamThis guide details how to integrate OScam with TVHeadend to enable decryption of pay TV channels within TVHeadend. The guide does not deal with the configuration of cards (local or otherwise) on the OScam side and is in no way intended to promote piracy of pay TV. You should use this guide to decrypt channels for which you have a legitimate subscription for.

Configuring OScam

The first part of the guide deals with setting up OScam to allow TVHeadend to request decryption keys for encrypted channels.

Create a new user to allow TVHeadend to talk to OScam

Click on the Users tab at the top of the OScam screen
Click on the ‘Add Users’ link
Configure a user similar to below;

user                          = tvheadend
pwd                           = tvheadend
monlevel                      = 4
group                         = 1
max_connections               = 99

Configure DVBAPI

DVBAPI allows TVHeadend to communicate with OScam over TCP

Click on the Config tab at the top of the screen
Click on the DVB-Api link
Configure DVBAPI as per the below;

enabled                       = 1
pmt_mode                      = 0
listen_port                   = 9001 # or whatever port you want if 9001 is taken
ecminfo_type                  = 4
user                          = tvheadend # user should match the user created above
read_sdt                      = 1
boxtype                       = pc

Before leaving OScam, you should configure at least one card to provide the decryption keys to TVHeadend. This is outside of the scope of this guide but you will need one card for each CAID that you wish to decrypt in TVHeadend. If you use multiple providers, you will need at least one card for each providers channels you wish to decrypt.

Configuring TVHeadendTVHeadend CA Client

Next we switch to TVHeadend to make the link back to OScam.

Log in to TVHeadend with a user with admin permissions
Navigate to Configuration > CA’s
Click on the Add button
Select CAPMT (Linux Network DVBAPI) from the drop down list
Configure the client as per the below;

Enabled: True
Client name: OSCam # or whatever you like
Mode: OSCam net protocol (rev >= 10389)
Camd.socket filename / IP Address (TCP mode): 127.0.0.1 # the IP address of the machine running OScam - 127.0.0.1 is localhost so if both OScam and TVHeadend are on the same machine, this is fine
Listen / Connect port: 9001 # must match the port number above

Click the Create button

The icon to the left hand side of the newly created CA client should show a green tick – if this isn’t the case, go back and double check your settings. Also make sure that port 9000 isn’t blocked on the machine running OScam.

Posted in TVHeadend Tagged with: ,