For Abertis in TVHeadend, to use the new TVE UHD mux as an example, the kind of thing you have to do is -
1. Create directory /home/hts/Abertis and put the above file
abertis.py inside.
2. Create another file inside /home/hts/Abertis called
tdt.sh - it should have the following contents:
Code:
#!/bin/bash
curl -s http://127.0.0.1:9981/stream/service/$1 | python3 /home/hts/Abertis/abertis.py $2
3. Make sure the files/folder have the right permissions for TVHeadend to execute them -
Code:
sudo chown -R hts:hts /home/hts/Abertis
sudo chmod +x /home/hts/Abertis/tdt.sh
4. Now in TVHeadend, you need to scan the Hispasat muxes if you've not already done so. Then go into Configuration > DVB Inputs > Services
5. Change the 'Hide' dropdown to 'None'
6. Find the 10922V service with SID 1802, and copy the UUID from the play link ( e.g.
http://127.0.0.1:9981/play/ticket/stream/service/17efd118f1f63b813ea011c1610ff1d0 - the bit in bold is the UUID)
7. Use
tvh-json.py to modify the service with the correct details:
https://github.com/tvheadend/tvheadend/blob/master/lib/api/python/tvh-json.py - you'll need to modify tvh-json.py to contain your user details to access the TVH REST API (line #27 and #28 - create a user in TVHeadend first and paste the credentials you've created in the py file on these lines.)
Code:
./tvh-json.py export 17efd118f1f63b813ea011c1610ff1d0 > abertis802.json
File
abertis802.json will contain something like the following -
Code:
{
"pmt": 802,
"force_caid": 0,
"prefcapid": 0,
"stream": [],
"lcn": 0,
"dvb_servicetype": 0,
"dvb_ignore_eit": false,
"verified": 0,
"uuid": "17efd118f1f63b813ea011c1610ff1d0",
"pcr": 0,
"priority": 0,
"sid": 1802,
"pts_shift": 0,
"auto": 0,
"srcid": 0,
"lcn_minor": 0,
"lcn2": 0,
"prefcapid_lock": 0,
"created": 1668812335,
"enabled": true,
"s_type_user": -1,
"last_seen": 1669169044
}
We need to edit that file to force PID 802 to be recognised and decrypted in OSCam.
- We change the service ID to 802 (I use same as Abertis PID for SID, but this can be any non-existing value in the mux. If you don't change it, the changes get wiped by TVH)
- We change the PMT PID to 8000 (fake PMT PID, again to stop TVH from reading the 'real' PMT and wiping the changes)
- We add details into "stream":[] array for the 802 payload PID and CAID so that OSCam decrypts it. Plus we change PCR value also to 802.
- We add a svcname value just so we can see a name in TVHeadend for the service.
- We set "verified" to 1, so TVHeadend doesn't hide the service from us (in older versions this value doesn't exist)
The final file with the edits looks like this -
Code:
{
"pmt": 8000,
"force_caid": 0,
"prefcapid": 0,
"stream": [
{
"type": "H264",
"pid": 802,
"position": 0
},
{
"type": "CA",
"caidlist": [
{
"caid": 9728
}
],
"pid": 8191,
"position": 262144
}
],
"lcn": 0,
"dvb_servicetype": 0,
"dvb_ignore_eit": false,
"verified": 1,
"uuid": "17efd118f1f63b813ea011c1610ff1d0",
"pcr": 802,
"priority": 0,
"sid": 802,
"pts_shift": 0,
"auto": 1,
"srcid": 0,
"lcn_minor": 0,
"lcn2": 0,
"prefcapid_lock": 0,
"created": 1668808494,
"enabled": true,
"s_type_user": -1,
"svcname": "Abertis PID 802",
"last_seen": 1668808494
}
Note: You'll need to do this rather than just copying my examples because your UUIDs will be different to mine, and everything needs to match in your install for it to work.
With the json file edited with the changes, re-import it into TVHeadend using
tvh-json.py :
Code:
./tvh-json.py import abertis802.json
Now you should have a service under 10922V called "Abertis PID 802", this has the same UUID as we copied earlier as we've just edited it.
You'll need the BISS key in OSCam constant.cw to match the fact that we're using the 'fake' service ID 802 and fake PMT 8000, so that will look like this :
Code:
2600:000000:0322:1F40:1FFF:0322:XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX ;Abertis PID 802
8. Next, in TVHeadend we need to add a new IPTV network. Configuration > DVB Inputs > Networks > Add+
Type: IPTV Network
Name: Abertis
Enabled: Ticked
Maximum # input streams: 2
9. We now add a mux to the created IPTV network. Configuration > DVB Inputs > Muxes > Add+
Network: Abertis
URL: pipe:///home/hts/Abertis/tdt.sh
17efd118f1f63b813ea011c1610ff1d0 802
Using your
UUID here, and PID 802.
Mux Name: Abertis PID 802 (or whatever you like!)
Click to add/save.
10. This new mux will be added, we need the link again from the play button for it in Configuration > DVB Inputs > Muxes. e.g.
http://127.0.0.1:9981/play/ticket/stream/mux/dbedb6bee8b066373859df11424b4508
?title=UHD%20%2F%20TDT
Copy the address and remove the bits in
bold and add ?pids=4096 onto the end (not vital, but helps efficiency).
11. In /etc/astra/astra.conf you need to add this mux link as your source for the T2-MI conversion -
Code:
tdtuhd1 = make_t2mi_decap({
name = "TDT UHD T2",
input = "http://127.0.0.1:9981/stream/mux/dbedb6bee8b066373859df11424b4508?pids=4096",
plp = 0,
pnr = 0,
pid = 4096,
})
make_channel({
name = "uhd1",
input = { "t2mi://tdtuhd1", },
output = { "http://0.0.0.0:17981/tdt/uhd1", },
})
Save astra.conf, and restart astra-sm
Code:
sudo systemctl restart astra-sm
12. Now we add another IPTV mux in TVHeadend using the output of Astra-SM. Configuration > DVB Inputs > Muxes > Add+
Network: Abertis
URL:
http://127.0.0.1:17981/tdt/uhd1
Click Save.
Provided that everything worked, playing this new mux should play the TVE UHD mux, it may take a couple of seconds to start because of the decryption steps.