Skip to content

Commit c01d11d

Browse files
committed
implemented new protocol EXTT (like EXT but opens a TCP socket)
1 parent e5ef0d4 commit c01d11d

23 files changed

+632
-15
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ all-redirect: all
7979
### The object files (add further files here):
8080

8181
OBJS = $(PLUGIN).o common.o config.o device.o pidscanner.o \
82-
protocolcurl.o protocolext.o protocolfile.o protocolhttp.o \
83-
protocoludp.o sectionfilter.o setup.o sidscanner.o socket.o \
82+
protocolcurl.o protocolext.o protocolextt.o protocolfile.o protocolhttp.o \
83+
protocoludp.o protocoltcp.o sectionfilter.o setup.o sidscanner.o socket.o \
8484
protocolm3u.o protocolradio.o protocolstream.o protocolyt.o \
8585
m3u8handler.o process.o process_unix.o streambasehandler.o \
8686
source.o statistics.o streamer.o radioimage.o checkurl.o

README

+11-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Configuration:
9090
RD1:IPTV:80:S=1|P=0|F=RADIO|U=http%3A//wdr-1live-live.icecast.wdr.de/wdr/1live/live/mp3/128/stream.mp3|A=8:I:0:270:271,272,273,274,275:0:0:8:1:9:8
9191
TV7;IPTV:70:S=1|P=0|F=M3U|U=list1.cfg|A=5:I:0:200:201,202,203,204,205:0:0:11:1:100:0
9292
TV6;IPTV:60:S=1|P=0|F=EXT|U=iptvstream.sh|A=0:I:0:0:680:0:0:6:0:0:0
93+
TV7;IPTV:60:S=1|P=0|F=EXTT|U=iptvstreamtcp.sh|A=0:I:0:0:680:0:0:6:0:0:0
9394
TV5;IPTV:50:S=0|P=1|F=FILE|U=/video/stream.ts|A=5:I:0:514:670:2321:0:5:0:0:0
9495
TV4;IPTV:40:S=0|P=1|F=HTTP|U=127.0.0.1/TS/2|A=3000:I:0:513:660:2321:0:4:0:0:0
9596
TV3;IPTV:30:S=1|P=0|F=CURL|U=http%3A//foo%[email protected]%3A3000/TS/2|A=0:I:0:512:650:2321:0:3:0:0:0
@@ -104,6 +105,7 @@ Configuration:
104105
| | | | | HTTP: HTTP port number
105106
| | | | | FILE: file delay (ms)
106107
| | | | | EXT: script parameter
108+
| | | | | EXTT: script parameter
107109
| | | | | M3U: Y=1 uses yt-dlp to determine the video URL
108110
| | | | | Y=2 tries to find the video URL internally
109111
| | | | | H=F uses ffmpeg
@@ -120,13 +122,14 @@ Configuration:
120122
| | | | CURL: HTTP/HTTPS URL; colons (%3A) and pipes (%7C) shall be URL encoded
121123
| | | | HTTP: URL; missing the scheme name part and possible port declaration
122124
| | | | FILE: file location
123-
| | | | EXT: script location
125+
| | | | EXT: script location (uses UDP)
126+
| | | | EXTT: script location (uses TCP)
124127
| | | | M3U: m3u playlist
125128
| | | | M3US: m3u URL
126129
| | | | RADIO: An URL for a radio stream
127130
| | | | STREAM: An URL for a video stream
128131
| | | | YT: URL (e.g. youtube or any other which is support by yt-dlp)
129-
| | | Stream protocol ("UDP", "CURL", "HTTP", "FILE", "EXT", "M3U", "M3US", "RADIO", "STREAM", "YT")
132+
| | | Stream protocol ("UDP", "CURL", "HTTP", "FILE", "EXT", "EXTT", "M3U", "M3US", "RADIO", "STREAM", "YT")
130133
| | Pid scanner ("0" disable, "1" enable)
131134
| Section id (Sid/Nid/Tid) scanner ("0" disable, "1" enable)
132135
Unique enumeration
@@ -156,6 +159,12 @@ External streaming:
156159
port. The data will be processed in VDR like a normal DVB broadcast. The
157160
listening base port can be specified in the plugin configuration menu.
158161

162+
- When an EXTT channel is opened the IPTV plugin opens an TCP
163+
listening port on the localhost. The external script is responsible for
164+
supplying IPTV plugin with MPEG2 TS data in TCP format to the listening
165+
port. The data will be processed in VDR like a normal DVB broadcast. The
166+
listening base port can be specified in the plugin configuration menu.
167+
159168
- Each IPTV device has different listen port. The port number is specified
160169
as a base port number plus IPTV device index minus one. Maximum of 8 IPTV
161170
devices can be used simultaneously.

device.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ cIptvDevice::cIptvDevice(unsigned int indexP)
3939
pHttpProtocolM = new cIptvProtocolHttp();
4040
pFileProtocolM = new cIptvProtocolFile();
4141
pExtProtocolM = new cIptvProtocolExt();
42+
pExtTProtocolM = new cIptvProtocolExtT();
4243
pM3UProtocolM = new cIptvProtocolM3U();
4344
pRadioProtocolM = new cIptvProtocolRadio();
4445
pStreamProtocolM = new cIptvProtocolStream();
@@ -75,6 +76,7 @@ cIptvDevice::~cIptvDevice() {
7576
DELETE_POINTER(pPidScannerM);
7677
DELETE_POINTER(pIptvStreamerM);
7778
DELETE_POINTER(pExtProtocolM);
79+
DELETE_POINTER(pExtTProtocolM);
7880
DELETE_POINTER(pFileProtocolM);
7981
DELETE_POINTER(pHttpProtocolM);
8082
DELETE_POINTER(pCurlProtocolM);
@@ -317,7 +319,11 @@ bool cIptvDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP) {
317319
protocol = pExtProtocolM;
318320
break;
319321

320-
case cIptvTransponderParameters::eProtocolM3U:
322+
case cIptvTransponderParameters::eProtocolEXTT:
323+
protocol = pExtTProtocolM;
324+
break;
325+
326+
case cIptvTransponderParameters::eProtocolM3U:
321327
case cIptvTransponderParameters::eProtocolM3US:
322328
protocol = pM3UProtocolM;
323329
break;

device.h

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "protocolhttp.h"
1616
#include "protocolfile.h"
1717
#include "protocolext.h"
18+
#include "protocolextt.h"
1819
#include "protocolm3u.h"
1920
#include "protocolradio.h"
2021
#include "protocolstream.h"
@@ -49,6 +50,7 @@ class cIptvDevice : public cDevice, public cIptvPidStatistics, public cIptvBuffe
4950
cIptvProtocolHttp *pHttpProtocolM;
5051
cIptvProtocolFile *pFileProtocolM;
5152
cIptvProtocolExt *pExtProtocolM;
53+
cIptvProtocolExtT *pExtTProtocolM;
5254
cIptvProtocolM3U *pM3UProtocolM;
5355
cIptvProtocolRadio *pRadioProtocolM;
5456
cIptvProtocolStream *pStreamProtocolM;

iptv/iptvstreamtcp.sh

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/sh
2+
#
3+
# iptvstream.sh can be used by the VDR iptv plugin to transcode external
4+
# sources
5+
#
6+
# (C) 2007 Rolf Ahrenberg, Antti Seppälä
7+
#
8+
# iptvstream.sh is free software; you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation; either version 2 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# This package is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU General Public License
19+
# along with this package; if not, write to the Free Software
20+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21+
# MA 02110-1301, USA.
22+
23+
if [ $# -ne 2 ]; then
24+
logger "$0: error: Invalid parameter count '$#' $*"
25+
exit 1
26+
fi
27+
28+
# Channels.conf parameter
29+
PARAMETER=${1}
30+
31+
# Iptv plugin listens this port
32+
PORT=${2}
33+
34+
# There is a way to specify multiple URLs in the same script. The selection is
35+
# then controlled by the extra parameter passed by IPTV plugin to the script
36+
case ${PARAMETER} in
37+
1)
38+
URL="https://sdn-global-live-streaming-packager-cache.3qsdn.com/64733/64733_264_live.m3u8"
39+
;;
40+
2)
41+
URL=""
42+
;;
43+
3)
44+
URL=""
45+
;;
46+
*)
47+
URL="" # Default URL
48+
;;
49+
esac
50+
51+
if [ -z "${URL}" ]; then
52+
logger "$0: error: URL not defined!"
53+
exit 1
54+
fi
55+
56+
# Create unique pids for the stream
57+
VPID=${PARAMETER}+1
58+
APID=${PARAMETER}+2
59+
SPID=${PARAMETER}+3
60+
61+
ffmpeg -re -hide_banner -i "${URL}" -c:v copy -c:a aac -f mpegts tcp://127.0.0.1:${PORT} &
62+
63+
PID=${!}
64+
65+
trap 'kill -INT ${PID} 2> /dev/null' INT EXIT QUIT TERM
66+
67+
# Waiting for the given PID to terminate
68+
wait ${PID}

po/ca_ES.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: vdr-iptv 2.4.0\n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
10+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1111
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1212
"Last-Translator: Gabriel Bonich <[email protected]>\n"
1313
"Language-Team: Catalan <[email protected]>\n"
@@ -139,6 +139,9 @@ msgstr "ARXIU"
139139
msgid "EXT"
140140
msgstr "EXT"
141141

142+
msgid "EXTT"
143+
msgstr "EXTT"
144+
142145
msgid "M3U"
143146
msgstr "M3U"
144147

po/de_DE.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: vdr-iptv 2.4.0\n"
1010
"Report-Msgid-Bugs-To: <see README>\n"
11-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
11+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1212
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1313
"Last-Translator: Frank Neumann <[email protected]>\n"
1414
"Language-Team: German <[email protected]>\n"
@@ -140,6 +140,9 @@ msgstr "DATEI"
140140
msgid "EXT"
141141
msgstr "EXT"
142142

143+
msgid "EXTT"
144+
msgstr "EXTT"
145+
143146
msgid "M3U"
144147
msgstr "M3U"
145148

po/es_ES.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: vdr-iptv 2.4.0\n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
10+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1111
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1212
"Last-Translator: Gabriel Bonich <[email protected]>\n"
1313
"Language-Team: Spanish <[email protected]>\n"
@@ -139,6 +139,9 @@ msgstr "ARCHIVO"
139139
msgid "EXT"
140140
msgstr "EXT"
141141

142+
msgid "EXTT"
143+
msgstr "EXTT"
144+
142145
msgid "M3U"
143146
msgstr "M3U"
144147

po/fi_FI.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: vdr-iptv 2.4.0\n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
10+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1111
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1212
"Last-Translator: Rolf Ahrenberg\n"
1313
"Language-Team: Finnish <[email protected]>\n"
@@ -138,6 +138,9 @@ msgstr "FILE"
138138
msgid "EXT"
139139
msgstr "EXT"
140140

141+
msgid "EXTT"
142+
msgstr "EXTT"
143+
141144
msgid "M3U"
142145
msgstr "M3U"
143146

po/fr_FR.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: vdr-iptv 2.4.0\n"
1010
"Report-Msgid-Bugs-To: <see README>\n"
11-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
11+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1212
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1313
"Last-Translator: NIVAL Michaël <[email protected]>\n"
1414
"Language-Team: French <[email protected]>\n"
@@ -140,6 +140,9 @@ msgstr "FICHIER"
140140
msgid "EXT"
141141
msgstr "EXT"
142142

143+
msgid "EXTT"
144+
msgstr "EXTT"
145+
143146
msgid "M3U"
144147
msgstr "M3U"
145148

po/it_IT.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: vdr-iptv 2.4.0\n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
10+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1111
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1212
"Last-Translator: Diego Pierotto <[email protected]>\n"
1313
"Language-Team: Italian <[email protected]>\n"
@@ -139,6 +139,9 @@ msgstr "FILE"
139139
msgid "EXT"
140140
msgstr "EXT"
141141

142+
msgid "EXTT"
143+
msgstr "EXTT"
144+
142145
msgid "M3U"
143146
msgstr "M3U"
144147

po/lt_LT.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: vdr-iptv 2.4.0\n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
10+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1111
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1212
"Last-Translator: Valdemaras Pipiras\n"
1313
"Language-Team: Lithuanian <[email protected]>\n"
@@ -138,6 +138,9 @@ msgstr "FAILAS"
138138
msgid "EXT"
139139
msgstr "EXT"
140140

141+
msgid "EXTT"
142+
msgstr "EXTT"
143+
141144
msgid "M3U"
142145
msgstr "M3U"
143146

po/nl_NL.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: vdr-iptv 2.4.0\n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
10+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1111
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1212
"Last-Translator: Carel\n"
1313
"Language-Team: Dutch <[email protected]>\n"
@@ -138,6 +138,9 @@ msgstr "BESTAND"
138138
msgid "EXT"
139139
msgstr "EXT"
140140

141+
msgid "EXTT"
142+
msgstr "EXTT"
143+
141144
msgid "M3U"
142145
msgstr "M3U"
143146

po/pl_PL.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: vdr-iptv 2.4.0\n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
10+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1111
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1212
"Last-Translator: Tomasz Maciej Nowak <[email protected]>\n"
1313
"Language-Team: Polish <[email protected]>\n"
@@ -139,6 +139,9 @@ msgstr "PLIK"
139139
msgid "EXT"
140140
msgstr "EXT"
141141

142+
msgid "EXTT"
143+
msgstr "EXTT"
144+
142145
msgid "M3U"
143146
msgstr "M3U"
144147

po/ru_RU.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: vdr-iptv 2.4.0\n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2024-11-27 19:44+0100\n"
10+
"POT-Creation-Date: 2025-01-30 20:29+0100\n"
1111
"PO-Revision-Date: 2018-04-15 04:15+0300\n"
1212
"Last-Translator: Alexander Gross <[email protected]>\n"
1313
"Language-Team: Russian <[email protected]>\n"
@@ -130,6 +130,9 @@ msgstr "ФАЙЛ"
130130
msgid "EXT"
131131
msgstr "EXT"
132132

133+
msgid "EXTT"
134+
msgstr "EXTT"
135+
133136
msgid "M3U"
134137
msgstr "M3U"
135138

0 commit comments

Comments
 (0)