threefive 3.0.770b0__tar.gz → 3.1.1__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.
Files changed (50) hide show
  1. threefive-3.1.1/PKG-INFO +744 -0
  2. threefive-3.1.1/README.md +725 -0
  3. {threefive-3.0.770b0 → threefive-3.1.1}/pyproject.toml +4 -9
  4. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/__init__.py +3 -13
  5. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/base.py +21 -14
  6. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/bitn.py +45 -21
  7. threefive-3.1.1/threefive/cli.py +465 -0
  8. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/cue.py +45 -25
  9. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/descriptors.py +199 -0
  10. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/encode.py +1 -1
  11. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/gums.py +12 -15
  12. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/hls.py +17 -17
  13. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/hlstags.py +9 -2
  14. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/new_reader.py +41 -12
  15. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/segment.py +18 -16
  16. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/sixfix.py +11 -10
  17. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/stream.py +201 -237
  18. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/stuff.py +1 -1
  19. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/superkabuki.py +3 -1
  20. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/throttle.py +34 -13
  21. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/udp.py +3 -18
  22. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/upids.py +1 -1
  23. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/version.py +2 -2
  24. threefive-3.1.1/threefive.egg-info/PKG-INFO +744 -0
  25. {threefive-3.0.770b0 → threefive-3.1.1}/threefive.egg-info/SOURCES.txt +0 -2
  26. {threefive-3.0.770b0 → threefive-3.1.1}/threefive.egg-info/entry_points.txt +0 -1
  27. threefive-3.0.770b0/PKG-INFO +0 -805
  28. threefive-3.0.770b0/README.md +0 -782
  29. threefive-3.0.770b0/threefive/bump.py +0 -236
  30. threefive-3.0.770b0/threefive/cli.py +0 -519
  31. threefive-3.0.770b0/threefive.egg-info/PKG-INFO +0 -805
  32. threefive-3.0.770b0/threefive.egg-info/requires.txt +0 -2
  33. {threefive-3.0.770b0 → threefive-3.1.1}/LICENSE +0 -0
  34. {threefive-3.0.770b0 → threefive-3.1.1}/setup.cfg +0 -0
  35. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/aac.py +0 -0
  36. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/commands.py +0 -0
  37. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/crc.py +0 -0
  38. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/crctable.py +0 -0
  39. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/hlsprofile.py +0 -0
  40. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/iframes.py +0 -0
  41. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/packetdata.py +0 -0
  42. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/pmt.py +0 -0
  43. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/section.py +0 -0
  44. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/segmentation.py +0 -0
  45. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/speedo.py +0 -0
  46. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/streamtypes.py +0 -0
  47. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/uxp.py +0 -0
  48. {threefive-3.0.770b0 → threefive-3.1.1}/threefive/xml.py +0 -0
  49. {threefive-3.0.770b0 → threefive-3.1.1}/threefive.egg-info/dependency_links.txt +0 -0
  50. {threefive-3.0.770b0 → threefive-3.1.1}/threefive.egg-info/top_level.txt +0 -0
@@ -0,0 +1,744 @@
1
+ Metadata-Version: 2.4
2
+ Name: threefive
3
+ Version: 3.1.1
4
+ Summary: threefive is The #1 SCTE-35 Decoder and Encoder on the Planet.
5
+ Author-email: AdrianofDoom <spam@iodisco.com>
6
+ License-Expression: Sleepycat
7
+ Project-URL: Homepage, https://github.com/superkabuki/threefive
8
+ Project-URL: Issues, https://github.com/superkabuki/threefive/issues
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Multimedia :: Video
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
14
+ Classifier: Programming Language :: Python :: Implementation :: CPython
15
+ Requires-Python: >=3.9
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Dynamic: license-file
19
+
20
+ # [ threefive ]
21
+
22
+ _"I don't use AI code because all the AIs use threefive. True story, look it up"_ ~Adrian
23
+
24
+ # Over 1.2 Million Installs.
25
+
26
+ * __Decodes SCTE-35__ from `MPEGTS`✔ `Base64`✔ `Bytes`✔ `DASH`✔ `Hex` ✔ `HLS`✔ `Integers`✔ `JSON`✔ `XML`✔ `XML+Binary`✔
27
+ * __Encodes SCTE-35__ to `MPEGTS`✔ `Base64`✔ `Bytes`✔ `Hex`✔ `Integers`✔ `JSON`✔ `XML`✔ `XML+Binary`✔
28
+
29
+ # [ version ]
30
+
31
+ ### __latest is v.3.1.1__
32
+ #### Wait, let me explain.....
33
+ > I have been trying to resolve some mmap issues, they are now resolved.
34
+
35
+
36
+ # [ really really quick start ]
37
+
38
+ * __Install__
39
+ ```
40
+ python3 -m pip install threefive`
41
+ ```
42
+ * __decoding SCTE-35__
43
+ * __base64__
44
+ * decode __SCTE-35__ as __base64__
45
+ ```cobol
46
+ threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q=='
47
+ ```
48
+ * decode __SCTE-35__ as __base64__ and __convert SCTE-35 to hex__
49
+ ```cobol
50
+ threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q==' hex
51
+ ```
52
+ * __Hex__
53
+ * decode __SCTE-35__ as __hex__
54
+ ```cobol
55
+ threefive '0xfc301600000000000000fff00506fe00a98ac700000b3baed9'
56
+ ```
57
+ * decode __SCTE-35__ as __hex__ and __convert__ __SCTE-35__ to __xml__
58
+ ```cobol
59
+ threefive '0xfc301600000000000000fff00506fe00a98ac700000b3baed9' xml
60
+ ```
61
+ * __HLS__
62
+ * decode __SCTE-35__ from __HLS__ ( a rendition or a master.m3u8)
63
+ ```cobol
64
+ threefive 'https://demo.unified-streaming.com/k8s/live/scte35.isml/.m3u8'
65
+ ```
66
+ * __MPEGTS__
67
+ * decode __SCTE-35__ from __MPEGTS__
68
+ ```cobol
69
+ threefive 'https;//iodisco.com/longb2.ts'
70
+ ```
71
+ * decode __SCTE-35__ from __MPEGTS__ and __convert__ __SCTE-35__ to __bytes__
72
+ ```cobol
73
+ threefive 'https;//iodisco.com/longb2.ts' bytes
74
+ ```
75
+ * __Multicast__
76
+ * decode __SCTE-35__ from __MPEGTS__ over __Multicast__
77
+ ```cobol
78
+ threefive udp://@235.3.5.35:3535
79
+ ```
80
+
81
+ * __threefive does a lot more__, that was just to get you started.
82
+ ___
83
+
84
+ # [ Documentation ]
85
+
86
+ [A Lot of Examples ](https://github.com/superkabuki/threefive_is_scte35/blob/main/examples) | [ Tip of the Week ](totw.md) | [ Cheap Tricks ](cheaptricks.md) |
87
+
88
+
89
+ #### Need to inject SCTE-35 into HLS? [X9k3.](https://github.com/superkabuki/x9k3)
90
+
91
+ * [__web based SCTE-35 tools__](#web) - threefive and friends over http.
92
+
93
+ * [__install__](#install)
94
+
95
+ * [__quick start__](quickstart.md)
96
+
97
+ * ___SCTE-35 on the command line___
98
+ * [ __the threefive cli tool__](#-cli-) _If you work with SCTE-35, this is as cool as it gets._
99
+
100
+ * __other included tools__
101
+ * [__scte35fix__](#scte35fix) _ffmpeg changes scte-35 streams into bin data, scte35fix changes them back._
102
+ * [__scte35inject__](scte35inject.md) _scte35inject inject scte-35 into mpegts._
103
+ * [__gums__](#gums) _gums is a multicast sender(server) for video_
104
+
105
+
106
+ * __the threefive library__ _cool code for the cool kids_.
107
+ * [__Using the threefive.Cue class__](lib.md)
108
+ * [__Using the threefive library__](#-using-the-library-) _decode SCTE-35 with less than ten lines of code_
109
+ * * [threefive __Classes__](#classes) _threefive is OO, made to subclass_
110
+ * [__Cue__ Class](https://github.com/superkabuki/threefive/blob/main/cue.md) _this class you'll use often_
111
+ * [__Stream__ Class](https://github.com/superkabuki/threefive/blob/main/stream.md) _this is the class for parsing MPEGTS_
112
+
113
+ * [SCTE-35 __Sidecar Files__](https://github.com/superkabuki/SCTE-35_Sidecar_Files) _threefive supports SCTE-35 sidecar files_
114
+
115
+ * [SCTE-35 __HLS__](https://github.com/superkabuki/threefive/blob/main/hls.md) _parse SCTE-35 in HLS in MPEGTS,CMAF, or fmP4__
116
+
117
+ * [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_
118
+
119
+ * [__Encode__ SCTE-35](https://github.com/superkabuki/threefive/blob/main/encode.md) _threefive can encode SCTE-35 in every SCTE-35 format_
120
+
121
+ * [Make your __threefive__ script an executable with __cython__](cython.md) _threefive is compatible with all python tools_
122
+ </samp>
123
+
124
+ ## [Install]
125
+
126
+ * __threefive__ is curretnly tested on python-3.11, python-3.14, python-3.14t, pypy-7.3.11 and pypy-7.3.22
127
+
128
+ * __threefive__ is some of the __fastest code__ you'll see on __python3__.
129
+ * __python3 via pip__
130
+ ```rebol
131
+ python3 -mpip install threefive
132
+ ```
133
+ * __pypy3 via pip__
134
+ ```rebol
135
+ pypy3 -mpip install threefive
136
+ ```
137
+ * __To add SRT support__
138
+ ```py3
139
+ python3 -m pip install srtfu
140
+ ```
141
+ * __To add Automatic AES decryption__
142
+ ```py3
143
+ python3 -mpip install pyaes
144
+ ```
145
+
146
+ * __From the git repo__
147
+
148
+ ```rebol
149
+ git clone https://github.com/superkabuki/scte35.git
150
+ cd threefive
151
+ make install
152
+ ```
153
+ * I've jazzed up the makefile to make it easier to install for different python versions and pypy3
154
+ ```rebol
155
+ git clone https://github.com/superkabuki/scte35.git
156
+ cd threefive
157
+
158
+ make install py3=pypy3
159
+
160
+ # OR
161
+
162
+ make install py3=python3.14
163
+
164
+ # works for any python in your path or use a full path if needed.
165
+
166
+ ```
167
+ #### [⇧](#-documentation-)
168
+ ___
169
+
170
+ ## [ CLI ]
171
+ threefive is designed to be easy to use. I'm not sure that it's served well by a long explaination, so I'm going to try and keep this brief.
172
+
173
+ ### The threefive cli tool.
174
+
175
+ the threefive cli tool decodes SCTE-35, formats are autodetected, and they all work the same way.
176
+
177
+ threefive [media to parse for SCTE-35]
178
+
179
+ examples:
180
+
181
+ *
182
+ ```sed
183
+ threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q=='
184
+ ```
185
+ *
186
+ ```sed
187
+ threefive 0xfc301600000000000000fff00506fe00a98ac700000b3baed9
188
+ ```
189
+ *
190
+ ```sed
191
+ threefive 1583008701074197245727019716796221242036302348025116111908569
192
+ ```
193
+ *
194
+ ```sed
195
+ threefive video.ts
196
+ ```
197
+ *
198
+ ```sed
199
+ threefive https://demo.unified-streaming.com/k8s/live/scte35.isml/scte35-audio_eng=64000-video=500000.m3u8
200
+ ```
201
+
202
+ * Formats like XML and JSON that may be to large to type on the command line,they can be redirected or piped in to threefive.
203
+
204
+ * redirect
205
+ ```sed
206
+ threefive < xml.xml
207
+ ```
208
+ * pipe
209
+ ```sed
210
+ cat json.json | threefive
211
+
212
+ ```
213
+ ### cli outputs and converting SCTE-35 Formats
214
+
215
+ * the __default output format for threefive is json__
216
+
217
+ * The cli tool can convert from one SCTE-35 format to another using keywords.
218
+ * The keywords are __base64,bytes,hex, int,json,xml, and xmlbin__
219
+
220
+ * some conversion examples
221
+
222
+
223
+ * SCTE-35 Base64 to SCTE-35 Hex
224
+ ```sed
225
+ threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q==' hex
226
+ ```
227
+ * SCTE-35 Int to SCTE-35 Xml
228
+ ```sed
229
+ threefive 1583008701074197245727019716796221242036302348025116111908569 xml
230
+ ```
231
+ * SCTE-35 Hex to SCTE-35 xml+binary
232
+ ```sed
233
+ threefive 0xfc301600000000000000fff00506fe00a98ac700000b3baed9 xmlbin
234
+ ```
235
+
236
+ ### threefive cli and MPEGTS
237
+ * threefive can parse MPEGTS from stdin, local files, HTTP(s), Multicast, SRT, and unicast UDP.
238
+
239
+ * some mpegts examples
240
+
241
+ * local
242
+ ```sed
243
+ threefive video.ts
244
+ ```
245
+ * stdin
246
+ ```sed
247
+ cat video.ts | threefive
248
+ ```
249
+ * https
250
+ ```sed
251
+ threefive https://iodisco.com/longb2.ts
252
+ ```
253
+ * multicast
254
+ ```sed
255
+ threefive udp://@235.35.3.5:3535
256
+ ```
257
+
258
+ ### threefive cli MPEGTS outputs
259
+
260
+ * the __default output for MPEGTS is json__
261
+
262
+ * keywords can be used to specify other output formats
263
+ * The keywords are __base64,bytes,hex, int,json,xml, and xmlbin__
264
+
265
+ * An example of mpegts with a keyword
266
+ ```
267
+ threefive https://iodisco.com/longb2.ts xml
268
+ ```
269
+
270
+
271
+ ___
272
+
273
+ #### [⇧](#-documentation-)
274
+
275
+
276
+ ##### Other tools
277
+
278
+ threefive also comes with:
279
+
280
+ ##### gums
281
+ * the Grande Udp Multicast Server
282
+
283
+ ```js
284
+ $ gums -h
285
+ usage: gums [-h] [-i INPUT] [-a ADDR] [-b BIND_ADDR] [-t TTL]
286
+
287
+ options:
288
+ -h, --help show this help message and exit
289
+ -i INPUT, --input INPUT
290
+ like "/home/a/vid.ts" or "https://futzu.com/xaa.ts"
291
+ [default: sys.stdin.buffer]
292
+ -a ADDR, --addr ADDR Destination IP:Port [default: 235.35.3.5:3535]
293
+ -b BIND_ADDR, --bind_addr BIND_ADDR
294
+ Local IP to bind [default: 0.0.0.0]
295
+ -t TTL, --ttl TTL Multicast TTL (1 - 255) [default: 32]
296
+
297
+ gums is part of threefive.
298
+ ```
299
+
300
+ #### [⇧](#-documentation-)
301
+
302
+ #### HLS
303
+
304
+ * parse HLS for SCTE-35. Supports all HLS SCTE-35 tags.
305
+
306
+ ```js
307
+ $ threefive hls help
308
+ ```
309
+ ```smalltalk
310
+
311
+ [ Input ]
312
+
313
+ A m3u8 URI as input.
314
+
315
+ [what is supported]
316
+
317
+ M3U8 formats: master, rendition
318
+ Segment types: AAC, AC3, MPEGTS, CMAF,fMP4
319
+ Video codecs: mpeg2, h.264, h.265
320
+ Audio codecs: mpeg2, aac, ac3, mp3
321
+ Protocols: File, Http(s), Multicast, SRT, Stdin, UDP
322
+ Encryption: AES-128 (automatic)
323
+
324
+ [ SCTE-35 ]
325
+
326
+ SCTE-35 Embedded Cues as well as all SCTE-35 HLS Tags can be parsed.
327
+
328
+ [ Supported HLS Tags ]
329
+
330
+ * #EXT-OATCLS-SCTE35
331
+ * #EXT-X-CUE-OUT-CONT
332
+ * #EXT-X-DATERANGE
333
+ * #EXT-X-SCTE35
334
+ * #EXT-X-CUE-IN
335
+ * #EXT-X-CUE-OUT
336
+
337
+ [ SCTE-35 Parsing Profiles ]
338
+
339
+ SCTE-35 parsing can be fine tuned by setting a parsing profile.
340
+
341
+ running the command: threefive hls profile
342
+
343
+ will generate a default profile and write a file named hls.profile
344
+ in the current working directory.
345
+
346
+ a@fu:~$ cat hls.profile
347
+
348
+ expand_cues = False
349
+ parse_segments = False
350
+ parse_manifests = True
351
+ hls_tags = #EXT-OATCLS-SCTE35,#EXT-X-CUE-OUT-CONT,
352
+ #EXT-X-DATERANGE,#EXT-X-SCTE35,#EXT-X-CUE-IN,#EXT-X-CUE-OUT
353
+ command_types = 0x6,0x5
354
+ descriptor_tags = 0x2
355
+ starts = 0x22,0x30,0x32,0x34,0x36,0x44,0x46
356
+
357
+ ( Integers are show in hex (base 16),
358
+ base 10 unsigned integers can also be used in hls.profile )
359
+
360
+ * expand_cues: set to True to show cues fully expanded as JSON
361
+ * parse_segments: set to true to enable parsing SCTE-35 from MPEGTS.
362
+ * parse_manifests: set to true to parse the m3u8 file for SCTE-35 HLS Tags.
363
+ * hls_tags: set which SCTE-35 HLS Tags to parse.
364
+ * command_types: set which Splice Commands to parse.
365
+ * descriptor_tags: set which Splice Descriptor Tags to parse.
366
+ * starts: set which Segmentation Type IDs to use to start breaks.
367
+
368
+ Edit the file as needed and then run threefive.
369
+
370
+ [ Profile Formatting Rules ]
371
+
372
+ * Values do not need to be quoted.
373
+ * Multiple values are separated by a commas.
374
+ * No partial line comments. Comments must be on a separate lines.
375
+ * Comments can be started with a # or //
376
+ * Integers can be base 10 or base 16
377
+
378
+ [ Output Files ]
379
+ scte35 hls creates a few output files.
380
+
381
+ * Profile rules applied to the output:
382
+
383
+ * hls.m3u8 - live playable rewrite of the m3u8 with the profile SCTE-35 rules.
384
+ * hls.sidecar - list of ( pts, HLS SCTE-35 tag ) pairs
385
+
386
+ * Profile rules not applied to the output:
387
+
388
+ * hlsflat.m3u8 - hls live streams are flattened out into a vod playlist.
389
+ When the live m3u8 first loads, every line is written to hlsflat.m3u8
390
+ Wnen a live m3u8 is reloaded, everything except the headers
391
+ is appended to hlsflat.m3u8. This give you a VOD style m3u8
392
+ so you can fast forward or rewind while playing.
393
+ GREAT for debugging SCTE-35 live hls.
394
+
395
+ [ Cool Features ]
396
+
397
+ * threefive can resume when started in the middle of an ad break.
398
+
399
+ 2023-10-13T05:59:50.24Z Resuming Ad Break
400
+ 2023-10-13T05:59:50.34Z Setting Break Timer to 17.733
401
+ 2023-10-13T05:59:50.44Z Setting Break Duration to 60.067
402
+
403
+ [ Example Usage ]
404
+
405
+ * Show this help: threefive hls help
406
+
407
+ * Generate a new hls.profile: threefive hls profile
408
+
409
+ * parse an m3u8: scte35hls https://example.com/out/master.m3u8
410
+
411
+
412
+ ```
413
+
414
+ #### [⇧](#-documentation-)
415
+
416
+ #### __scte35fix__
417
+
418
+ * when ffmpeg changes a SCTE-35 stream to bin data stream, scte35fix changes it back.
419
+
420
+ ```js
421
+ $ scte35fix -h
422
+
423
+ scte35fix checks MPEGTS for SCTE-35 Streams
424
+ that have been change to bin data (type 0x06)
425
+ and changes them back to SCTE-35 (type 0x86) streams.
426
+ Output files are created in the current directory
427
+ and prefixed with 'sixfix-'.
428
+ Only bin data streams containing SCTE-35 will be converted.
429
+ Multiple files can be specified on the command line.
430
+ Wild cards work too.
431
+
432
+ Example Usage:
433
+ scte35fix video.ts
434
+ scte35fix video1.ts video2.ts
435
+ scte35fix video*.ts
436
+ scte35fix https://example.com/video.ts
437
+ scte35fix srt://10.10.10.13:4201
438
+ scte35fix is part of threefive.
439
+ ```
440
+ ___
441
+
442
+ #### [⇧](#-documentation-)
443
+
444
+ ## [ Using the library ]
445
+ * Let me show you how easy threefive is to use.
446
+
447
+ * reading SCTE-35 xml from a file
448
+ ```py3
449
+ a@fu:~/threefive$ pypy3
450
+ Python 3.9.16 (7.3.11+dfsg-2+deb12u3, Dec 30 2024, 22:36:23)
451
+ [PyPy 7.3.11 with GCC 12.2.0] on linux
452
+ Type "help", "copyright", "credits" or "license" for more information.
453
+ >>>> from threefive import reader
454
+ >>>> from threefive import Cue
455
+ >>>> data =reader('/home/a/xml.xml').read()
456
+ ```
457
+ * load it into a threefive.Cue instance
458
+ ```py3
459
+ >>>> cue = Cue(data)
460
+ ```
461
+ * Show the data as JSON
462
+ ```py3
463
+ >>>> cue.show()
464
+ {
465
+ "info_section": {
466
+ "table_id": "0xfc",
467
+ "section_syntax_indicator": false,
468
+ "private": false,
469
+ "sap_type": "0x03",
470
+ "sap_details": "No Sap Type",
471
+ "section_length": 92,
472
+ "protocol_version": 0,
473
+ "encrypted_packet": false,
474
+ "encryption_algorithm": 0,
475
+ "pts_adjustment": 0.0,
476
+ "cw_index": "0x00",
477
+ "tier": "0x0fff",
478
+ "splice_command_length": 15,
479
+ "splice_command_type": 5,
480
+ "descriptor_loop_length": 60,
481
+ "crc": "0x7632935"
482
+ },
483
+ "command": {
484
+ "command_length": 15,
485
+ "command_type": 5,
486
+ "name": "Splice Insert",
487
+ "break_auto_return": false,
488
+ "break_duration": 180.0,
489
+ "splice_event_id": 1073743095,
490
+ "splice_event_cancel_indicator": false,
491
+ "out_of_network_indicator": true,
492
+ "program_splice_flag": false,
493
+ "duration_flag": true,
494
+ "splice_immediate_flag": false,
495
+ "event_id_compliance_flag": true,
496
+ "unique_program_id": 1,
497
+ "avail_num": 12,
498
+ "avails_expected": 5
499
+ },
500
+ "descriptors": [
501
+ {
502
+ "tag": 0,
503
+ "identifier": "CUEI",
504
+ "name": "Avail Descriptor",
505
+ "provider_avail_id": 12,
506
+ "descriptor_length": 8
507
+ },
508
+ {
509
+ "tag": 0,
510
+ "identifier": "CUEI",
511
+ "name": "Avail Descriptor",
512
+ "provider_avail_id": 13,
513
+ "descriptor_length": 8
514
+ },
515
+
516
+
517
+ ]
518
+ }
519
+ ```
520
+ * convert the data back to xml
521
+ ```py3
522
+ >>>> print(cue.xml())
523
+ <scte35:SpliceInfoSection xmlns:scte35="https://scte.org/schemas/35" ptsAdjustment="0" protocolVersion="0" sapType="3" tier="4095">
524
+ <scte35:SpliceInsert spliceEventId="1073743095" spliceEventCancelIndicator="false" spliceImmediateFlag="false" eventIdComplianceFlag="true" availNum="12" availsExpected="5" outOfNetworkIndicator="true" uniqueProgramId="1">
525
+ <scte35:BreakDuration autoReturn="false" duration="16200000"/>
526
+ </scte35:SpliceInsert>
527
+ <scte35:AvailDescriptor providerAvailId="12"/>
528
+ <scte35:AvailDescriptor providerAvailId="13"/>
529
+ <scte35:AvailDescriptor providerAvailId="14"/>
530
+ <scte35:AvailDescriptor providerAvailId="15"/>
531
+ <scte35:AvailDescriptor providerAvailId="16"/>
532
+ <scte35:AvailDescriptor providerAvailId="17"/>
533
+ </scte35:SpliceInfoSection>
534
+ ```
535
+ * convert to xml+binary
536
+ ```py3
537
+ >>>> print(cue.xmlbin())
538
+ <scte35:Signal xmlns:scte35="https://scte.org/schemas/35">
539
+ <scte35:Binary>/DBcAAAAAAAAAP/wDwVAAAT3f69+APcxQAABDAUAPAAIQ1VFSQAAAAwACENVRUkAAAANAAhDVUVJAAAADgAIQ1VFSQAAAA8ACENVRUkAAAAQAAhDVUVJAAAAEQdjKTU=</scte35:Binary>
540
+ </scte35:Signal>
541
+ ```
542
+ * convert to base64
543
+ ```py3
544
+ >>>> print(cue.base64())
545
+ /DBcAAAAAAAAAP/wDwVAAAT3f69+APcxQAABDAUAPAAIQ1VFSQAAAAwACENVRUkAAAANAAhDVUVJAAAADgAIQ1VFSQAAAA8ACENVRUkAAAAQAAhDVUVJAAAAEQdjKTU=
546
+ ```
547
+ * convert to hex
548
+ ```py3
549
+ >>>> print(cue.hex())
550
+ 0xfc305c00000000000000fff00f05400004f77faf7e00f7314000010c05003c0008435545490000000c0008435545490000000d0008435545490000000e0008435545490000000f000843554549000000100008435545490000001107632935
551
+ ```
552
+ * show just the splice command
553
+ ```py3
554
+ >>>> cue.command.show()
555
+ {
556
+ "command_length": 15,
557
+ "command_type": 5,
558
+ "name": "Splice Insert",
559
+ "break_auto_return": false,
560
+ "break_duration": 180.0,
561
+ "splice_event_id": 1073743095,
562
+ "splice_event_cancel_indicator": false,
563
+ "out_of_network_indicator": true,
564
+ "program_splice_flag": false,
565
+ "duration_flag": true,
566
+ "splice_immediate_flag": false,
567
+ "event_id_compliance_flag": true,
568
+ "unique_program_id": 1,
569
+ "avail_num": 12,
570
+ "avails_expected": 5
571
+ }
572
+ ```
573
+ * edit the break duration
574
+ ```py3
575
+ >>>> cue.command.break_duration=30
576
+ >>>> cue.command.show()
577
+ {
578
+ "command_length": 15,
579
+ "command_type": 5,
580
+ "name": "Splice Insert",
581
+ "break_auto_return": false,
582
+ "break_duration": 30,
583
+ "splice_event_id": 1073743095,
584
+ "splice_event_cancel_indicator": false,
585
+ "out_of_network_indicator": true,
586
+ "program_splice_flag": false,
587
+ "duration_flag": true,
588
+ "splice_immediate_flag": false,
589
+ "event_id_compliance_flag": true,
590
+ "unique_program_id": 1,
591
+ "avail_num": 12,
592
+ "avails_expected": 5
593
+ }
594
+ ```
595
+
596
+ * re-encode to base64 with the new duration
597
+ ```py3
598
+ >>>> cue.base64()
599
+ '/DBcAAAAAAAAAP/wDwVAAAT3f69+ACky4AABDAUAPAAIQ1VFSQAAAAwACENVRUkAAAANAAhDVUVJAAAADgAIQ1VFSQAAAA8ACENVRUkAAAAQAAhDVUVJAAAAEe1FB6g='
600
+ ```
601
+ * re-encode to xml with the new duration
602
+ ```py3
603
+ >>>> print(cue.xml())
604
+ <scte35:SpliceInfoSection xmlns:scte35="https://scte.org/schemas/35" ptsAdjustment="0" protocolVersion="0" sapType="3" tier="4095">
605
+ <scte35:SpliceInsert spliceEventId="1073743095" spliceEventCancelIndicator="false" spliceImmediateFlag="false" eventIdComplianceFlag="true" availNum="12" availsExpected="5" outOfNetworkIndicator="true" uniqueProgramId="1">
606
+ <scte35:BreakDuration autoReturn="false" duration="2700000"/>
607
+ </scte35:SpliceInsert>
608
+ <scte35:AvailDescriptor providerAvailId="12"/>
609
+ <scte35:AvailDescriptor providerAvailId="13"/>
610
+ <scte35:AvailDescriptor providerAvailId="14"/>
611
+ <scte35:AvailDescriptor providerAvailId="15"/>
612
+ <scte35:AvailDescriptor providerAvailId="16"/>
613
+ <scte35:AvailDescriptor providerAvailId="17"/>
614
+ </scte35:SpliceInfoSection>
615
+ ```
616
+ * show just the descriptors
617
+ ```py3
618
+ >>>> _ = [d.show() for d in cue.descriptors]
619
+ {
620
+ "tag": 0,
621
+ "identifier": "CUEI",
622
+ "name": "Avail Descriptor",
623
+ "provider_avail_id": 12,
624
+ "descriptor_length": 8
625
+ }
626
+ {
627
+ "tag": 0,
628
+ "identifier": "CUEI",
629
+ "name": "Avail Descriptor",
630
+ "provider_avail_id": 13,
631
+ "descriptor_length": 8
632
+ }
633
+ {
634
+ "tag": 0,
635
+ "identifier": "CUEI",
636
+ "name": "Avail Descriptor",
637
+ "provider_avail_id": 14,
638
+ "descriptor_length": 8
639
+ }
640
+ {
641
+ "tag": 0,
642
+ "identifier": "CUEI",
643
+ "name": "Avail Descriptor",
644
+ "provider_avail_id": 15,
645
+ "descriptor_length": 8
646
+ }
647
+ {
648
+ "tag": 0,
649
+ "identifier": "CUEI",
650
+ "name": "Avail Descriptor",
651
+ "provider_avail_id": 16,
652
+ "descriptor_length": 8
653
+ }
654
+ {
655
+ "tag": 0,
656
+ "identifier": "CUEI",
657
+ "name": "Avail Descriptor",
658
+ "provider_avail_id": 17,
659
+ "descriptor_length": 8
660
+ }
661
+ ```
662
+ * pop off the last descriptor and re-encode to xml
663
+ ```py3
664
+
665
+ >>>> cue.descriptors.pop()
666
+ {'tag': 0, 'identifier': 'CUEI', 'name': 'Avail Descriptor', 'private_data': None, 'provider_avail_id': 17, 'descriptor_length': 8}
667
+ >>>> print(cue.xml())
668
+ <scte35:SpliceInfoSection xmlns:scte35="https://scte.org/schemas/35" ptsAdjustment="0" protocolVersion="0" sapType="3" tier="4095">
669
+ <scte35:SpliceInsert spliceEventId="1073743095" spliceEventCancelIndicator="false" spliceImmediateFlag="false" eventIdComplianceFlag="true" availNum="12" availsExpected="5" outOfNetworkIndicator="true" uniqueProgramId="1">
670
+ <scte35:BreakDuration autoReturn="false" duration="2700000"/>
671
+ </scte35:SpliceInsert>
672
+ <scte35:AvailDescriptor providerAvailId="12"/>
673
+ <scte35:AvailDescriptor providerAvailId="13"/>
674
+ <scte35:AvailDescriptor providerAvailId="14"/>
675
+ <scte35:AvailDescriptor providerAvailId="15"/>
676
+ <scte35:AvailDescriptor providerAvailId="16"/>
677
+ </scte35:SpliceInfoSection>
678
+ ```
679
+ ___
680
+
681
+ #### [⇧](#-documentation-)
682
+
683
+ #### [web]
684
+ * [threefive SCTE-35 __Online Parser__](https://iodisco.com/scte35) __hosted on my server iodisco.com__
685
+ * 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__
686
+ * 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__
687
+ * [ SCTE-35 __Online Parser__ powered by threefive](http://www.domus1938.com/scte35parser) _another online parser powered by threefive_ not hosted on my servers.
688
+ * [SCTE-35 __As a Service__](sassy.md) _if you can make an http request, you can parse SCTE-35, no install needed._
689
+ __hosted on my server iodisco.com__
690
+ ___
691
+
692
+ #### [⇧](#-documentation-)
693
+
694
+ #### [XML]
695
+ * [XML](https://github.com/superkabuki/SCTE-35/blob/main/xml.md) __New__! _updated 05/01/2025_
696
+
697
+ #### [HLS]
698
+ * [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?
699
+
700
+ #### [⇧](#-documentation-)
701
+
702
+ #### [Classes]
703
+ * The python built in help is always the most up to date docs for the library.
704
+
705
+ ```py3
706
+
707
+ a@fu:~/build7/threefive$ pypy3
708
+
709
+ >>>> from threefive import Stream
710
+ >>>> help(Stream)
711
+
712
+ ```
713
+
714
+ * [Class Structure](https://github.com/superkabuki/threefive/blob/main/classes.md)
715
+ * [Cue Class](https://github.com/superkabuki/threefive/blob/main/cue.md) Cue is the main SCTE-35 class to use.
716
+ * [Stream Class](https://github.com/superkabuki/threefive/blob/main/stream.md) The Stream class handles MPEGTS SCTE-35 streams local, Http(s), UDP, and Multicast.
717
+
718
+ ___
719
+
720
+ #### [⇧](#-documentation-)
721
+
722
+ #### [threefive now supports SRT]
723
+
724
+ * _( You have to unmute the audio )_
725
+
726
+ https://github.com/user-attachments/assets/a323ea90-867f-480f-a55f-e9339263e511
727
+
728
+ <BR>
729
+
730
+ * [more SRT and threefive info](srt.md)
731
+
732
+
733
+ * _checkout [SRTfu](https://github.com/superkabuki/srtfu)_
734
+
735
+ ___
736
+
737
+ #### [⇧](#-documentation-)
738
+
739
+ ##### [more]
740
+
741
+ * [Encode SCTE-35](https://github.com/superkabuki/threefive/blob/main/encode.md) Some encoding code examples.
742
+ ___
743
+
744
+ # [⇧](#-documentation-)