threefive3 3.0.25__tar.gz → 3.0.29__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.25/threefive3.egg-info → threefive3-3.0.29}/PKG-INFO +12 -23
- {threefive3-3.0.25 → threefive3-3.0.29}/README.md +11 -22
- {threefive3-3.0.25 → threefive3-3.0.29}/bin/threefive3 +19 -22
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/__init__.py +3 -13
- threefive3-3.0.29/threefive3/aac.py +62 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/base.py +5 -14
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/bitn.py +3 -1
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/commands.py +0 -70
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/cue.py +13 -47
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/descriptors.py +3 -118
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/gums.py +4 -1
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/hls.py +19 -62
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/new_reader.py +2 -1
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/section.py +0 -15
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/stream.py +8 -12
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/upids.py +2 -99
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/version.py +2 -2
- {threefive3-3.0.25 → threefive3-3.0.29/threefive3.egg-info}/PKG-INFO +12 -23
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3.egg-info/SOURCES.txt +1 -3
- threefive3-3.0.25/threefive3/sxp.py +0 -94
- threefive3-3.0.25/threefive3/x2c.py +0 -253
- threefive3-3.0.25/threefive3/xml.py +0 -355
- {threefive3-3.0.25 → threefive3-3.0.29}/LICENSE +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/setup.cfg +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/setup.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/crc.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/encode.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/hlstags.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/iframes.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/packetdata.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/segment.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/segmentation.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/sixfix.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/streamtypes.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/stuff.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/superkabuki.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3/words.py +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3.egg-info/dependency_links.txt +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/threefive3.egg-info/requires.txt +0 -0
- {threefive3-3.0.25 → threefive3-3.0.29}/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.29
|
|
4
4
|
Summary: SCTE-35 decoder and encoder with MPEGTS and HLS and XML support.
|
|
5
5
|
Home-page: https://github.com/superkabuki/threefive3
|
|
6
6
|
Author: Adrian of Doom
|
|
@@ -22,18 +22,18 @@ License-File: LICENSE
|
|
|
22
22
|
Canada has a virtual monopoly on the World's mustard seed supply and they will use it to manipulate financial markets. We must act.
|
|
23
23
|
## Nuke Canada Now!
|
|
24
24
|
|
|
25
|
-
[Install threefive3](#install) |[SCTE-35 Cli](#the-cli-tool) |
|
|
25
|
+
[Install threefive3](#install) |[SCTE-35 Cli](#the-cli-tool) | [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)
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
# threefive3 SCTE-35 cli super tool and python3 library.
|
|
30
30
|
> Brought to you by the fine folks at fu-corp _( Adrian and the two blonde Chinese girls. )_
|
|
31
31
|
|
|
32
|
-
✅ SCTE-35 Parser ✅ SCTE-35 Encoder ✅ SCTE-35 HLS ✅ SCTE-35 Xml ✅ SCTE-35 Cli ✅ SCTE-35 library
|
|
32
|
+
✅ SCTE-35 Parser ✅ SCTE-35 Encoder ✅ SCTE-35 HLS ✅ SCTE-35 Xml+binary ✅ SCTE-35 Cli ✅ SCTE-35 library
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
* Parses SCTE-35 from MPEGTS, HLS, XML
|
|
36
|
-
* Encode SCTE-35 to Base64, Bytes, Hex, Int, JSON,
|
|
35
|
+
* Parses SCTE-35 from MPEGTS, HLS, XML+Binary, Base64, Bytes, Hex, Integers, or JSON.
|
|
36
|
+
* Encode SCTE-35 to Base64, Bytes, Hex, Int, JSON, or Xml+binary.
|
|
37
37
|
* Built-in network support for HTTP(S), UDP, and Multicast.
|
|
38
38
|
* Automatic AES decryption for HLS.
|
|
39
39
|
* All HLS SCTE-35 Tags are Supported.
|
|
@@ -73,7 +73,7 @@ Type "help", "copyright", "credits" or "license" for more information.
|
|
|
73
73
|
| six2scte35 | ffmpeg bin data stream back to scte-35 | Done |
|
|
74
74
|
| superkabuki | scte-35 packet injection | Next release |
|
|
75
75
|
| sideways | hls scte-35 tag injecton | No |
|
|
76
|
-
| gums | multicast server |
|
|
76
|
+
| gums | multicast server | Done |
|
|
77
77
|
| adbreak3 | fast cli scte-35 cue creation | No |
|
|
78
78
|
|
|
79
79
|
|
|
@@ -110,12 +110,6 @@ If you want to get involved, just open an issue and we can talk about it.
|
|
|
110
110
|
* [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... Who loves you baby?
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
#### Xml
|
|
114
|
-
|
|
115
|
-
* [SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) The people wanted it so I finally did Xml.
|
|
116
|
-
* I feel cheap and dirty.
|
|
117
|
-
___
|
|
118
|
-
|
|
119
113
|
#### `Classes`
|
|
120
114
|
|
|
121
115
|
* The python built in help is always the most up to date docs for the library.
|
|
@@ -184,17 +178,14 @@ ___
|
|
|
184
178
|
```rebol
|
|
185
179
|
threefive3 udp://@235.2.5.35:3535
|
|
186
180
|
```
|
|
187
|
-
* If a file comtains a SCTE-35 cue as a string( base64,hex,int,json,
|
|
181
|
+
* If a file comtains a SCTE-35 cue as a string( base64,hex,int,json,or xml+bin), redirect the file contents.
|
|
188
182
|
```rebol
|
|
189
183
|
|
|
190
184
|
threefive3 < json.json
|
|
191
185
|
|
|
192
|
-
threefive3 < xml.xml
|
|
193
|
-
|
|
194
|
-
cat xml.xml | threefive3
|
|
195
186
|
```
|
|
196
187
|
|
|
197
|
-
* quoted strings(( base64,hex,int,json
|
|
188
|
+
* quoted strings(( base64,hex,int,json or xml+bin), can be passed directly on the command line as well.
|
|
198
189
|
|
|
199
190
|
```awk
|
|
200
191
|
|
|
@@ -209,8 +200,7 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
209
200
|
| __Hex__ |`threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b`|
|
|
210
201
|
| __HLS__ |`threefive3 hls https://example.com/master.m3u8` |
|
|
211
202
|
| __JSON__ |`threefive3 < json.json` |
|
|
212
|
-
|
|
|
213
|
-
| __Xmlbin__ | `js threefive3 < xmlbin.xml` |
|
|
203
|
+
| __Xmlbin__ | `js threefive3 < xmlbin.xml` |
|
|
214
204
|
|
|
215
205
|
# `Streams`
|
|
216
206
|
|
|
@@ -226,10 +216,10 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
226
216
|
|
|
227
217
|
|
|
228
218
|
#### Outputs
|
|
229
|
-
* output type is determined by the key words __base64, bytes, hex, int, json,
|
|
219
|
+
* output type is determined by the key words __base64, bytes, hex, int, json, and xmlbin__.
|
|
230
220
|
* __json is the default__.
|
|
231
221
|
* __Any input (except HLS,) can be returned as any output__
|
|
232
|
-
* examples __Base64 to Hex__
|
|
222
|
+
* examples __Base64 to Hex__ etc...)
|
|
233
223
|
|
|
234
224
|
|
|
235
225
|
| Output Type | Cli Example |
|
|
@@ -239,7 +229,6 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
239
229
|
| Hex | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' hex` |
|
|
240
230
|
| Integer | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' int` |
|
|
241
231
|
| JSON | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b json ` |
|
|
242
|
-
| Xml | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' xml ` ` |
|
|
243
232
|
| Xml+bin | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b xmlbin ` |`
|
|
244
233
|
|
|
245
234
|
#### `hls`
|
|
@@ -321,4 +310,4 @@ ___
|
|
|
321
310
|
|
|
322
311
|
___
|
|
323
312
|
|
|
324
|
-
[Install threefive3](#install)
|
|
313
|
+
[Install threefive3](#install) | [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,18 +1,18 @@
|
|
|
1
1
|
Canada has a virtual monopoly on the World's mustard seed supply and they will use it to manipulate financial markets. We must act.
|
|
2
2
|
## Nuke Canada Now!
|
|
3
3
|
|
|
4
|
-
[Install threefive3](#install) |[SCTE-35 Cli](#the-cli-tool) |
|
|
4
|
+
[Install threefive3](#install) |[SCTE-35 Cli](#the-cli-tool) | [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)
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
# threefive3 SCTE-35 cli super tool and python3 library.
|
|
9
9
|
> Brought to you by the fine folks at fu-corp _( Adrian and the two blonde Chinese girls. )_
|
|
10
10
|
|
|
11
|
-
✅ SCTE-35 Parser ✅ SCTE-35 Encoder ✅ SCTE-35 HLS ✅ SCTE-35 Xml ✅ SCTE-35 Cli ✅ SCTE-35 library
|
|
11
|
+
✅ SCTE-35 Parser ✅ SCTE-35 Encoder ✅ SCTE-35 HLS ✅ SCTE-35 Xml+binary ✅ SCTE-35 Cli ✅ SCTE-35 library
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
* Parses SCTE-35 from MPEGTS, HLS, XML
|
|
15
|
-
* Encode SCTE-35 to Base64, Bytes, Hex, Int, JSON,
|
|
14
|
+
* Parses SCTE-35 from MPEGTS, HLS, XML+Binary, Base64, Bytes, Hex, Integers, or JSON.
|
|
15
|
+
* Encode SCTE-35 to Base64, Bytes, Hex, Int, JSON, or Xml+binary.
|
|
16
16
|
* Built-in network support for HTTP(S), UDP, and Multicast.
|
|
17
17
|
* Automatic AES decryption for HLS.
|
|
18
18
|
* All HLS SCTE-35 Tags are Supported.
|
|
@@ -52,7 +52,7 @@ Type "help", "copyright", "credits" or "license" for more information.
|
|
|
52
52
|
| six2scte35 | ffmpeg bin data stream back to scte-35 | Done |
|
|
53
53
|
| superkabuki | scte-35 packet injection | Next release |
|
|
54
54
|
| sideways | hls scte-35 tag injecton | No |
|
|
55
|
-
| gums | multicast server |
|
|
55
|
+
| gums | multicast server | Done |
|
|
56
56
|
| adbreak3 | fast cli scte-35 cue creation | No |
|
|
57
57
|
|
|
58
58
|
|
|
@@ -89,12 +89,6 @@ If you want to get involved, just open an issue and we can talk about it.
|
|
|
89
89
|
* [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... Who loves you baby?
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
#### Xml
|
|
93
|
-
|
|
94
|
-
* [SCTE-35 Xml ](https://github.com/superkabuki/threefive3/blob/main/xml.md) The people wanted it so I finally did Xml.
|
|
95
|
-
* I feel cheap and dirty.
|
|
96
|
-
___
|
|
97
|
-
|
|
98
92
|
#### `Classes`
|
|
99
93
|
|
|
100
94
|
* The python built in help is always the most up to date docs for the library.
|
|
@@ -163,17 +157,14 @@ ___
|
|
|
163
157
|
```rebol
|
|
164
158
|
threefive3 udp://@235.2.5.35:3535
|
|
165
159
|
```
|
|
166
|
-
* If a file comtains a SCTE-35 cue as a string( base64,hex,int,json,
|
|
160
|
+
* If a file comtains a SCTE-35 cue as a string( base64,hex,int,json,or xml+bin), redirect the file contents.
|
|
167
161
|
```rebol
|
|
168
162
|
|
|
169
163
|
threefive3 < json.json
|
|
170
164
|
|
|
171
|
-
threefive3 < xml.xml
|
|
172
|
-
|
|
173
|
-
cat xml.xml | threefive3
|
|
174
165
|
```
|
|
175
166
|
|
|
176
|
-
* quoted strings(( base64,hex,int,json
|
|
167
|
+
* quoted strings(( base64,hex,int,json or xml+bin), can be passed directly on the command line as well.
|
|
177
168
|
|
|
178
169
|
```awk
|
|
179
170
|
|
|
@@ -188,8 +179,7 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
188
179
|
| __Hex__ |`threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b`|
|
|
189
180
|
| __HLS__ |`threefive3 hls https://example.com/master.m3u8` |
|
|
190
181
|
| __JSON__ |`threefive3 < json.json` |
|
|
191
|
-
|
|
|
192
|
-
| __Xmlbin__ | `js threefive3 < xmlbin.xml` |
|
|
182
|
+
| __Xmlbin__ | `js threefive3 < xmlbin.xml` |
|
|
193
183
|
|
|
194
184
|
# `Streams`
|
|
195
185
|
|
|
@@ -205,10 +195,10 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
205
195
|
|
|
206
196
|
|
|
207
197
|
#### Outputs
|
|
208
|
-
* output type is determined by the key words __base64, bytes, hex, int, json,
|
|
198
|
+
* output type is determined by the key words __base64, bytes, hex, int, json, and xmlbin__.
|
|
209
199
|
* __json is the default__.
|
|
210
200
|
* __Any input (except HLS,) can be returned as any output__
|
|
211
|
-
* examples __Base64 to Hex__
|
|
201
|
+
* examples __Base64 to Hex__ etc...)
|
|
212
202
|
|
|
213
203
|
|
|
214
204
|
| Output Type | Cli Example |
|
|
@@ -218,7 +208,6 @@ threefive3 '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='
|
|
|
218
208
|
| Hex | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' hex` |
|
|
219
209
|
| Integer | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' int` |
|
|
220
210
|
| JSON | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b json ` |
|
|
221
|
-
| Xml | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' xml ` ` |
|
|
222
211
|
| Xml+bin | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b xmlbin ` |`
|
|
223
212
|
|
|
224
213
|
#### `hls`
|
|
@@ -300,4 +289,4 @@ ___
|
|
|
300
289
|
|
|
301
290
|
___
|
|
302
291
|
|
|
303
|
-
[Install threefive3](#install)
|
|
292
|
+
[Install threefive3](#install) | [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)
|
|
@@ -16,7 +16,6 @@ from threefive3 import Cue, Stream, print2, blue, version, red
|
|
|
16
16
|
from threefive3.hls import cli as hlscli
|
|
17
17
|
from threefive3.sixfix import sixfix
|
|
18
18
|
import cProfile
|
|
19
|
-
|
|
20
19
|
# from sideways import cli as sidecli
|
|
21
20
|
|
|
22
21
|
REV = "\033[7;1m"
|
|
@@ -33,13 +32,12 @@ class SupaStream(Stream):
|
|
|
33
32
|
SupaStream is subclass of Stream used
|
|
34
33
|
to print raw SCTE-35 packets.
|
|
35
34
|
"""
|
|
36
|
-
|
|
37
35
|
def _parse_scte35(self, pkt, pid):
|
|
38
36
|
print2(pkt)
|
|
39
37
|
print2("")
|
|
40
38
|
super()._parse_scte35(pkt, pid)
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
|
|
43
41
|
def mk_sidecar(cue):
|
|
44
42
|
"""
|
|
45
43
|
mk_sidecar generates a sidecar file with the SCTE-35 Cues
|
|
@@ -56,17 +54,16 @@ def mk_sidecar(cue):
|
|
|
56
54
|
HELP = f"""
|
|
57
55
|
{BLUE} threefive3 cli tool {U}
|
|
58
56
|
|
|
59
|
-
{B} Default {U} {BLUE}The default action is to read
|
|
57
|
+
{B} Default {U} {BLUE}The default action is to read a input and write a SCTE-35 output.{U}
|
|
60
58
|
|
|
61
|
-
{BLUE}Inputs {U} mpegts, base64, hex, json,
|
|
59
|
+
{BLUE}Inputs {U} mpegts, base64, hex, json,and xmlbin{U}.
|
|
62
60
|
|
|
63
|
-
{BLUE}Outputs{U} base64, bytes, hex, int, json,
|
|
61
|
+
{BLUE}Outputs{U} base64, bytes, hex, int, json, and xmlbin.{U}
|
|
64
62
|
|
|
65
63
|
{BLUE}scte35 can read from {U} strings, files, stdin, http(s), multicast, and Udp.
|
|
66
64
|
|
|
67
65
|
Input {U} Output {U}
|
|
68
66
|
{U}{BLUE} mpegts {U} {U}{BLUE} base64 {NORM} threefive3 https://example.com/video.ts base64
|
|
69
|
-
{U}{BLUE} xml {U} {U}{BLUE} bytes {NORM} threefive3 bytes < xml.xml
|
|
70
67
|
{U}{BLUE} base64 {U} {U}{BLUE} hex {NORM} threefive3 '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q==' hex
|
|
71
68
|
{U}{BLUE} xmlbin {U} {U}{BLUE} int {NORM} threefive3 int < xml.xml
|
|
72
69
|
{U}{BLUE} mpegts {U} {U}{BLUE} json {NORM} threefive3 video.ts
|
|
@@ -79,9 +76,6 @@ HELP = f"""
|
|
|
79
76
|
|
|
80
77
|
{B} iframes {U}{BLUE} show MPEGTS iframes{NORM} threefive3 iframes video.ts
|
|
81
78
|
|
|
82
|
-
{B} mcast {U}{BLUE} Create a Multicast Stream {NORM} threefive3 mcast -I video.ts
|
|
83
|
-
{U}{BLUE}See mcast help {NORM} threefive3 mcast help
|
|
84
|
-
|
|
85
79
|
{B} packets {U}{NORM}{BLUE} Print raw SCTE-35 packets:{NORM} threefive3 packets udp://@235.35.3.5:3535
|
|
86
80
|
|
|
87
81
|
{B} proxy {U}{NORM}{BLUE} Parse a stream and copy it to stdout:{NORM} threefive3 proxy video.ts
|
|
@@ -274,13 +268,6 @@ def json_out(cue):
|
|
|
274
268
|
cue.show()
|
|
275
269
|
|
|
276
270
|
|
|
277
|
-
def xml_out(cue):
|
|
278
|
-
"""
|
|
279
|
-
xml_out prints cue as xml
|
|
280
|
-
"""
|
|
281
|
-
print2(cue.xml())
|
|
282
|
-
|
|
283
|
-
|
|
284
271
|
def xmlbin_out(cue):
|
|
285
272
|
"""
|
|
286
273
|
xml_out prints cue as xml
|
|
@@ -294,7 +281,6 @@ funk_map = {
|
|
|
294
281
|
"hex": hex_out,
|
|
295
282
|
"int": int_out,
|
|
296
283
|
"json": json_out,
|
|
297
|
-
"xml": xml_out,
|
|
298
284
|
"xmlbin": xmlbin_out,
|
|
299
285
|
}
|
|
300
286
|
|
|
@@ -328,8 +314,8 @@ def to_funk(this):
|
|
|
328
314
|
try:
|
|
329
315
|
cue.bites = cue._mk_bits(this)
|
|
330
316
|
cue.decode()
|
|
331
|
-
except
|
|
332
|
-
print2(
|
|
317
|
+
except:
|
|
318
|
+
print2("Bad Data:\n")
|
|
333
319
|
sys.exit()
|
|
334
320
|
if cue:
|
|
335
321
|
funk()(cue) # func works here too.
|
|
@@ -351,7 +337,7 @@ def chk_stdin(args):
|
|
|
351
337
|
strm = Stream(sys.stdin.buffer)
|
|
352
338
|
strm._parse(one + two) # dont drop first packet
|
|
353
339
|
strm.decode(func=funk())
|
|
354
|
-
sys.exit()
|
|
340
|
+
sys.exit() # I keep forgetting why I do
|
|
355
341
|
return args
|
|
356
342
|
|
|
357
343
|
|
|
@@ -366,7 +352,6 @@ def chk_funk_map():
|
|
|
366
352
|
_ = [to_funk(arg) for arg in args] # multiple file input
|
|
367
353
|
sys.exit()
|
|
368
354
|
|
|
369
|
-
|
|
370
355
|
# cli map
|
|
371
356
|
|
|
372
357
|
cli_map = {"mcast": gumscli, "superkabuki": skcli}
|
|
@@ -411,3 +396,15 @@ def go():
|
|
|
411
396
|
|
|
412
397
|
if __name__ == "__main__":
|
|
413
398
|
go()
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
def go():
|
|
402
|
+
if len(sys.argv) < 2:
|
|
403
|
+
sys.argv.append("json")
|
|
404
|
+
chk_print_map()
|
|
405
|
+
chk_mpegts_map()
|
|
406
|
+
chk_funk_map()
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
if __name__ == "__main__":
|
|
410
|
+
go()
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
threefive3.__init__.py
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
from .base import SCTE35Base
|
|
5
6
|
from .cue import Cue
|
|
6
7
|
from .encode import mk_splice_null, mk_time_signal, mk_splice_insert
|
|
7
8
|
from .hls import HlsParser
|
|
8
9
|
from .hlstags import TagParser
|
|
10
|
+
from .iframes import IFramer
|
|
11
|
+
from .new_reader import reader
|
|
9
12
|
from .section import SpliceInfoSection
|
|
10
13
|
from .segment import Segment
|
|
11
14
|
from .stream import Stream
|
|
@@ -32,16 +35,3 @@ from .descriptors import (
|
|
|
32
35
|
TimeDescriptor,
|
|
33
36
|
descriptor_map,
|
|
34
37
|
)
|
|
35
|
-
|
|
36
|
-
from .upids import (
|
|
37
|
-
Upid,
|
|
38
|
-
NoUpid,
|
|
39
|
-
AirId,
|
|
40
|
-
Atsc,
|
|
41
|
-
Eidr,
|
|
42
|
-
Isan,
|
|
43
|
-
Mid,
|
|
44
|
-
Mpu,
|
|
45
|
-
Umid,
|
|
46
|
-
upid_map,
|
|
47
|
-
)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""
|
|
2
|
+
aac.py
|
|
3
|
+
home of the AacParser for audio only hls renditions
|
|
4
|
+
"""
|
|
5
|
+
from .new_reader import reader
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
ROLLOVER = 95443.717678
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AacParser:
|
|
12
|
+
"""
|
|
13
|
+
AacParser parses aac segments.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
applehead = b"com.apple.streaming.transportStreamTimestamp"
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def is_header(header):
|
|
20
|
+
"""
|
|
21
|
+
is_header tests aac and ac3 files for ID3 headers.
|
|
22
|
+
"""
|
|
23
|
+
if header[:3] == b"ID3":
|
|
24
|
+
return True
|
|
25
|
+
return False
|
|
26
|
+
|
|
27
|
+
@staticmethod
|
|
28
|
+
def id3_len(header):
|
|
29
|
+
"""
|
|
30
|
+
id3_len parses the length value from ID3 headers
|
|
31
|
+
"""
|
|
32
|
+
id3len = int.from_bytes(header[6:], byteorder="big")
|
|
33
|
+
return id3len
|
|
34
|
+
|
|
35
|
+
@staticmethod
|
|
36
|
+
def syncsafe5(somebytes):
|
|
37
|
+
"""
|
|
38
|
+
syncsafe5 parses PTS from ID3 tags.
|
|
39
|
+
"""
|
|
40
|
+
lsb = len(somebytes) - 1
|
|
41
|
+
syncd = 0
|
|
42
|
+
for idx, bite in enumerate(somebytes):
|
|
43
|
+
syncd += bite << ((lsb - idx) << 3)
|
|
44
|
+
return round(syncd / 90000.0, 6)
|
|
45
|
+
|
|
46
|
+
def parse(self, media):
|
|
47
|
+
"""
|
|
48
|
+
aac_pts parses the ID3 header tags in aac and ac3 audio files
|
|
49
|
+
"""
|
|
50
|
+
pts = 0
|
|
51
|
+
aac = reader(media)
|
|
52
|
+
header = aac.read(10)
|
|
53
|
+
if self.is_header(header):
|
|
54
|
+
id3len = self.id3_len(header)
|
|
55
|
+
data = aac.read(id3len)
|
|
56
|
+
if self.applehead in data:
|
|
57
|
+
try:
|
|
58
|
+
pts = float(data.split(self.applehead)[1].split(b"\x00", 2)[1])
|
|
59
|
+
except:
|
|
60
|
+
pts = self.syncsafe5(data.split(self.applehead)[1][:9])
|
|
61
|
+
return round((pts % ROLLOVER), 6)
|
|
62
|
+
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
threefive3.base contains
|
|
3
3
|
the class SCTE35Base.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
import json
|
|
7
7
|
from .bitn import NBin
|
|
8
8
|
from .stuff import print2, red
|
|
9
|
-
from .xml import Node
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class SCTE35Base:
|
|
@@ -36,16 +35,19 @@ class SCTE35Base:
|
|
|
36
35
|
if isinstance(var_value, bool):
|
|
37
36
|
self._err2(var_name, var_value, bit_count, var_type)
|
|
38
37
|
return True
|
|
38
|
+
return False
|
|
39
39
|
|
|
40
40
|
def _wrong_type(self, var_name, var_value, bit_count, var_type):
|
|
41
41
|
if not isinstance(var_value, var_type):
|
|
42
42
|
self._err2(var_name, var_value, bit_count, var_type)
|
|
43
43
|
return True
|
|
44
|
+
return False
|
|
44
45
|
|
|
45
46
|
def _is_none(self, var_name, var_value, bit_count, var_type):
|
|
46
47
|
if var_value is None:
|
|
47
48
|
self._err2(var_name, var_value, bit_count, var_type)
|
|
48
49
|
return True
|
|
50
|
+
return False
|
|
49
51
|
|
|
50
52
|
def _chk_var(self, var_type, nbin_method, var_name, bit_count):
|
|
51
53
|
"""
|
|
@@ -56,6 +58,7 @@ class SCTE35Base:
|
|
|
56
58
|
if me(var_name, var_value, bit_count, var_type):
|
|
57
59
|
return
|
|
58
60
|
nbin_method(var_value, bit_count)
|
|
61
|
+
return
|
|
59
62
|
|
|
60
63
|
@staticmethod
|
|
61
64
|
def as_90k(int_time):
|
|
@@ -184,15 +187,3 @@ class SCTE35Base:
|
|
|
184
187
|
show prints self as json to stderr (2)
|
|
185
188
|
"""
|
|
186
189
|
print2(self.json())
|
|
187
|
-
|
|
188
|
-
def xml(self, ns="scte35"):
|
|
189
|
-
"""
|
|
190
|
-
xml default xml method will return
|
|
191
|
-
all attributes, which is expressly allowed
|
|
192
|
-
for SCTE-35 xml.
|
|
193
|
-
"""
|
|
194
|
-
xml_attrs = self.kv_clean()
|
|
195
|
-
iam = type(self)
|
|
196
|
-
iam = str(iam).split("'", 1)[1].split("'", 1)[0]
|
|
197
|
-
this = Node(iam, attrs=xml_attrs, ns=ns)
|
|
198
|
-
return this
|
|
@@ -157,12 +157,14 @@ class NBin:
|
|
|
157
157
|
and appends it to self.nbits
|
|
158
158
|
via self.add_int
|
|
159
159
|
"""
|
|
160
|
+
dehexed=False
|
|
160
161
|
if isinstance(hex_str, str):
|
|
161
162
|
dehexed = int(hex_str, 16)
|
|
162
163
|
# just in case hex_str is an int....
|
|
163
164
|
if isinstance(hex_str, int):
|
|
164
165
|
dehexed = hex_str
|
|
165
|
-
|
|
166
|
+
if dehexed:
|
|
167
|
+
self.add_int(dehexed, bit_len)
|
|
166
168
|
|
|
167
169
|
def add_flag(self, flg, bit_len=1):
|
|
168
170
|
"""
|
|
@@ -5,7 +5,6 @@ SCTE35 Splice Commands
|
|
|
5
5
|
from .bitn import Bitn
|
|
6
6
|
from .base import SCTE35Base
|
|
7
7
|
from .stuff import red
|
|
8
|
-
from .xml import Node
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class SpliceCommand(SCTE35Base):
|
|
@@ -54,12 +53,6 @@ class BandwidthReservation(SpliceCommand):
|
|
|
54
53
|
BandwidthReservation.decode method
|
|
55
54
|
"""
|
|
56
55
|
|
|
57
|
-
def xml(self, ns="scte35"):
|
|
58
|
-
"""
|
|
59
|
-
create XML Node of type BandwidthReservation
|
|
60
|
-
"""
|
|
61
|
-
return Node("BandwidthReservation", ns=ns)
|
|
62
|
-
|
|
63
56
|
|
|
64
57
|
class PrivateCommand(SpliceCommand):
|
|
65
58
|
"""
|
|
@@ -91,16 +84,6 @@ class PrivateCommand(SpliceCommand):
|
|
|
91
84
|
nbin.add_bites(self.private_bytes)
|
|
92
85
|
return nbin.bites
|
|
93
86
|
|
|
94
|
-
def xml(self, ns="scte35"):
|
|
95
|
-
"""
|
|
96
|
-
create XML Node of type PrivateCommand
|
|
97
|
-
"""
|
|
98
|
-
attrs = {"identifier": self.identifier}
|
|
99
|
-
pc = Node("PrivateCommand", attrs=attrs)
|
|
100
|
-
pc.add_child(Node("PrivateBytes", value=self.private_bytes.hex(), ns=ns))
|
|
101
|
-
return pc
|
|
102
|
-
|
|
103
|
-
|
|
104
87
|
class SpliceNull(SpliceCommand):
|
|
105
88
|
"""
|
|
106
89
|
Table 8 - splice_null()
|
|
@@ -111,9 +94,6 @@ class SpliceNull(SpliceCommand):
|
|
|
111
94
|
self.command_type = 0
|
|
112
95
|
self.name = "Splice Null"
|
|
113
96
|
|
|
114
|
-
def xml(self, ns="scte35"):
|
|
115
|
-
return Node("SpliceNull", ns=ns)
|
|
116
|
-
|
|
117
97
|
|
|
118
98
|
class TimeSignal(SpliceCommand):
|
|
119
99
|
"""
|
|
@@ -171,22 +151,6 @@ class TimeSignal(SpliceCommand):
|
|
|
171
151
|
else:
|
|
172
152
|
nbin.reserve(7)
|
|
173
153
|
|
|
174
|
-
def xml(self, ns="scte35"):
|
|
175
|
-
"""
|
|
176
|
-
xml return TimeSignal as an xml node
|
|
177
|
-
"""
|
|
178
|
-
ts = Node("TimeSignal", ns=ns)
|
|
179
|
-
if self.has("pts_time"):
|
|
180
|
-
if self.pts_time:
|
|
181
|
-
self.pts_time = round(self.pts_time, 6)
|
|
182
|
-
st = Node(
|
|
183
|
-
"SpliceTime",
|
|
184
|
-
attrs={"pts_time": self.as_ticks(self.pts_time)},
|
|
185
|
-
ns=ns,
|
|
186
|
-
)
|
|
187
|
-
ts.add_child(st)
|
|
188
|
-
return ts
|
|
189
|
-
|
|
190
154
|
|
|
191
155
|
class SpliceInsert(TimeSignal):
|
|
192
156
|
"""
|
|
@@ -279,40 +243,6 @@ class SpliceInsert(TimeSignal):
|
|
|
279
243
|
nbin.forward(6)
|
|
280
244
|
nbin.add_int(self.as_ticks(self.break_duration), 33)
|
|
281
245
|
|
|
282
|
-
def xml(self, ns="scte35"):
|
|
283
|
-
"""
|
|
284
|
-
xml return the SpliceInsert instance as an xml node.
|
|
285
|
-
"""
|
|
286
|
-
si_attrs = {
|
|
287
|
-
"splice_event_id": self.splice_event_id,
|
|
288
|
-
"splice_event_cancel_Indicator": self.splice_event_cancel_indicator,
|
|
289
|
-
"splice_immediate_flag": self.splice_immediate_flag,
|
|
290
|
-
"event_id_compliance_flag": self.event_id_compliance_flag,
|
|
291
|
-
"avail_num": self.avail_num,
|
|
292
|
-
"avails_expected": self.avails_expected,
|
|
293
|
-
"out_of_network_indicator": self.out_of_network_indicator,
|
|
294
|
-
"unique_program_id": self.unique_program_id,
|
|
295
|
-
}
|
|
296
|
-
for k, v in si_attrs.items():
|
|
297
|
-
if v is None:
|
|
298
|
-
red(f"SpliceInsert.{k} needs to be set")
|
|
299
|
-
si = Node("SpliceInsert", attrs=si_attrs, ns=ns)
|
|
300
|
-
if self.pts_time:
|
|
301
|
-
prgm = Node("Program", ns=ns)
|
|
302
|
-
st = Node(
|
|
303
|
-
"SpliceTime", attrs={"ptsTime": self.as_ticks(self.pts_time)}, ns=ns
|
|
304
|
-
)
|
|
305
|
-
prgm.add_child(st)
|
|
306
|
-
si.add_child(prgm)
|
|
307
|
-
if self.break_duration:
|
|
308
|
-
bd_attrs = {
|
|
309
|
-
"auto_return": self.break_auto_return,
|
|
310
|
-
"duration": self.as_ticks(self.break_duration),
|
|
311
|
-
}
|
|
312
|
-
bd = Node("BreakDuration", attrs=bd_attrs, ns=ns)
|
|
313
|
-
si.add_child(bd)
|
|
314
|
-
return si
|
|
315
|
-
|
|
316
246
|
|
|
317
247
|
# table 7
|
|
318
248
|
command_map = {
|