threefive 3.0.91__tar.gz → 3.0.95__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {threefive-3.0.91 → threefive-3.0.95}/PKG-INFO +212 -329
- {threefive-3.0.91 → threefive-3.0.95}/README.md +211 -328
- {threefive-3.0.91 → threefive-3.0.95}/pyproject.toml +1 -2
- {threefive-3.0.91 → threefive-3.0.95}/threefive/__init__.py +3 -13
- {threefive-3.0.91 → threefive-3.0.95}/threefive/base.py +19 -17
- {threefive-3.0.91 → threefive-3.0.95}/threefive/cli.py +74 -49
- {threefive-3.0.91 → threefive-3.0.95}/threefive/descriptors.py +4 -4
- {threefive-3.0.91 → threefive-3.0.95}/threefive/gums.py +11 -13
- {threefive-3.0.91 → threefive-3.0.95}/threefive/hls.py +10 -10
- {threefive-3.0.91 → threefive-3.0.95}/threefive/new_reader.py +5 -4
- {threefive-3.0.91 → threefive-3.0.95}/threefive/segment.py +3 -10
- {threefive-3.0.91 → threefive-3.0.95}/threefive/stream.py +96 -144
- {threefive-3.0.91 → threefive-3.0.95}/threefive/throttle.py +4 -3
- {threefive-3.0.91 → threefive-3.0.95}/threefive/udp.py +2 -2
- {threefive-3.0.91 → threefive-3.0.95}/threefive/version.py +1 -1
- {threefive-3.0.91 → threefive-3.0.95}/threefive.egg-info/PKG-INFO +212 -329
- {threefive-3.0.91 → threefive-3.0.95}/threefive.egg-info/entry_points.txt +0 -1
- {threefive-3.0.91 → threefive-3.0.95}/LICENSE +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/setup.cfg +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/aac.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/bitn.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/bump.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/commands.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/crc.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/crctable.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/cue.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/encode.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/hlsprofile.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/hlstags.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/iframes.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/packetdata.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/pmt.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/section.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/segmentation.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/sixfix.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/speedo.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/streamtypes.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/stuff.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/superkabuki.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/upids.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/uxp.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive/xml.py +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive.egg-info/SOURCES.txt +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive.egg-info/dependency_links.txt +0 -0
- {threefive-3.0.91 → threefive-3.0.95}/threefive.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: threefive
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.95
|
|
4
4
|
Summary: threefive is The #1 SCTE-35 Decoder and Encoder on the Planet.
|
|
5
5
|
Author-email: AdrianofDoom <spam@iodisco.com>
|
|
6
6
|
License-Expression: Sleepycat
|
|
@@ -17,58 +17,81 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Dynamic: license-file
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
[A Lot of Examples ](https://github.com/superkabuki/threefive_is_scte35/blob/main/examples) | [ Tip of the Week ](totw.md) | [ Cheap Tricks ](cheaptricks.md)
|
|
21
|
+
# [ threefive ]
|
|
21
22
|
|
|
23
|
+
* __Decodes SCTE-35__ from `MPEGTS`✔ `Base64`✔ `Bytes`✔ `DASH`✔ `Hex` ✔ `HLS`✔ `Integers`✔ `JSON`✔ `XML`✔ `XML+Binary`✔
|
|
24
|
+
* __Encodes SCTE-35__ to `MPEGTS`✔ `Base64`✔ `Bytes`✔ `Hex`✔ `Integers`✔ `JSON`✔ `XML`✔ `XML+Binary`✔
|
|
25
|
+
# [ version ]
|
|
26
|
+
### __latest is v.3.0.95__
|
|
22
27
|
|
|
23
|
-
<img width="1000" height="748" alt="100_0033" src="https://github.com/user-attachments/assets/dc967211-35d4-4aa5-af75-ce6099207946" />
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
# [ really really quick start ]
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
* __Install__
|
|
32
|
+
```
|
|
33
|
+
python3 -m pip install threefive`
|
|
34
|
+
```
|
|
35
|
+
* decode SCTE-35 __base64__
|
|
36
|
+
```sed
|
|
37
|
+
threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q=='
|
|
38
|
+
```
|
|
39
|
+
* decode SCTE-35 __hex__
|
|
40
|
+
```sed
|
|
41
|
+
threefive 0xfc301600000000000000fff00506fe00a98ac700000b3baed9
|
|
42
|
+
```
|
|
43
|
+
* decode SCTE-35 from __MPEGTS__
|
|
44
|
+
```sed
|
|
45
|
+
threefive https;//iodisco.com/longb2.ts
|
|
46
|
+
```
|
|
47
|
+
* decode SCTE-35 from __HLS__ ( a rendition or a master.m3u8)
|
|
48
|
+
```sed
|
|
49
|
+
threefive https://demo.unified-streaming.com/k8s/live/scte35.isml/.m3u8
|
|
50
|
+
```
|
|
28
51
|
|
|
29
|
-
*
|
|
30
|
-
*
|
|
52
|
+
* __threefive does a lot more__, that was just to get you started.
|
|
53
|
+
* RTFM
|
|
31
54
|
___
|
|
32
55
|
|
|
33
|
-
## [ News ]
|
|
34
56
|
|
|
35
|
-
* threefive now has support for SCTE-35-2. __Event Descriptors__ and __Property__ types from __the recently published 2026 SCTE-35 Specification can be decoded, modified, and encoded with threefive.
|
|
36
|
-
___
|
|
37
|
-
|
|
38
|
-
## [ Latest version is v3.0.91 ]
|
|
39
|
-
___
|
|
40
57
|
|
|
41
58
|
|
|
42
59
|
# [ Documentation ]
|
|
43
60
|
#### Need to inject SCTE-35 into HLS? [X9k3.](https://github.com/superkabuki/x9k3)
|
|
44
61
|
* [__web based SCTE-35 tools__](#web) - threefive and friends over http.
|
|
45
62
|
* [__install__](#install)
|
|
46
|
-
* [__quick start__](
|
|
47
|
-
*
|
|
48
|
-
* [
|
|
49
|
-
|
|
63
|
+
* [__quick start__](quickstart.md)
|
|
64
|
+
* ___SCTE-35 on the command line___
|
|
65
|
+
* [ __the threefive cli tool__](#-cli-) _If you work with SCTE-35, this is as cool as it gets.
|
|
66
|
+
* __other included tools__
|
|
67
|
+
* [__scte35bump__](#scte35bump) _adjust SCTE-35 PTS in MPEGTS streams_
|
|
50
68
|
* [__scte35fix__](#scte35fix) _ffmpeg changes scte-35 streams into bin data, scte35fix changes them back._
|
|
51
|
-
* [__scte35hls__](#scte35hls) _scte35hls parses hls and ABR hls for scte-35. All hls scte-35 tags are supported__
|
|
52
69
|
* [__scte35inject__](scte35inject.md) _scte35inject inject scte-35 into mpegts._
|
|
53
70
|
* [__gums__](#gums) _gums is a multicast sender(server) for video_
|
|
54
|
-
*
|
|
55
|
-
* [__Using the threefive.Cue class__](
|
|
56
|
-
* [__Using the threefive library__](
|
|
71
|
+
* __the threefive library__ _cool code for the cool kids_.
|
|
72
|
+
* [__Using the threefive.Cue class__](lib.md)
|
|
73
|
+
* [__Using the threefive library__](#-using-the-library-) _decode SCTE-35 with less than ten lines of code_
|
|
57
74
|
* * [threefive __Classes__](#classes) _threefive is OO, made to subclass_
|
|
58
75
|
* [__Cue__ Class](https://github.com/superkabuki/threefive/blob/main/cue.md) _this class you'll use often_
|
|
59
76
|
* [__Stream__ Class](https://github.com/superkabuki/threefive/blob/main/stream.md) _this is the class for parsing MPEGTS_
|
|
60
77
|
* [SCTE-35 __Sidecar Files__](https://github.com/superkabuki/SCTE-35_Sidecar_Files) _threefive supports SCTE-35 sidecar files_
|
|
61
|
-
* [SCTE-35 __HLS__](https://github.com/superkabuki/threefive/blob/main/hls.md) _parse SCTE-35 in
|
|
78
|
+
* [SCTE-35 __HLS__](https://github.com/superkabuki/threefive/blob/main/hls.md) _parse SCTE-35 in HLS in MPEGTS,CMAF, or fmP4__
|
|
62
79
|
* [SCTE-35 __XML__ ](https://github.com/superkabuki/SCTE-35/blob/main/xml.md) and [More __XML__](node.md) _threefive can parse and encode SCTE-35 xml_
|
|
63
80
|
* [__Encode__ SCTE-35](https://github.com/superkabuki/threefive/blob/main/encode.md) _threefive can encode SCTE-35 in every SCTE-35 format_
|
|
64
81
|
* [Make your __threefive__ script an executable with __cython__](cython.md) _threefive is compatible with all python tools_
|
|
65
82
|
</samp>
|
|
66
83
|
|
|
67
84
|
## [Install]
|
|
85
|
+
* __threefive__ is curretnly tested on python-3.11, python-3.14, python-3.14t, pypy-7.3.11 and pypy-7.3.22
|
|
86
|
+
|
|
87
|
+
* __threefive__ is some of the __fastest code__ you'll see on __python3__.
|
|
68
88
|
* __python3 via pip__
|
|
69
89
|
```rebol
|
|
70
90
|
python3 -mpip install threefive
|
|
71
91
|
```
|
|
92
|
+
|
|
93
|
+
* __threefive__ runs __five times faster on pypy3__,
|
|
94
|
+
* __threefive on pypy3__ can parse __mpegts__ at __over 1.5 GigaBytes__ a second, __single-threaded__.
|
|
72
95
|
* __pypy3 via pip__
|
|
73
96
|
```rebol
|
|
74
97
|
pypy3 -mpip install threefive
|
|
@@ -103,254 +126,28 @@ make install py3=python3.14
|
|
|
103
126
|
# works for any python in your path or use a full path if needed.
|
|
104
127
|
|
|
105
128
|
```
|
|
106
|
-
|
|
107
|
-
___
|
|
108
|
-
|
|
109
|
-
# [⇧](#-documentation-)
|
|
110
|
-
|
|
111
|
-
## [Quick Start]
|
|
112
|
-
<i>These examples show how to parse SCTE-35<BR>
|
|
113
|
-
from various SCTE-35 data formats, with both the cli and with the library.</i>
|
|
114
|
-
<details><summary>MPEGTS</summary>
|
|
115
|
-
|
|
116
|
-
* MPEGTS streams can be Files, Http(s), Multicast,SRT, UDP Unicast, or stdin.
|
|
117
|
-
* __cli__
|
|
118
|
-
|
|
119
|
-
```js
|
|
120
|
-
threefive https://example.com/video.ts
|
|
121
|
-
```
|
|
122
|
-
* wildcards work too.
|
|
123
|
-
```js
|
|
124
|
-
threefive /mpegts/*.ts
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
* __lib__
|
|
128
|
-
```py3
|
|
129
|
-
|
|
130
|
-
from threefive import Stream
|
|
131
|
-
stream = Stream('https://example.com/video.ts')
|
|
132
|
-
stream.decode()
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
</details>
|
|
136
|
-
<details><summary>Base64</summary>
|
|
137
|
-
|
|
138
|
-
* __cli__
|
|
139
|
-
```js
|
|
140
|
-
threefive '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='
|
|
141
|
-
```
|
|
142
|
-
* __lib__
|
|
143
|
-
```py3
|
|
144
|
-
|
|
145
|
-
from threefive import Cue
|
|
146
|
-
data = '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='
|
|
147
|
-
cue=Cue(data)
|
|
148
|
-
cue.show()
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
</details>
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<details><summary>Bytes</summary>
|
|
155
|
-
|
|
156
|
-
* __cli__
|
|
157
|
-
* Bytes don't work on the cli
|
|
158
|
-
|
|
159
|
-
* __lib__
|
|
160
|
-
```py3
|
|
161
|
-
|
|
162
|
-
from threefive import Cue
|
|
163
|
-
data = b'\xfc0\x16\x00\x00\x00\x00\x00\x00\x00\xff\xf0\x05\x06\xfe\x00\xc0D\xa0\x00\x00\x00\xb5k\x88'
|
|
164
|
-
cue=Cue(data)
|
|
165
|
-
cue.show()
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
</details>
|
|
169
|
-
|
|
170
|
-
<details><summary>Hex</summary>
|
|
171
|
-
|
|
172
|
-
* Can be a hex literal or hex string or bytes.
|
|
173
|
-
|
|
174
|
-
* __cli__
|
|
175
|
-
```js
|
|
176
|
-
threefive 0xfc301600000000000000fff00506fed605225b0000b0b65f3b
|
|
177
|
-
```
|
|
178
|
-
* __lib__
|
|
179
|
-
```py3
|
|
180
|
-
|
|
181
|
-
from threefive import Cue
|
|
182
|
-
data = 0xfc301600000000000000fff00506fed605225b0000b0b65f3b
|
|
183
|
-
cue=Cue(data)
|
|
184
|
-
cue.show()
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
</details>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
<details><summary>Int</summary>
|
|
191
|
-
|
|
192
|
-
* Can be a literal integer or string or bytes.
|
|
193
|
-
|
|
194
|
-
* __cli__
|
|
195
|
-
```js
|
|
196
|
-
threefive 1583008701074197245727019716796221243043855984942057168199483
|
|
197
|
-
```
|
|
198
|
-
* __lib__
|
|
199
|
-
```py3
|
|
200
|
-
|
|
201
|
-
from threefive import Cue
|
|
202
|
-
data = 1583008701074197245727019716796221243043855984942057168199483
|
|
203
|
-
cue=Cue(data)
|
|
204
|
-
cue.show()
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
</details>
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
<details><summary>JSON</summary>
|
|
212
|
-
|
|
213
|
-
* __cli__
|
|
214
|
-
* put JSON SCTE-35 in a file and redirect it into threefive
|
|
215
|
-
* cat files to threefive works too.
|
|
216
|
-
* echo JSON or type JSON on the command line.
|
|
217
|
-
|
|
218
|
-
```js
|
|
219
|
-
threefive < json.json
|
|
220
|
-
```
|
|
221
|
-
* __lib__
|
|
222
|
-
|
|
223
|
-
```py3
|
|
224
|
-
|
|
225
|
-
from threefive import Cue
|
|
226
|
-
data = '''{
|
|
227
|
-
"info_section": {
|
|
228
|
-
"table_id": "0xfc",
|
|
229
|
-
"section_syntax_indicator": false,
|
|
230
|
-
"private": false,
|
|
231
|
-
"sap_type": "0x03",
|
|
232
|
-
"sap_details": "No Sap Type",
|
|
233
|
-
"section_length": 22,
|
|
234
|
-
"protocol_version": 0,
|
|
235
|
-
"encrypted_packet": false,
|
|
236
|
-
"encryption_algorithm": 0,
|
|
237
|
-
"pts_adjustment": 0.0,
|
|
238
|
-
"cw_index": "0x00",
|
|
239
|
-
"tier": "0x0fff",
|
|
240
|
-
"splice_command_length": 5,
|
|
241
|
-
"splice_command_type": 6,
|
|
242
|
-
"descriptor_loop_length": 0,
|
|
243
|
-
"crc": "0xb56b88"
|
|
244
|
-
},
|
|
245
|
-
"command": {
|
|
246
|
-
"command_length": 5,
|
|
247
|
-
"command_type": 6,
|
|
248
|
-
"name": "Time Signal",
|
|
249
|
-
"time_specified_flag": true,
|
|
250
|
-
"pts_time": 140.005333
|
|
251
|
-
},
|
|
252
|
-
"descriptors": []
|
|
253
|
-
}
|
|
254
|
-
'''
|
|
255
|
-
cue=Cue(data)
|
|
256
|
-
cue.show()
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
</details>
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
<details><summary><u>Xml</u></summary>
|
|
263
|
-
|
|
264
|
-
* __cli__
|
|
265
|
-
* put xml SCTE-35 in a [file](xml.xml) and redirect it into threefive
|
|
266
|
-
* cat files to threefive works too.
|
|
267
|
-
* echo xml or type xml on the command line.
|
|
268
|
-
|
|
269
|
-
```js
|
|
270
|
-
threefive < xml.xml
|
|
271
|
-
```
|
|
272
|
-
* __lib__
|
|
273
|
-
```py3
|
|
274
|
-
from threefive import Cue
|
|
275
|
-
data = '''
|
|
276
|
-
<scte35:SpliceInfoSection xmlns:scte35="https://scte.org/schemas/35"
|
|
277
|
-
ptsAdjustment="0" protocolVersion="0" sapType="3" tier="4095">
|
|
278
|
-
<scte35:TimeSignal>
|
|
279
|
-
<scte35:SpliceTime ptsTime="12600480"/>
|
|
280
|
-
</scte35:TimeSignal>
|
|
281
|
-
</scte35:SpliceInfoSection>
|
|
282
|
-
'''
|
|
283
|
-
cue=Cue(data)
|
|
284
|
-
|
|
285
|
-
cue.show()
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
</details>
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
<details><summary>Xml+binary</summary>
|
|
294
|
-
|
|
295
|
-
* __cli__
|
|
296
|
-
* write xml+binary to a [file](xmlbin.xml) and redirect it to threefive
|
|
297
|
-
* cat files to threefive works too.
|
|
298
|
-
* echo xml+binary or type xml+binary on the command line.
|
|
299
|
-
```js
|
|
300
|
-
threefive < xmlbin.xml
|
|
301
|
-
```
|
|
302
|
-
* __lib__
|
|
303
|
-
```py3
|
|
304
|
-
|
|
305
|
-
from threefive import Cue
|
|
306
|
-
data = '''<scte35:Signal xmlns:scte35="https://scte.org/schemas/35">
|
|
307
|
-
<scte35:Binary>/DAWAAAAAAAAAP/wBQb+AMBEoAAAALVriA==</scte35:Binary>
|
|
308
|
-
</scte35:Signal>
|
|
309
|
-
'''
|
|
310
|
-
cue=Cue(data)
|
|
311
|
-
cue.show()
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
</details>
|
|
315
|
-
|
|
316
|
-
</samp>
|
|
317
|
-
|
|
129
|
+
#### [⇧](#-documentation-)
|
|
318
130
|
___
|
|
319
131
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
*
|
|
332
|
-
* __SCTE-35 Output__: JSON _(default)_ base64, bytes, hex, int, xml, and xmlbin.
|
|
333
|
-
|
|
334
|
-
|SCTE-35 Input | Protocol | SCTE-35 Output | Command |
|
|
335
|
-
|-------|------------|-----------|---------------------------------------------------------|
|
|
336
|
-
|__MPEGTS__|file|__JSON__ | __threefive__ video.ts |
|
|
337
|
-
|__.__|https|__base64__ | __threefive__ https://example.com/video.ts __base64__ |
|
|
338
|
-
|__.__|multicast|__bytes__ | __threefive__ udp://@235.3.5:3535 __bytes__ |
|
|
339
|
-
|__.__|SRT|__hex__ | __threefive__ srt://1.2.3.4:4201 __hex__ |
|
|
340
|
-
|__.__|UDP|__int__ | __threefive__ udp://10.10.10.10:1011 __int__ |
|
|
341
|
-
|__.__|Pipe|__xml__| cat video.ts \| __threefive__ __xml__ |
|
|
342
|
-
|__.__|stdin|__xml+bin__| __threefive__ __xmlbin__ < video.ts|
|
|
343
|
-
|
|
132
|
+
## [ CLI ]
|
|
133
|
+
* The threefive cli tool parses these SCTE-35 formats.
|
|
134
|
+
* Base64
|
|
135
|
+
* Hex
|
|
136
|
+
* HLS
|
|
137
|
+
* Integers
|
|
138
|
+
* JSON
|
|
139
|
+
* MPEGTS
|
|
140
|
+
* XML
|
|
141
|
+
* XMLBinary.
|
|
142
|
+
|
|
143
|
+
* Formats are auto-detected.
|
|
344
144
|
___
|
|
345
145
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
#### [ Parse SCTE-35 Cues ]
|
|
349
|
-
|
|
350
|
-
* The __default output__ is JSON
|
|
146
|
+
* __Parse SCTE-35 Cues__
|
|
351
147
|
* __SCTE-35 Inputs:__ base64, hex, int, JSON,int,xml,and xmlbin.
|
|
352
148
|
* __SCTE-35 Outputs:__ base64, bytes, hex, int,JSON, xml, and xmlbin.
|
|
353
149
|
* __Any Input can be used with Any Output__
|
|
150
|
+
* The __default output__ is JSON
|
|
354
151
|
|
|
355
152
|
> __Here are several examples.__
|
|
356
153
|
|
|
@@ -375,12 +172,37 @@ ___
|
|
|
375
172
|
|
|
376
173
|
___
|
|
377
174
|
|
|
378
|
-
|
|
175
|
+
* __Parse SCTE-35 from HLS__
|
|
176
|
+
```awk
|
|
177
|
+
threefive https://example.com/master.m3u8
|
|
178
|
+
```
|
|
179
|
+
___
|
|
180
|
+
|
|
181
|
+
* __Parse SCTE-35 from MPEGTS__
|
|
182
|
+
* SCTE-35 can be parsed from MPEGTS over a variety of protocols.
|
|
183
|
+
* __SCTE-35 Input__: MPEGTS
|
|
184
|
+
* __Protocols__: pipes, files, stdin, http(s), multicast,SRT and UDP.
|
|
185
|
+
* __SCTE-35 Output__: JSON _(default)_ base64, bytes, hex, int, xml, and xmlbin.
|
|
186
|
+
|
|
187
|
+
|SCTE-35 Input | Protocol | SCTE-35 Output | Command |
|
|
188
|
+
|-------|------------|-----------|---------------------------------------------------------|
|
|
189
|
+
|__MPEGTS__|file|__JSON__ | __threefive__ video.ts |
|
|
190
|
+
|__.__|https|__base64__ | __threefive__ https://example.com/video.ts __base64__ |
|
|
191
|
+
|__.__|multicast|__bytes__ | __threefive__ udp://@235.3.5:3535 __bytes__ |
|
|
192
|
+
|__.__|SRT|__hex__ | __threefive__ srt://1.2.3.4:4201 __hex__ |
|
|
193
|
+
|__.__|UDP|__int__ | __threefive__ udp://10.10.10.10:1011 __int__ |
|
|
194
|
+
|__.__|Pipe|__xml__| cat video.ts \| __threefive__ __xml__ |
|
|
195
|
+
|__.__|stdin|__xml+bin__| __threefive__ __xmlbin__ < video.ts|
|
|
196
|
+
|
|
197
|
+
___
|
|
379
198
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
*
|
|
199
|
+
|
|
200
|
+
#### [⇧](#-documentation-)
|
|
201
|
+
|
|
202
|
+
* [__Additional functionality__]
|
|
203
|
+
* threefive has several additional features, mostly related to MPEGTS streams.
|
|
204
|
+
* threefive has built in help, just type `threefive help`
|
|
205
|
+
* This table shows how to use them.
|
|
384
206
|
|
|
385
207
|
| Description | How To Use |
|
|
386
208
|
|------------------------------------------|---------------------------------------------------------|
|
|
@@ -397,35 +219,14 @@ ___
|
|
|
397
219
|
|
|
398
220
|
___
|
|
399
221
|
|
|
400
|
-
|
|
222
|
+
#### [⇧](#-documentation-)
|
|
401
223
|
|
|
402
224
|
|
|
403
|
-
|
|
404
|
-
threefive also comes with:
|
|
405
|
-
#### scte35bump
|
|
406
|
-
|
|
407
|
-
* bump adjusts SCTE-35 PTS in an MPEGTS stream
|
|
408
|
-
|
|
409
|
-
```js
|
|
410
|
-
$ scte35bump -h
|
|
411
|
-
usage: scte35bump [-h] [-i INFILE] [-o OUTFILE] [-s SECS]
|
|
225
|
+
##### Other tools
|
|
412
226
|
|
|
413
|
-
|
|
414
|
-
-h, --help show this help message and exit
|
|
415
|
-
-i INFILE, --infile INFILE
|
|
416
|
-
Input source, stdin, file, http(s), udp, or multicast
|
|
417
|
-
mpegts [default: sys.stdin.buffer]
|
|
418
|
-
-o OUTFILE, --outfile OUTFILE
|
|
419
|
-
Output file [default: sys.stdout.buffer]
|
|
420
|
-
-s SECS, --secs SECS Adjustment to apply to SCTE-35 Cues. [default: 0.0]
|
|
421
|
-
|
|
422
|
-
scte35bump is part of threefive.
|
|
423
|
-
```
|
|
424
|
-
___
|
|
425
|
-
|
|
426
|
-
# [⇧](#-documentation-)
|
|
227
|
+
threefive also comes with:
|
|
427
228
|
|
|
428
|
-
|
|
229
|
+
##### gums
|
|
429
230
|
* the Grande Udp Multicast Server
|
|
430
231
|
|
|
431
232
|
```js
|
|
@@ -445,42 +246,124 @@ options:
|
|
|
445
246
|
gums is part of threefive.
|
|
446
247
|
```
|
|
447
248
|
|
|
448
|
-
|
|
249
|
+
#### [⇧](#-documentation-)
|
|
449
250
|
|
|
450
|
-
####
|
|
251
|
+
#### HLS
|
|
451
252
|
|
|
452
253
|
* parse HLS for SCTE-35. Supports all HLS SCTE-35 tags.
|
|
453
254
|
|
|
454
255
|
```js
|
|
455
|
-
$
|
|
256
|
+
$ threefive hls help
|
|
257
|
+
```
|
|
258
|
+
```smalltalk
|
|
456
259
|
|
|
457
|
-
[
|
|
260
|
+
[ Input ]
|
|
458
261
|
|
|
459
|
-
|
|
262
|
+
A m3u8 URI as input.
|
|
263
|
+
|
|
264
|
+
[what is supported]
|
|
265
|
+
|
|
266
|
+
M3U8 formats: master, rendition
|
|
267
|
+
Segment types: AAC, AC3, MPEGTS, CMAF,fMP4
|
|
268
|
+
Video codecs: mpeg2, h.264, h.265
|
|
269
|
+
Audio codecs: mpeg2, aac, ac3, mp3
|
|
270
|
+
Protocols: File, Http(s), Multicast, SRT, Stdin, UDP
|
|
271
|
+
Encryption: AES-128 (automatic)
|
|
272
|
+
|
|
273
|
+
[ SCTE-35 ]
|
|
274
|
+
|
|
275
|
+
SCTE-35 Embedded Cues as well as all SCTE-35 HLS Tags can be parsed.
|
|
276
|
+
|
|
277
|
+
[ Supported HLS Tags ]
|
|
278
|
+
|
|
279
|
+
* #EXT-OATCLS-SCTE35
|
|
280
|
+
* #EXT-X-CUE-OUT-CONT
|
|
281
|
+
* #EXT-X-DATERANGE
|
|
282
|
+
* #EXT-X-SCTE35
|
|
283
|
+
* #EXT-X-CUE-IN
|
|
284
|
+
* #EXT-X-CUE-OUT
|
|
285
|
+
|
|
286
|
+
[ SCTE-35 Parsing Profiles ]
|
|
287
|
+
|
|
288
|
+
SCTE-35 parsing can be fine tuned by setting a parsing profile.
|
|
289
|
+
|
|
290
|
+
running the command: threefive hls profile
|
|
291
|
+
|
|
292
|
+
will generate a default profile and write a file named hls.profile
|
|
293
|
+
in the current working directory.
|
|
294
|
+
|
|
295
|
+
a@fu:~$ cat hls.profile
|
|
296
|
+
|
|
297
|
+
expand_cues = False
|
|
298
|
+
parse_segments = False
|
|
299
|
+
parse_manifests = True
|
|
300
|
+
hls_tags = #EXT-OATCLS-SCTE35,#EXT-X-CUE-OUT-CONT,
|
|
301
|
+
#EXT-X-DATERANGE,#EXT-X-SCTE35,#EXT-X-CUE-IN,#EXT-X-CUE-OUT
|
|
302
|
+
command_types = 0x6,0x5
|
|
303
|
+
descriptor_tags = 0x2
|
|
304
|
+
starts = 0x22,0x30,0x32,0x34,0x36,0x44,0x46
|
|
305
|
+
|
|
306
|
+
( Integers are show in hex (base 16),
|
|
307
|
+
base 10 unsigned integers can also be used in hls.profile )
|
|
308
|
+
|
|
309
|
+
* expand_cues: set to True to show cues fully expanded as JSON
|
|
310
|
+
* parse_segments: set to true to enable parsing SCTE-35 from MPEGTS.
|
|
311
|
+
* parse_manifests: set to true to parse the m3u8 file for SCTE-35 HLS Tags.
|
|
312
|
+
* hls_tags: set which SCTE-35 HLS Tags to parse.
|
|
313
|
+
* command_types: set which Splice Commands to parse.
|
|
314
|
+
* descriptor_tags: set which Splice Descriptor Tags to parse.
|
|
315
|
+
* starts: set which Segmentation Type IDs to use to start breaks.
|
|
316
|
+
|
|
317
|
+
Edit the file as needed and then run threefive.
|
|
318
|
+
|
|
319
|
+
[ Profile Formatting Rules ]
|
|
320
|
+
|
|
321
|
+
* Values do not need to be quoted.
|
|
322
|
+
* Multiple values are separated by a commas.
|
|
323
|
+
* No partial line comments. Comments must be on a separate lines.
|
|
324
|
+
* Comments can be started with a # or //
|
|
325
|
+
* Integers can be base 10 or base 16
|
|
326
|
+
|
|
327
|
+
[ Output Files ]
|
|
328
|
+
scte35 hls creates a few output files.
|
|
329
|
+
|
|
330
|
+
* Profile rules applied to the output:
|
|
331
|
+
|
|
332
|
+
* hls.m3u8 - live playable rewrite of the m3u8 with the profile SCTE-35 rules.
|
|
333
|
+
* hls.sidecar - list of ( pts, HLS SCTE-35 tag ) pairs
|
|
334
|
+
|
|
335
|
+
* Profile rules not applied to the output:
|
|
336
|
+
|
|
337
|
+
* hlsflat.m3u8 - hls live streams are flattened out into a vod playlist.
|
|
338
|
+
When the live m3u8 first loads, every line is written to hlsflat.m3u8
|
|
339
|
+
Wnen a live m3u8 is reloaded, everything except the headers
|
|
340
|
+
is appended to hlsflat.m3u8. This give you a VOD style m3u8
|
|
341
|
+
so you can fast forward or rewind while playing.
|
|
342
|
+
GREAT for debugging SCTE-35 live hls.
|
|
343
|
+
|
|
344
|
+
[ Cool Features ]
|
|
345
|
+
|
|
346
|
+
* threefive can resume when started in the middle of an ad break.
|
|
347
|
+
|
|
348
|
+
2023-10-13T05:59:50.24Z Resuming Ad Break
|
|
349
|
+
2023-10-13T05:59:50.34Z Setting Break Timer to 17.733
|
|
350
|
+
2023-10-13T05:59:50.44Z Setting Break Duration to 60.067
|
|
351
|
+
|
|
352
|
+
[ Example Usage ]
|
|
353
|
+
|
|
354
|
+
* Show this help: threefive hls help
|
|
355
|
+
|
|
356
|
+
* Generate a new hls.profile: threefive hls profile
|
|
357
|
+
|
|
358
|
+
* parse an m3u8: scte35hls https://example.com/out/master.m3u8
|
|
460
359
|
|
|
461
|
-
To display this help:
|
|
462
|
-
scte35hls help
|
|
463
360
|
|
|
464
|
-
[ Input ]
|
|
465
|
-
threefive hls takes an m3u8 URI as input.
|
|
466
|
-
M3U8 formats supported:
|
|
467
|
-
* master ( When a master.m3u8 used,
|
|
468
|
-
threefive hls parses the first rendition it finds )
|
|
469
|
-
* rendition
|
|
470
|
-
Segment types supported:
|
|
471
|
-
* AAC
|
|
472
|
-
* AC3
|
|
473
|
-
* MPEGTS
|
|
474
|
-
*codecs:
|
|
475
|
-
* video
|
|
476
|
-
* mpeg2, h.264, h.265
|
|
477
|
-
* audio
|
|
478
|
-
* mpeg2, aac, ac3, mp3
|
|
479
361
|
```
|
|
480
362
|
|
|
481
|
-
|
|
363
|
+
#### [⇧](#-documentation-)
|
|
482
364
|
|
|
483
365
|
#### __scte35fix__
|
|
366
|
+
|
|
484
367
|
* when ffmpeg changes a SCTE-35 stream to bin data stream, scte35fix changes it back.
|
|
485
368
|
|
|
486
369
|
```js
|
|
@@ -505,9 +388,9 @@ scte35fix is part of threefive.
|
|
|
505
388
|
```
|
|
506
389
|
___
|
|
507
390
|
|
|
508
|
-
|
|
391
|
+
#### [⇧](#-documentation-)
|
|
509
392
|
|
|
510
|
-
|
|
393
|
+
## [ Using the library ]
|
|
511
394
|
* Let me show you how easy threefive is to use.
|
|
512
395
|
|
|
513
396
|
* reading SCTE-35 xml from a file
|
|
@@ -744,9 +627,9 @@ Type "help", "copyright", "credits" or "license" for more information.
|
|
|
744
627
|
```
|
|
745
628
|
___
|
|
746
629
|
|
|
747
|
-
|
|
630
|
+
#### [⇧](#-documentation-)
|
|
748
631
|
|
|
749
|
-
|
|
632
|
+
#### [web]
|
|
750
633
|
* [threefive SCTE-35 __Online Parser__](https://iodisco.com/scte35) __hosted on my server iodisco.com__
|
|
751
634
|
* Parse SCTE-35 in MPEGTS over HTTP, in your browser with[ Go, Wasm and Super Karate Death Car](https://bigcorp.ltd/gowasm) __hosted om my server bigcorp.ltd__
|
|
752
635
|
* Parse SCTE-35 in MPEGTS over HTTP, in your browser with[ threefive.js,javascript, and a little sed](https://bigcorp.ltd/bread) just to keep things interesting. __hosted om my server bigcorp.ltd__
|
|
@@ -755,17 +638,17 @@ ___
|
|
|
755
638
|
__hosted on my server iodisco.com__
|
|
756
639
|
___
|
|
757
640
|
|
|
758
|
-
|
|
641
|
+
#### [⇧](#-documentation-)
|
|
759
642
|
|
|
760
|
-
|
|
643
|
+
#### [XML]
|
|
761
644
|
* [XML](https://github.com/superkabuki/SCTE-35/blob/main/xml.md) __New__! _updated 05/01/2025_
|
|
762
645
|
|
|
763
|
-
|
|
646
|
+
#### [HLS]
|
|
764
647
|
* [Advanced Parsing of SCTE-35 in HLS with threefive](https://github.com/superkabuki/threefive/blob/main/hls.md) All HLS SCTE-35 tags, Sidecar Files, AAC ID3 Header Timestamps, SCTE-35 filters... Who loves you baby?
|
|
765
648
|
|
|
766
|
-
|
|
649
|
+
#### [⇧](#-documentation-)
|
|
767
650
|
|
|
768
|
-
|
|
651
|
+
#### [Classes]
|
|
769
652
|
* The python built in help is always the most up to date docs for the library.
|
|
770
653
|
|
|
771
654
|
```py3
|
|
@@ -783,9 +666,9 @@ a@fu:~/build7/threefive$ pypy3
|
|
|
783
666
|
|
|
784
667
|
___
|
|
785
668
|
|
|
786
|
-
|
|
669
|
+
#### [⇧](#-documentation-)
|
|
787
670
|
|
|
788
|
-
|
|
671
|
+
#### [threefive now supports SRT]
|
|
789
672
|
|
|
790
673
|
* _( You have to unmute the audio )_
|
|
791
674
|
|
|
@@ -800,9 +683,9 @@ https://github.com/user-attachments/assets/a323ea90-867f-480f-a55f-e9339263e511
|
|
|
800
683
|
|
|
801
684
|
___
|
|
802
685
|
|
|
803
|
-
|
|
686
|
+
#### [⇧](#-documentation-)
|
|
804
687
|
|
|
805
|
-
|
|
688
|
+
##### [more]
|
|
806
689
|
|
|
807
690
|
* [Encode SCTE-35](https://github.com/superkabuki/threefive/blob/main/encode.md) Some encoding code examples.
|
|
808
691
|
___
|