threefive3 3.0.17__tar.gz → 3.0.21__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.
- {threefive3-3.0.17/threefive3.egg-info → threefive3-3.0.21}/PKG-INFO +77 -38
- {threefive3-3.0.17 → threefive3-3.0.21}/README.md +76 -37
- {threefive3-3.0.17 → threefive3-3.0.21}/bin/threefive3 +13 -8
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/__init__.py +6 -3
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/base.py +2 -5
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/bitn.py +8 -5
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/commands.py +3 -5
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/cue.py +39 -41
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/descriptors.py +4 -5
- threefive3-3.0.21/threefive3/encode.py +114 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/hls.py +74 -92
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/hlstags.py +3 -3
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/section.py +13 -14
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/sixfix.py +3 -3
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/stream.py +23 -20
- threefive3-3.0.21/threefive3/stuff.py +59 -0
- threefive3-3.0.21/threefive3/superkabuki.py +315 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/version.py +1 -1
- {threefive3-3.0.17 → threefive3-3.0.21/threefive3.egg-info}/PKG-INFO +77 -38
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3.egg-info/SOURCES.txt +2 -0
- threefive3-3.0.17/threefive3/stuff.py +0 -26
- {threefive3-3.0.17 → threefive3-3.0.21}/LICENSE +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/setup.cfg +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/setup.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/crc.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/iframes.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/new_reader.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/packetdata.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/segment.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/segmentation.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/streamtypes.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/sxp.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/upids.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/x2c.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3/xml.py +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3.egg-info/dependency_links.txt +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3.egg-info/requires.txt +0 -0
- {threefive3-3.0.17 → threefive3-3.0.21}/threefive3.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: threefive3
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.21
|
|
4
4
|
Summary: threefive continued.
|
|
5
5
|
Home-page: https://github.com/superkabuki/scte35
|
|
6
6
|
Author: Adrian of Doom
|
|
@@ -19,26 +19,24 @@ Requires-Python: >=3.6
|
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
[Install threefive3](#install) |[SCTE-35 Cli](#the-cli-tool) |[SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) | [SCTE-35 HLS](https://github.com/superkabuki/threefive3/blob/main/hls.md) | [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md) | [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md) | [Online SCTE-35 Parser](https://iodisco.com/scte35) | [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) | [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35)
|
|
23
|
+
|
|
24
|
+
# threefive3 SCTE-35 cli super tool and python3 library.
|
|
25
|
+
> Brought to you by the fine folks at fu-corp _( Adrian and the two blonde Chinese girls. )_
|
|
23
26
|
|
|
24
27
|
✅ SCTE-35 Parser ✅ SCTE-35 Encoder ✅ SCTE-35 HLS ✅ SCTE-35 Xml ✅ SCTE-35 Cli ✅ SCTE-35 library
|
|
25
28
|
|
|
26
29
|
|
|
27
|
-
* Parses SCTE-35 from MPEGTS, HLS, XML, XML+Binary, Base64, Bytes, Hex,
|
|
28
|
-
*
|
|
30
|
+
* Parses SCTE-35 from MPEGTS, HLS, XML, XML+Binary, Base64, Bytes, Hex, Integers, or JSON.
|
|
31
|
+
* Encode SCTE-35 to Base64, Bytes, Hex, Int, JSON, Xml, or Xml+binary.
|
|
32
|
+
* Built-in network support for HTTP(S), UDP, and Multicast.
|
|
29
33
|
* Automatic AES decryption for HLS.
|
|
30
|
-
* All HLS SCTE-35 Tags are Supported
|
|
31
|
-
___
|
|
32
|
-
* [Install](#install)
|
|
33
|
-
* [SCTE-35 Cli](#the-cli-tool)
|
|
34
|
-
* [SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md)
|
|
35
|
-
* [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md)
|
|
36
|
-
* [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md)
|
|
37
|
-
* [Online SCTE-35 Parser](https://iodisco.com/scte35)
|
|
38
|
-
* [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md)
|
|
39
|
-
* [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35)
|
|
34
|
+
* All HLS SCTE-35 Tags are Supported.
|
|
40
35
|
|
|
41
|
-
|
|
36
|
+
### Latest release is v3.0.21
|
|
37
|
+
> Stay up to date, only the latest release is supported.
|
|
38
|
+
___
|
|
39
|
+
### MPEGTS streams can be parsed for SCTE-35 with three lines of code.
|
|
42
40
|
|
|
43
41
|
```py3
|
|
44
42
|
a@fu:~/build5/scte35/scte35$ pypy3
|
|
@@ -53,10 +51,56 @@ Type "help", "copyright", "credits" or "license" for more information.
|
|
|
53
51
|
>>>> strm.decode()
|
|
54
52
|
```
|
|
55
53
|
|
|
54
|
+
# `Documentation`
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
* [Install](#install)
|
|
58
|
+
|
|
59
|
+
#### Cli
|
|
60
|
+
|
|
61
|
+
* [SCTE-35 Cli Super Tool](#the-cli-tool) Encodes, Decodes, and Recodes. This is pretty cool, it does SCTE-35 seven different ways.
|
|
62
|
+
* The cli tool comes with builtin documentation just type `threefive3 help`
|
|
63
|
+
|
|
64
|
+
### HLS
|
|
65
|
+
* [Advanced Parsing of SCTE-35 in HLS with threefive3](https://github.com/superkabuki/threefive3/blob/main/hls.md) All HLS SCTE-35 tags, Sidecar Files, AAC ID3 Header Timestamps, SCTE-35 filters and more.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
#### Xml
|
|
69
|
+
|
|
70
|
+
* [SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) The people wanted it so I finally did Xml.
|
|
71
|
+
* I feel cheap and dirty.
|
|
72
|
+
___
|
|
73
|
+
|
|
74
|
+
#### `Classes`
|
|
75
|
+
|
|
76
|
+
* The python built in help is always the most up to date docs for the library.
|
|
77
|
+
|
|
78
|
+
```rebol
|
|
79
|
+
a@fu:~/build7/threefive3$ pypy3
|
|
80
|
+
Python 3.9.16 (7.3.11+dfsg-2+deb12u3, Dec 30 2024, 22:36:23)
|
|
81
|
+
[PyPy 7.3.11 with GCC 12.2.0] on linux
|
|
82
|
+
Type "help", "copyright", "credits" or "license" for more information.
|
|
83
|
+
>>>> from threefive import Stream
|
|
84
|
+
>>>> help(Stream)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
* [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md) Cue is the main SCTE-35 class to use.
|
|
88
|
+
* [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md) The Stream class handles MPEGTS SCTE-35 streams local, Http(s), UDP, and Multicast.
|
|
56
89
|
___
|
|
57
90
|
|
|
91
|
+
#### `| more`
|
|
92
|
+
|
|
93
|
+
* [Online SCTE-35 Parser](https://iodisco.com/scte35) Supporte Base64, Bytes,Hex,Int, Json, Xml, and Xml+binary.
|
|
94
|
+
* __Damn__.
|
|
95
|
+
|
|
96
|
+
* [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) Some encoding code examples.
|
|
58
97
|
|
|
59
|
-
|
|
98
|
+
* [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35) FFmpeg with the SuperKabui SCTE-35 Patch applied.
|
|
99
|
+
* __Hell Yes.__
|
|
100
|
+
|
|
101
|
+
___
|
|
102
|
+
|
|
103
|
+
### `Install`
|
|
60
104
|
* python3 via pip
|
|
61
105
|
```rebol
|
|
62
106
|
python3 -mpip install threefive3
|
|
@@ -74,10 +118,10 @@ make install
|
|
|
74
118
|
___
|
|
75
119
|
|
|
76
120
|
|
|
77
|
-
|
|
121
|
+
### `The Cli tool`
|
|
78
122
|
|
|
79
123
|
|
|
80
|
-
|
|
124
|
+
#### The cli tool installs automatically with pip or the Makefile.
|
|
81
125
|
|
|
82
126
|
* [__SCTE-35 Inputs__](#inputs)
|
|
83
127
|
* [__SCTE-35 Outputs__](#outputs)
|
|
@@ -87,7 +131,7 @@ ___
|
|
|
87
131
|
* [Display raw __SCTE-35 packets__ from __video streams__](#packets)
|
|
88
132
|
* [__Repair SCTE-35 streams__ changed to __bin data__ by __ffmpeg__](#sixfix)
|
|
89
133
|
|
|
90
|
-
|
|
134
|
+
#### `Inputs`
|
|
91
135
|
|
|
92
136
|
* Most __inputs__ are __auto-detected.__
|
|
93
137
|
* __stdin__ is __auto selected__ and __auto detected.__
|
|
@@ -97,7 +141,7 @@ ___
|
|
|
97
141
|
```rebol
|
|
98
142
|
threefive3 udp://@235.2.5.35:3535
|
|
99
143
|
```
|
|
100
|
-
* If a file comtains a SCTE-35
|
|
144
|
+
* If a file comtains a SCTE-35 cue as a string( base64,hex,int,json,xml or xml+bin), redirect the file contents.
|
|
101
145
|
```rebol
|
|
102
146
|
|
|
103
147
|
threefive3 < json.json
|
|
@@ -138,7 +182,7 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
138
182
|
| | |
|
|
139
183
|
|
|
140
184
|
|
|
141
|
-
|
|
185
|
+
#### Outputs
|
|
142
186
|
* output type is determined by the key words __base64, bytes, hex, int, json, xml, and xmlbin__.
|
|
143
187
|
* __json is the default__.
|
|
144
188
|
* __Any input (except HLS,) can be returned as any output__
|
|
@@ -155,55 +199,55 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
155
199
|
| Xml | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' xml ` ` |
|
|
156
200
|
| Xml+bin | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b xmlbin ` |`
|
|
157
201
|
|
|
158
|
-
|
|
202
|
+
#### `hls`
|
|
159
203
|
* parse hls manifests and segments for SCTE-35
|
|
160
204
|
```smalltalk
|
|
161
205
|
threefive3 hls https://example.com/master.m3u8
|
|
162
206
|
```
|
|
163
207
|
___
|
|
164
|
-
|
|
208
|
+
#### `Iframes`
|
|
165
209
|
* Show iframes PTS in an MPEGTS video
|
|
166
210
|
|
|
167
211
|
```smalltalk
|
|
168
212
|
threefive3 iframes https://example.com/video.ts
|
|
169
213
|
```
|
|
170
214
|
___
|
|
171
|
-
|
|
215
|
+
#### `packets`
|
|
172
216
|
* Print raw SCTE-35 packets from multicast mpegts video
|
|
173
217
|
|
|
174
218
|
```smalltalk
|
|
175
219
|
threefive3 packets udp://@235.35.3.5:3535
|
|
176
220
|
```
|
|
177
221
|
___
|
|
178
|
-
|
|
222
|
+
#### `proxy`
|
|
179
223
|
* Parse a https stream and write raw video to stdout
|
|
180
224
|
|
|
181
225
|
```smalltalk
|
|
182
226
|
threefive3 proxy video.ts
|
|
183
227
|
```
|
|
184
228
|
___
|
|
185
|
-
|
|
229
|
+
#### `pts`
|
|
186
230
|
* Print PTS from mpegts video
|
|
187
231
|
|
|
188
232
|
```smalltalk
|
|
189
233
|
threefive3 pts video.ts
|
|
190
234
|
```
|
|
191
235
|
___
|
|
192
|
-
|
|
236
|
+
#### `sidecar`
|
|
193
237
|
* Parse a stream, write pts,write SCTE-35 Cues to sidecar.txt
|
|
194
238
|
|
|
195
239
|
```smalltalk
|
|
196
240
|
threefive3 sidecar video.ts
|
|
197
241
|
```
|
|
198
242
|
___
|
|
199
|
-
|
|
243
|
+
#### `sixfix`
|
|
200
244
|
* Fix SCTE-35 data mangled by ffmpeg
|
|
201
245
|
|
|
202
246
|
```smalltalk
|
|
203
247
|
threefive3 sixfix video.ts
|
|
204
248
|
```
|
|
205
249
|
___
|
|
206
|
-
|
|
250
|
+
#### `show`
|
|
207
251
|
|
|
208
252
|
* Probe mpegts video _( kind of like ffprobe )_
|
|
209
253
|
|
|
@@ -211,32 +255,27 @@ ___
|
|
|
211
255
|
threefive3 show video.ts
|
|
212
256
|
```
|
|
213
257
|
___
|
|
214
|
-
|
|
258
|
+
#### `version`
|
|
215
259
|
* Show version
|
|
216
260
|
|
|
217
261
|
```smalltalk
|
|
218
262
|
threefive3 version
|
|
219
263
|
```
|
|
220
264
|
___
|
|
221
|
-
|
|
265
|
+
#### `help`
|
|
222
266
|
* Help
|
|
223
267
|
```rebol
|
|
224
268
|
threefive3 help
|
|
225
269
|
```
|
|
226
270
|
___
|
|
227
271
|
|
|
228
|
-

|
|
229
272
|
|
|
230
|
-
___
|
|
231
273
|
|
|
232
|
-
|
|
274
|
+
### [iodisco.com/scte35](https://iodisco.com/scte35)
|
|
233
275
|

|
|
234
276
|
|
|
235
277
|
|
|
236
278
|
|
|
237
279
|
___
|
|
238
280
|
|
|
239
|
-
[Install](#install) |[SCTE-35 Cli](#the-cli-tool) |[SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) | [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md) | [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md) | [Online SCTE-35 Parser](https://iodisco.com/scte35) | [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35)
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
281
|
+
[Install threefive3](#install) |[SCTE-35 Cli](#the-cli-tool) |[SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) | [SCTE-35 HLS](https://github.com/superkabuki/threefive3/blob/main/hls.md) | [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md) | [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md) | [Online SCTE-35 Parser](https://iodisco.com/scte35) | [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) | [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35)
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
[Install threefive3](#install) |[SCTE-35 Cli](#the-cli-tool) |[SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) | [SCTE-35 HLS](https://github.com/superkabuki/threefive3/blob/main/hls.md) | [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md) | [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md) | [Online SCTE-35 Parser](https://iodisco.com/scte35) | [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) | [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35)
|
|
2
|
+
|
|
3
|
+
# threefive3 SCTE-35 cli super tool and python3 library.
|
|
4
|
+
> Brought to you by the fine folks at fu-corp _( Adrian and the two blonde Chinese girls. )_
|
|
2
5
|
|
|
3
6
|
✅ SCTE-35 Parser ✅ SCTE-35 Encoder ✅ SCTE-35 HLS ✅ SCTE-35 Xml ✅ SCTE-35 Cli ✅ SCTE-35 library
|
|
4
7
|
|
|
5
8
|
|
|
6
|
-
* Parses SCTE-35 from MPEGTS, HLS, XML, XML+Binary, Base64, Bytes, Hex,
|
|
7
|
-
*
|
|
9
|
+
* Parses SCTE-35 from MPEGTS, HLS, XML, XML+Binary, Base64, Bytes, Hex, Integers, or JSON.
|
|
10
|
+
* Encode SCTE-35 to Base64, Bytes, Hex, Int, JSON, Xml, or Xml+binary.
|
|
11
|
+
* Built-in network support for HTTP(S), UDP, and Multicast.
|
|
8
12
|
* Automatic AES decryption for HLS.
|
|
9
|
-
* All HLS SCTE-35 Tags are Supported
|
|
10
|
-
___
|
|
11
|
-
* [Install](#install)
|
|
12
|
-
* [SCTE-35 Cli](#the-cli-tool)
|
|
13
|
-
* [SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md)
|
|
14
|
-
* [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md)
|
|
15
|
-
* [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md)
|
|
16
|
-
* [Online SCTE-35 Parser](https://iodisco.com/scte35)
|
|
17
|
-
* [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md)
|
|
18
|
-
* [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35)
|
|
13
|
+
* All HLS SCTE-35 Tags are Supported.
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
### Latest release is v3.0.21
|
|
16
|
+
> Stay up to date, only the latest release is supported.
|
|
17
|
+
___
|
|
18
|
+
### MPEGTS streams can be parsed for SCTE-35 with three lines of code.
|
|
21
19
|
|
|
22
20
|
```py3
|
|
23
21
|
a@fu:~/build5/scte35/scte35$ pypy3
|
|
@@ -32,10 +30,56 @@ Type "help", "copyright", "credits" or "license" for more information.
|
|
|
32
30
|
>>>> strm.decode()
|
|
33
31
|
```
|
|
34
32
|
|
|
33
|
+
# `Documentation`
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
* [Install](#install)
|
|
37
|
+
|
|
38
|
+
#### Cli
|
|
39
|
+
|
|
40
|
+
* [SCTE-35 Cli Super Tool](#the-cli-tool) Encodes, Decodes, and Recodes. This is pretty cool, it does SCTE-35 seven different ways.
|
|
41
|
+
* The cli tool comes with builtin documentation just type `threefive3 help`
|
|
42
|
+
|
|
43
|
+
### HLS
|
|
44
|
+
* [Advanced Parsing of SCTE-35 in HLS with threefive3](https://github.com/superkabuki/threefive3/blob/main/hls.md) All HLS SCTE-35 tags, Sidecar Files, AAC ID3 Header Timestamps, SCTE-35 filters and more.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
#### Xml
|
|
48
|
+
|
|
49
|
+
* [SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) The people wanted it so I finally did Xml.
|
|
50
|
+
* I feel cheap and dirty.
|
|
51
|
+
___
|
|
52
|
+
|
|
53
|
+
#### `Classes`
|
|
54
|
+
|
|
55
|
+
* The python built in help is always the most up to date docs for the library.
|
|
56
|
+
|
|
57
|
+
```rebol
|
|
58
|
+
a@fu:~/build7/threefive3$ pypy3
|
|
59
|
+
Python 3.9.16 (7.3.11+dfsg-2+deb12u3, Dec 30 2024, 22:36:23)
|
|
60
|
+
[PyPy 7.3.11 with GCC 12.2.0] on linux
|
|
61
|
+
Type "help", "copyright", "credits" or "license" for more information.
|
|
62
|
+
>>>> from threefive import Stream
|
|
63
|
+
>>>> help(Stream)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
* [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md) Cue is the main SCTE-35 class to use.
|
|
67
|
+
* [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md) The Stream class handles MPEGTS SCTE-35 streams local, Http(s), UDP, and Multicast.
|
|
35
68
|
___
|
|
36
69
|
|
|
70
|
+
#### `| more`
|
|
71
|
+
|
|
72
|
+
* [Online SCTE-35 Parser](https://iodisco.com/scte35) Supporte Base64, Bytes,Hex,Int, Json, Xml, and Xml+binary.
|
|
73
|
+
* __Damn__.
|
|
74
|
+
|
|
75
|
+
* [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) Some encoding code examples.
|
|
37
76
|
|
|
38
|
-
|
|
77
|
+
* [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35) FFmpeg with the SuperKabui SCTE-35 Patch applied.
|
|
78
|
+
* __Hell Yes.__
|
|
79
|
+
|
|
80
|
+
___
|
|
81
|
+
|
|
82
|
+
### `Install`
|
|
39
83
|
* python3 via pip
|
|
40
84
|
```rebol
|
|
41
85
|
python3 -mpip install threefive3
|
|
@@ -53,10 +97,10 @@ make install
|
|
|
53
97
|
___
|
|
54
98
|
|
|
55
99
|
|
|
56
|
-
|
|
100
|
+
### `The Cli tool`
|
|
57
101
|
|
|
58
102
|
|
|
59
|
-
|
|
103
|
+
#### The cli tool installs automatically with pip or the Makefile.
|
|
60
104
|
|
|
61
105
|
* [__SCTE-35 Inputs__](#inputs)
|
|
62
106
|
* [__SCTE-35 Outputs__](#outputs)
|
|
@@ -66,7 +110,7 @@ ___
|
|
|
66
110
|
* [Display raw __SCTE-35 packets__ from __video streams__](#packets)
|
|
67
111
|
* [__Repair SCTE-35 streams__ changed to __bin data__ by __ffmpeg__](#sixfix)
|
|
68
112
|
|
|
69
|
-
|
|
113
|
+
#### `Inputs`
|
|
70
114
|
|
|
71
115
|
* Most __inputs__ are __auto-detected.__
|
|
72
116
|
* __stdin__ is __auto selected__ and __auto detected.__
|
|
@@ -76,7 +120,7 @@ ___
|
|
|
76
120
|
```rebol
|
|
77
121
|
threefive3 udp://@235.2.5.35:3535
|
|
78
122
|
```
|
|
79
|
-
* If a file comtains a SCTE-35
|
|
123
|
+
* If a file comtains a SCTE-35 cue as a string( base64,hex,int,json,xml or xml+bin), redirect the file contents.
|
|
80
124
|
```rebol
|
|
81
125
|
|
|
82
126
|
threefive3 < json.json
|
|
@@ -117,7 +161,7 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
117
161
|
| | |
|
|
118
162
|
|
|
119
163
|
|
|
120
|
-
|
|
164
|
+
#### Outputs
|
|
121
165
|
* output type is determined by the key words __base64, bytes, hex, int, json, xml, and xmlbin__.
|
|
122
166
|
* __json is the default__.
|
|
123
167
|
* __Any input (except HLS,) can be returned as any output__
|
|
@@ -134,55 +178,55 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
134
178
|
| Xml | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' xml ` ` |
|
|
135
179
|
| Xml+bin | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b xmlbin ` |`
|
|
136
180
|
|
|
137
|
-
|
|
181
|
+
#### `hls`
|
|
138
182
|
* parse hls manifests and segments for SCTE-35
|
|
139
183
|
```smalltalk
|
|
140
184
|
threefive3 hls https://example.com/master.m3u8
|
|
141
185
|
```
|
|
142
186
|
___
|
|
143
|
-
|
|
187
|
+
#### `Iframes`
|
|
144
188
|
* Show iframes PTS in an MPEGTS video
|
|
145
189
|
|
|
146
190
|
```smalltalk
|
|
147
191
|
threefive3 iframes https://example.com/video.ts
|
|
148
192
|
```
|
|
149
193
|
___
|
|
150
|
-
|
|
194
|
+
#### `packets`
|
|
151
195
|
* Print raw SCTE-35 packets from multicast mpegts video
|
|
152
196
|
|
|
153
197
|
```smalltalk
|
|
154
198
|
threefive3 packets udp://@235.35.3.5:3535
|
|
155
199
|
```
|
|
156
200
|
___
|
|
157
|
-
|
|
201
|
+
#### `proxy`
|
|
158
202
|
* Parse a https stream and write raw video to stdout
|
|
159
203
|
|
|
160
204
|
```smalltalk
|
|
161
205
|
threefive3 proxy video.ts
|
|
162
206
|
```
|
|
163
207
|
___
|
|
164
|
-
|
|
208
|
+
#### `pts`
|
|
165
209
|
* Print PTS from mpegts video
|
|
166
210
|
|
|
167
211
|
```smalltalk
|
|
168
212
|
threefive3 pts video.ts
|
|
169
213
|
```
|
|
170
214
|
___
|
|
171
|
-
|
|
215
|
+
#### `sidecar`
|
|
172
216
|
* Parse a stream, write pts,write SCTE-35 Cues to sidecar.txt
|
|
173
217
|
|
|
174
218
|
```smalltalk
|
|
175
219
|
threefive3 sidecar video.ts
|
|
176
220
|
```
|
|
177
221
|
___
|
|
178
|
-
|
|
222
|
+
#### `sixfix`
|
|
179
223
|
* Fix SCTE-35 data mangled by ffmpeg
|
|
180
224
|
|
|
181
225
|
```smalltalk
|
|
182
226
|
threefive3 sixfix video.ts
|
|
183
227
|
```
|
|
184
228
|
___
|
|
185
|
-
|
|
229
|
+
#### `show`
|
|
186
230
|
|
|
187
231
|
* Probe mpegts video _( kind of like ffprobe )_
|
|
188
232
|
|
|
@@ -190,32 +234,27 @@ ___
|
|
|
190
234
|
threefive3 show video.ts
|
|
191
235
|
```
|
|
192
236
|
___
|
|
193
|
-
|
|
237
|
+
#### `version`
|
|
194
238
|
* Show version
|
|
195
239
|
|
|
196
240
|
```smalltalk
|
|
197
241
|
threefive3 version
|
|
198
242
|
```
|
|
199
243
|
___
|
|
200
|
-
|
|
244
|
+
#### `help`
|
|
201
245
|
* Help
|
|
202
246
|
```rebol
|
|
203
247
|
threefive3 help
|
|
204
248
|
```
|
|
205
249
|
___
|
|
206
250
|
|
|
207
|
-

|
|
208
251
|
|
|
209
|
-
___
|
|
210
252
|
|
|
211
|
-
|
|
253
|
+
### [iodisco.com/scte35](https://iodisco.com/scte35)
|
|
212
254
|

|
|
213
255
|
|
|
214
256
|
|
|
215
257
|
|
|
216
258
|
___
|
|
217
259
|
|
|
218
|
-
[Install](#install) |[SCTE-35 Cli](#the-cli-tool) |[SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) | [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md) | [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md) | [Online SCTE-35 Parser](https://iodisco.com/scte35) | [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35)
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
260
|
+
[Install threefive3](#install) |[SCTE-35 Cli](#the-cli-tool) |[SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) | [SCTE-35 HLS](https://github.com/superkabuki/threefive3/blob/main/hls.md) | [Cue Class](https://github.com/superkabuki/threefive3/blob/main/cue.md) | [Stream Class](https://github.com/superkabuki/threefive3/blob/main/stream.md) | [Online SCTE-35 Parser](https://iodisco.com/scte35) | [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) | [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/python3
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
"""
|
|
4
4
|
scte35 command line SCTE35 decoder.
|
|
@@ -10,10 +10,10 @@ import select
|
|
|
10
10
|
import sys
|
|
11
11
|
from threefive3.iframes import IFramer
|
|
12
12
|
from threefive3.new_reader import reader
|
|
13
|
-
from threefive3 import Cue, Stream, print2, version
|
|
13
|
+
from threefive3 import Cue, Stream, print2,blue, version, red
|
|
14
14
|
from threefive3.hls import cli as hlscli
|
|
15
15
|
from threefive3.sixfix import sixfix
|
|
16
|
-
|
|
16
|
+
import cProfile
|
|
17
17
|
# from sideways import cli as sidecli
|
|
18
18
|
|
|
19
19
|
REV = "\033[7;1m"
|
|
@@ -30,13 +30,12 @@ class SupaStream(Stream):
|
|
|
30
30
|
SupaStream is subclass of Stream used
|
|
31
31
|
to print raw SCTE-35 packets.
|
|
32
32
|
"""
|
|
33
|
-
|
|
34
33
|
def _parse_scte35(self, pkt, pid):
|
|
35
34
|
print2(pkt)
|
|
36
35
|
print2("")
|
|
37
36
|
super()._parse_scte35(pkt, pid)
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
|
|
40
39
|
def mk_sidecar(cue):
|
|
41
40
|
"""
|
|
42
41
|
mk_sidecar generates a sidecar file with the SCTE-35 Cues
|
|
@@ -318,10 +317,12 @@ def to_funk(this):
|
|
|
318
317
|
strm = Stream(this)
|
|
319
318
|
strm.decode(func=funk()) # funk() works here
|
|
320
319
|
except: # try to load json or xml
|
|
320
|
+
cue = Cue()
|
|
321
321
|
try:
|
|
322
|
-
cue =
|
|
322
|
+
cue.bites = cue._mk_bits(this)
|
|
323
|
+
cue.decode()
|
|
323
324
|
except:
|
|
324
|
-
print2(
|
|
325
|
+
print2("Bad Data:\n")
|
|
325
326
|
sys.exit()
|
|
326
327
|
if cue:
|
|
327
328
|
funk()(cue) # func works here too.
|
|
@@ -359,9 +360,13 @@ def chk_funk_map():
|
|
|
359
360
|
sys.exit()
|
|
360
361
|
|
|
361
362
|
|
|
362
|
-
|
|
363
|
+
def go():
|
|
363
364
|
if len(sys.argv) < 2:
|
|
364
365
|
sys.argv.append("json")
|
|
365
366
|
chk_print_map()
|
|
366
367
|
chk_mpegts_map()
|
|
367
368
|
chk_funk_map()
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
if __name__ == "__main__":
|
|
372
|
+
go()
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
threefive3.__init__.py
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
from .cue import Cue
|
|
6
|
+
from .encode import mk_splice_null, mk_time_signal, mk_splice_insert
|
|
7
|
+
from .hls import HlsParser
|
|
8
|
+
from .hlstags import TagParser
|
|
7
9
|
from .section import SpliceInfoSection
|
|
8
10
|
from .segment import Segment
|
|
9
11
|
from .stream import Stream
|
|
10
|
-
from .stuff import print2
|
|
12
|
+
from .stuff import print2, iso8601, atohif ,red, blue
|
|
13
|
+
from .superkabuki import SuperKabuki
|
|
11
14
|
from .version import version
|
|
12
15
|
|
|
13
16
|
from .commands import (
|
|
@@ -5,7 +5,7 @@ the class SCTE35Base.
|
|
|
5
5
|
|
|
6
6
|
import json
|
|
7
7
|
from .bitn import NBin
|
|
8
|
-
from .stuff import print2
|
|
8
|
+
from .stuff import print2, red
|
|
9
9
|
from .xml import Node
|
|
10
10
|
|
|
11
11
|
|
|
@@ -17,9 +17,6 @@ class SCTE35Base:
|
|
|
17
17
|
|
|
18
18
|
ROLLOVER = 8589934591
|
|
19
19
|
|
|
20
|
-
def __init__(self):
|
|
21
|
-
self.errors = []
|
|
22
|
-
|
|
23
20
|
def __repr__(self):
|
|
24
21
|
return str(self.__dict__)
|
|
25
22
|
|
|
@@ -32,7 +29,7 @@ class SCTE35Base:
|
|
|
32
29
|
def _err2(self, var_name, var_value, bit_count, var_type):
|
|
33
30
|
var_type = str(var_type).split("'")[1]
|
|
34
31
|
err_mesg = f"{var_name} is {var_value} , it should be type {var_type}, {bit_count} bit(s) long."
|
|
35
|
-
|
|
32
|
+
red(err_mesg)
|
|
36
33
|
|
|
37
34
|
def _bool_int(self, var_name, var_value, bit_count, var_type):
|
|
38
35
|
if var_type == int:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
The bitn.Bitn and bitn.NBin classes
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from .stuff import
|
|
5
|
+
from .stuff import red
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Bitn:
|
|
@@ -16,7 +16,10 @@ class Bitn:
|
|
|
16
16
|
def __init__(self, bites):
|
|
17
17
|
# self.bites = bites
|
|
18
18
|
self.bitsize = self.idx = len(bites) << 3
|
|
19
|
-
|
|
19
|
+
if isinstance(bites, bytes):
|
|
20
|
+
self.bits = int.from_bytes(bites, byteorder="big")
|
|
21
|
+
if isinstance(bites, int):
|
|
22
|
+
self.bits = bites
|
|
20
23
|
|
|
21
24
|
def __repr__(self):
|
|
22
25
|
return str(vars(self))
|
|
@@ -89,8 +92,8 @@ class Bitn:
|
|
|
89
92
|
negative_shift is called instead of
|
|
90
93
|
throwing a negative shift count error.
|
|
91
94
|
"""
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
red(f"{num_bits} bits requested, but only {self.idx} bits left.")
|
|
96
|
+
red(f"\n bytes remaining: {self.as_bytes(self.idx)} ")
|
|
94
97
|
|
|
95
98
|
|
|
96
99
|
class NBin:
|
|
@@ -157,7 +160,7 @@ class NBin:
|
|
|
157
160
|
if isinstance(hex_str, str):
|
|
158
161
|
dehexed = int(hex_str, 16)
|
|
159
162
|
# just in case hex_str is an int....
|
|
160
|
-
|
|
163
|
+
if isinstance(hex_str, int):
|
|
161
164
|
dehexed = hex_str
|
|
162
165
|
self.add_int(dehexed, bit_len)
|
|
163
166
|
|
|
@@ -4,6 +4,7 @@ SCTE35 Splice Commands
|
|
|
4
4
|
|
|
5
5
|
from .bitn import Bitn
|
|
6
6
|
from .base import SCTE35Base
|
|
7
|
+
from .stuff import red
|
|
7
8
|
from .xml import Node
|
|
8
9
|
|
|
9
10
|
|
|
@@ -13,7 +14,6 @@ class SpliceCommand(SCTE35Base):
|
|
|
13
14
|
"""
|
|
14
15
|
|
|
15
16
|
def __init__(self, bites=None):
|
|
16
|
-
super().__init__()
|
|
17
17
|
self.command_length = 0
|
|
18
18
|
self.command_type = None
|
|
19
19
|
self.name = None
|
|
@@ -165,9 +165,7 @@ class TimeSignal(SpliceCommand):
|
|
|
165
165
|
if self.time_specified_flag:
|
|
166
166
|
nbin.reserve(6)
|
|
167
167
|
if not isinstance(self.pts_time, float):
|
|
168
|
-
|
|
169
|
-
"\033[7mA float for pts_time for the splice command is required.\033[27m"
|
|
170
|
-
)
|
|
168
|
+
red(" A float for pts_time for the splice command is required. ")
|
|
171
169
|
self.pts_time = round(self.pts_time, 6)
|
|
172
170
|
nbin.add_int(int(self.as_ticks(self.pts_time)), 33)
|
|
173
171
|
else:
|
|
@@ -297,7 +295,7 @@ class SpliceInsert(TimeSignal):
|
|
|
297
295
|
}
|
|
298
296
|
for k, v in si_attrs.items():
|
|
299
297
|
if v is None:
|
|
300
|
-
|
|
298
|
+
red(f"SpliceInsert.{k} needs to be set")
|
|
301
299
|
si = Node("SpliceInsert", attrs=si_attrs, ns=ns)
|
|
302
300
|
if self.pts_time:
|
|
303
301
|
prgm = Node("Program", ns=ns)
|