import sys
pid = int(sys.argv[1])
packet = sys.stdin.buffer.read(188)
while packet !="":
tspid = ((packet[1] & 0x1f) << 8) | packet[2]
if tspid == pid :
afc = packet[3] & 0x30
if afc == 0x10 :
sys.stdout.flush()
sys.stdout.buffer.write(packet[4:])
elif afc == 0x30 :
sys.stdout.flush()
sys.stdout.buffer.write(packet[packet[4]+5:])
packet = sys.stdin.buffer.read(188)
mpegts: Abertis PID 702 in Abertis - tuning on IPTV #1
2022-11-28 15:16:36.096 subscription: 0008: "scan" subscribing to mux "Abertis PID 702", weight: 6, adapter: "IPTV #1", network: "Abertis", service: "Raw PID Subscription"
2022-11-28 15:16:36.096 spawn: Executing "/home/hts/Abertis/tdt.sh"
2022-11-28 15:16:37.259 spawn: Traceback (most recent call last):
2022-11-28 15:16:37.259 spawn: File "/home/hts/Abertis/abertis.py", line 9, in
2022-11-28 15:16:37.259 spawn: tspid = ((packet[1] & 0x1f) << 8) | packet[2]
2022-11-28 15:16:37.259 spawn: IndexError: index out of range
2022-11-28 15:16:37.301 iptv: stdin pipe 40 unexpectedly closed: No data
2022-11-28 15:16:51.093 mpegts: Abertis PID 702 in Abertis - scan no data, failed
2022-11-28 15:16:51.093 subscription: 0008: "scan" unsubscribing
{
"sid": 702,
"lcn": 0,
"lcn_minor": 0,
"lcn2": 0,
"srcid": 0,
"dvb_servicetype": 0,
"dvb_ignore_eit": false,
"prefcapid": 0,
"prefcapid_lock": 0,
"force_caid": 0,
"pts_shift": 0,
"created": 1669632706,
"last_seen": 1669632706,
"enabled": true,
"auto": 0,
"priority": 0,
"s_type_user": -1,
"svcname": "Abertis PID 702",
"verified": 1,
"pcr": 702,
"pmt": 8000,
"stream": [
{
"type": "H264",
"pid": 702,
"position": 0
},
{
"pid": 8191,
"type": "CA",
"position": 262144,
"caidlist": [
{
"caid": 9728
}
]
}
],
"uuid": "1a07a33b4b16c59ad969dfe24a463fcf"
}
Settings by MOHAMED_OS
Update: 21_11_2022 thnx @EnoSat ##### Hispasat (30.0°W) ##### # Abertis DTT Sat • streamrelay # - TVE UHD [802] - UHD-2 [802] ##### Turksat (42.0°E) ##### # UltraHD 4K # - TRT 4K # TRT # - TRT 1 HD Transparant_Picon wget...www.sat-universe.com
Hi @Adam792
Can you check if my abertis.py is correct?
i get this error
Mux 12548 V
Ubuntu 20
Tvheadend 4.3.0~pre+202211211947
Oscam-emu (biss verified with tvi Portugal )
Thank and sorry for asking too much
pipe:///home/hts/Abertis/tdt.sh 1a07a33b4b16c59ad969dfe24a463fcf 702
sudo apt install curl
~# opkg install astra-smi' Want to build for AArch64 in enigma
but astra-sm support only ARM & MIPS
// File: abertis.c
// Compilation: gcc abertis.c -O3 -Wall -o abertis
// Installation: install -m 755 -D abertis /usr/local/bin/abertis
#include <stdbool.h> // bool
#include <stdint.h> // uint8_t, uint16_t
#include <stdio.h> // fprintf, stdout, stderr
#include <stdlib.h> // atoi
#define TS_PACKET_SIZE 188
#define TS_MAGIC_HEADER 0x47
#define AFC_PAYLOAD_ONLY 0b01
#define AFC_ADAPTATION_FIELD_WITH_PAYLOAD 0b11
static inline uint8_t payload_starts_at(uint8_t buffer[TS_PACKET_SIZE]) {
uint8_t adaptation_field_control = (buffer[3] & 0b00110000) >> 4;
switch (adaptation_field_control) {
case AFC_PAYLOAD_ONLY:
return 4;
case AFC_ADAPTATION_FIELD_WITH_PAYLOAD:
return 5 + buffer[4];
default:
return TS_PACKET_SIZE;
}
}
static inline bool is_packet_matched(uint8_t buffer[TS_PACKET_SIZE], uint16_t stream_pid) {
uint8_t magic_header = buffer[0];
uint8_t transport_error_indicator = (buffer[1] & 0b10000000) >> 7;
uint16_t packet_identifier = ((buffer[1] & 0b0000000000011111) << 8) | buffer[2];
// uint8_t continuity_counter = buffer[3] & 0b00001111;
bool is_magic_header = magic_header == TS_MAGIC_HEADER;
bool is_tei_ok = transport_error_indicator == 0;
bool is_stream_pid = packet_identifier == stream_pid;
if (!is_tei_ok) {
fprintf(stderr, "transport error indicator flagged!\n");
}
return is_magic_header && is_stream_pid;
}
int main(int argc, char** argv) {
if (argc != 2) {
fprintf(stderr, "abertis de-encapsulator\n"
"usage: %s <pid>\n", argv[0]);
return -1;
}
uint8_t buffer[TS_PACKET_SIZE];
uint16_t stream_pid = atoi(argv[1]);
while (fread(buffer, TS_PACKET_SIZE, 1, stdin)) {
if (is_packet_matched(buffer, stream_pid)) {
uint8_t starts_at = payload_starts_at(buffer);
uint8_t payload_size = TS_PACKET_SIZE - starts_at;
fwrite(buffer + starts_at, payload_size, 1, stdout);
}
}
fprintf(stderr, "end of file reached!\n");
return 0;
}
C:// File: abertis.c // Compilation: gcc abertis.c -O3 -Wall -o abertis // Installation: install -m 755 -D abertis /usr/local/bin/abertis #include <stdbool.h> // bool #include <stdint.h> // uint8_t, uint16_t #include <stdio.h> // fprintf, stdout, stderr #include <stdlib.h> // atoi #define TS_PACKET_SIZE 188 #define TS_MAGIC_HEADER 0x47 #define AFC_PAYLOAD_ONLY 0b01 #define AFC_ADAPTATION_FIELD_WITH_PAYLOAD 0b11 static inline uint8_t payload_starts_at(uint8_t buffer[TS_PACKET_SIZE]) { uint8_t adaptation_field_control = (buffer[3] & 0b00110000) >> 4; switch (adaptation_field_control) { case AFC_PAYLOAD_ONLY: return 4; case AFC_ADAPTATION_FIELD_WITH_PAYLOAD: return 5 + buffer[4]; default: return TS_PACKET_SIZE; } } static inline bool is_packet_matched(uint8_t buffer[TS_PACKET_SIZE], uint16_t stream_pid) { uint8_t magic_header = buffer[0]; uint8_t transport_error_indicator = (buffer[1] & 0b10000000) >> 7; uint16_t packet_identifier = ((buffer[1] & 0b0000000000011111) << 8) | buffer[2]; // uint8_t continuity_counter = buffer[3] & 0b00001111; bool is_magic_header = magic_header == TS_MAGIC_HEADER; bool is_tei_ok = transport_error_indicator == 0; bool is_stream_pid = packet_identifier == stream_pid; if (!is_tei_ok) { fprintf(stderr, "transport error indicator flagged!\n"); } return is_magic_header && is_stream_pid; } int main(int argc, char** argv) { if (argc != 2) { fprintf(stderr, "abertis de-encapsulator\n" "usage: %s <pid>\n", argv[0]); return -1; } uint8_t buffer[TS_PACKET_SIZE]; uint16_t stream_pid = atoi(argv[1]); while (fread(buffer, TS_PACKET_SIZE, 1, stdin)) { if (is_packet_matched(buffer, stream_pid)) { uint8_t starts_at = payload_starts_at(buffer); uint8_t payload_size = TS_PACKET_SIZE - starts_at; fwrite(buffer + starts_at, payload_size, 1, stdout); } } fprintf(stderr, "end of file reached!\n"); return 0; }
[Unit]
Description = ABERTIS service
[Service]
ExecStart = /ect/init.d/astra-sm &
[Install]
WantedBy = multi-user.target
systemctl enable abertis.service
use say 7-Zip for extract files from ipkIn OE 2.5 I need .deb file !
for lamedb I can use ciefp setting !
Done. Can use ciefp setting for lamedb ?try this
1. in Menu - Setup Network WebInterface
"disable anti-hijacking and token-based security in web interface settings" (big thank you again @matt33 and @Rickk)
2. (all files with permission 755) create the abertis.service file in /etc/systemd/system and insert that
3. install astra-sm and libaio from ipkCode:[Unit] Description = ABERTIS service [Service] ExecStart = /ect/init.d/astra-sm & [Install] WantedBy = multi-user.target
4. with command activate service with:
5. with command init 4 stop Enigma, replace with lamedb, init 3 and rebootCode:systemctl enable abertis.service