threefive3 3.0.33__tar.gz → 3.0.35__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.33/threefive3.egg-info → threefive3-3.0.35}/PKG-INFO +62 -65
- {threefive3-3.0.33 → threefive3-3.0.35}/README.md +64 -67
- {threefive3-3.0.33 → threefive3-3.0.35}/bin/threefive3 +14 -21
- {threefive3-3.0.33 → threefive3-3.0.35}/setup.py +1 -1
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/base.py +4 -3
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/bitn.py +1 -2
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/commands.py +1 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/cue.py +0 -8
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/descriptors.py +5 -34
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/gums.py +7 -5
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/hls.py +35 -17
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/new_reader.py +1 -1
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/section.py +2 -2
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/stream.py +45 -68
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/stuff.py +10 -6
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/version.py +1 -1
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/words.py +17 -6
- {threefive3-3.0.33 → threefive3-3.0.35/threefive3.egg-info}/PKG-INFO +62 -65
- {threefive3-3.0.33 → threefive3-3.0.35}/LICENSE +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/setup.cfg +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/__init__.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/aac.py +1 -1
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/crc.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/encode.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/hlstags.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/iframes.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/packetdata.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/segment.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/segmentation.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/sixfix.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/streamtypes.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/superkabuki.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3/upids.py +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3.egg-info/SOURCES.txt +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3.egg-info/dependency_links.txt +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/threefive3.egg-info/requires.txt +0 -0
- {threefive3-3.0.33 → threefive3-3.0.35}/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.35
|
|
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
|
|
@@ -12,34 +12,44 @@ Classifier: Operating System :: POSIX :: BSD :: OpenBSD
|
|
|
12
12
|
Classifier: Operating System :: POSIX :: BSD :: NetBSD
|
|
13
13
|
Classifier: Operating System :: POSIX :: Linux
|
|
14
14
|
Classifier: Topic :: Multimedia :: Video
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
16
16
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
17
17
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
18
18
|
Requires-Python: >=3.6
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
|
|
22
|
+
[__Install__](#install) |[__Cli__](#the-cli-tool) | [__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__](https://github.com/superkabuki/threefive3/blob/main/encode.md) | [__Examples__](https://github.com/superkabuki/threefive3/tree/main/examples)
|
|
23
|
+
<pre>
|
|
24
|
+
Myself and several others spent five years developing threefive,
|
|
25
|
+
and then I got F2A'ed out of the github account.
|
|
26
|
+
threefive3 is the next step.
|
|
27
|
+
|
|
28
|
+
Welcome to the show.
|
|
29
|
+
|
|
30
|
+
Adrian
|
|
31
|
+
|
|
32
|
+
</pre>
|
|
22
33
|
|
|
23
|
-
|
|
34
|
+
# The threefive3 SCTE-35 Cli Super Tool
|
|
35
|
+
# and python3 library.
|
|
24
36
|
|
|
37
|
+
✅ SCTE-35 __Parser__ ✅ SCTE-35 __Encoder__ ✅ SCTE-35 __HLS__ ✅ SCTE-35 __Xml+binary__ ✅ SCTE-35 __Cli__ ✅ SCTE-35 __library__
|
|
25
38
|
|
|
26
39
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
✅ SCTE-35 Parser ✅ SCTE-35 Encoder ✅ SCTE-35 HLS ✅ SCTE-35 Xml+binary ✅ SCTE-35 Cli ✅ SCTE-35 library
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* Parses SCTE-35 from MPEGTS, HLS, XML+Binary, Base64, Bytes, Hex, Integers, or JSON.
|
|
34
|
-
* Encode SCTE-35 to Base64, Bytes, Hex, Int, JSON, or Xml+binary.
|
|
40
|
+
* Parses __SCTE-35__ from MPEGTS, HLS, XML+Binary, Base64, Bytes, Hex, Integers, or JSON.
|
|
41
|
+
* Encode __SCTE-35__ to Base64, Bytes, Hex, Int, JSON, or Xml+binary.
|
|
35
42
|
* Built-in network support for HTTP(S), UDP, and Multicast.
|
|
36
43
|
* Automatic AES decryption for HLS.
|
|
37
|
-
* All HLS
|
|
44
|
+
* All HLS __SCTE-35__ Tags are Supported.
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
# Latest release is v3.0.35
|
|
47
|
+
_Released Thursday April 3rd, 2025 4am EDT_
|
|
48
|
+
> Stay up to date, only the latest release is supported.
|
|
49
|
+
|
|
50
|
+
# Checkout the Super Cool SCTE-35 [__Examples__](https://github.com/superkabuki/threefive3/tree/main/examples)
|
|
51
|
+
|
|
52
|
+
## MPEGTS streams can be parsed for SCTE-35 with three lines of code.
|
|
43
53
|
|
|
44
54
|
```py3
|
|
45
55
|
a@fu:~/build5/scte35/scte35$ pypy3
|
|
@@ -55,51 +65,13 @@ Type "help", "copyright", "credits" or "license" for more information.
|
|
|
55
65
|
```
|
|
56
66
|
|
|
57
67
|
|
|
58
|
-
# threefive3 Road Map.
|
|
59
|
-
|
|
60
|
-
> The master plan for threefive3 is to consolidate code from several of my projects.
|
|
61
|
-
|
|
62
|
-
| Project | Description | Status |
|
|
63
|
-
|-----------------|---------------------------------------|----------|
|
|
64
|
-
| threefive | scte-35 parser | Done |
|
|
65
|
-
| bitn | bitslicer for byte strings | Done |
|
|
66
|
-
| new_reader | reader for files and network data | Done |
|
|
67
|
-
| showcues | hls scte35 parser | Done |
|
|
68
|
-
| m3ufu tagparser | hls scte-35 tag parser | Done |
|
|
69
|
-
| iframes | iframe detection for mpegts | Done |
|
|
70
|
-
| dash rip rock | scte-35 xml parser and generator | Done |
|
|
71
|
-
| six2scte35 | ffmpeg bin data stream back to scte-35 | Done |
|
|
72
|
-
| superkabuki | scte-35 packet injection | Next release |
|
|
73
|
-
| sideways | hls scte-35 tag injecton | No |
|
|
74
|
-
| gums | multicast server | Done |
|
|
75
|
-
| adbreak3 | fast cli scte-35 cue creation | No |
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
# Little Help?
|
|
79
|
-
|
|
80
|
-
I could use a hand.with these <br>
|
|
81
|
-
|
|
82
|
-
* Writing docs. Explain how to use threefive3.
|
|
83
|
-
* Easy Examples. Light coding.
|
|
84
|
-
* Unit Testing. light coding with some SCTE-35.
|
|
85
|
-
* Pylint and PEP compliance. medium python knowledge.
|
|
86
|
-
* Profiling and Benchmarking. Help make threefive3 faster.
|
|
87
|
-
* Replacing setup tools. Using setup.py for packaging has been deprecated, medium python knowledge.
|
|
88
|
-
* DASH parsing. I need somebody to explain the non-SCTE-35 parts of DASH to me.
|
|
89
|
-
|
|
90
|
-
You don't have to be a master of python or SCTE-35,<BR> but helping will make you better at both.<BR>
|
|
91
|
-
__I value enthusiasm over skill, I can teach you what you don't know.__ <BR>
|
|
92
|
-
Don't worry, I won't let you break anything, that's my job.
|
|
93
|
-
|
|
94
|
-
If you want to get involved, just open an issue and we can talk about it.
|
|
95
|
-
|
|
96
68
|
|
|
97
69
|
# `Documentation`
|
|
98
70
|
|
|
99
71
|
|
|
100
72
|
* [Install](#install)
|
|
101
73
|
|
|
102
|
-
|
|
74
|
+
### Cli
|
|
103
75
|
|
|
104
76
|
* [SCTE-35 Cli Super Tool](#the-cli-tool) Encodes, Decodes, and Recodes. This is pretty cool, it does SCTE-35 seven different ways.
|
|
105
77
|
* The cli tool comes with builtin documentation just type `threefive3 help`
|
|
@@ -108,8 +80,10 @@ If you want to get involved, just open an issue and we can talk about it.
|
|
|
108
80
|
* [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?
|
|
109
81
|
|
|
110
82
|
|
|
111
|
-
|
|
83
|
+
### `Classes`
|
|
112
84
|
|
|
85
|
+
* [Class Structure](https://github.com/superkabuki/threefive3/blob/main/classes.md)
|
|
86
|
+
*
|
|
113
87
|
* The python built in help is always the most up to date docs for the library.
|
|
114
88
|
|
|
115
89
|
```rebol
|
|
@@ -125,13 +99,12 @@ Type "help", "copyright", "credits" or "license" for more information.
|
|
|
125
99
|
* [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.
|
|
126
100
|
___
|
|
127
101
|
|
|
128
|
-
|
|
102
|
+
### `| more`
|
|
129
103
|
|
|
130
104
|
* [Online SCTE-35 Parser](https://iodisco.com/scte35) Supporte Base64, Bytes,Hex,Int, Json, Xml, and Xml+binary.
|
|
131
105
|
|
|
132
106
|
* [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) Some encoding code examples.
|
|
133
107
|
|
|
134
|
-
* [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35) FFmpeg with the SuperKabui SCTE-35 Patch applied.
|
|
135
108
|
|
|
136
109
|
___
|
|
137
110
|
|
|
@@ -152,10 +125,8 @@ make install
|
|
|
152
125
|
```
|
|
153
126
|
___
|
|
154
127
|
|
|
155
|
-
|
|
156
128
|
### `The Cli tool`
|
|
157
129
|
|
|
158
|
-
|
|
159
130
|
#### The cli tool installs automatically with pip or the Makefile.
|
|
160
131
|
|
|
161
132
|
* [__SCTE-35 Inputs__](#inputs)
|
|
@@ -300,14 +271,40 @@ ___
|
|
|
300
271
|
___
|
|
301
272
|
|
|
302
273
|
|
|
274
|
+
### Stream Multicast with the threefive cli, it's easy.
|
|
275
|
+
|
|
276
|
+
* The threefive3 cli has long been a Multicast Receiver( client )
|
|
277
|
+
* The cli now comes with a builtin Multicast Sender( server).
|
|
278
|
+
* It's optimized for MPEGTS (1316 Datagrams) but you can send any video or file.
|
|
279
|
+
* The defaults will work in most situations, you don't even have to set the address.
|
|
280
|
+
* threefive3 cli also supports UDP Unicast Streaming.
|
|
281
|
+
|
|
282
|
+

|
|
283
|
+
|
|
284
|
+
```js
|
|
285
|
+
a@fu:~$ threefive3 mcast help
|
|
286
|
+
usage: threefive3 mcast [-h] [-i INPUT] [-a ADDR] [-b BIND_ADDR] [-t TTL]
|
|
287
|
+
|
|
288
|
+
optional arguments:
|
|
289
|
+
-h, --help show this help message and exit
|
|
290
|
+
-i INPUT, --input INPUT
|
|
291
|
+
like "/home/a/vid.ts" or "udp://@235.35.3.5:3535" or
|
|
292
|
+
"https://futzu.com/xaa.ts"
|
|
293
|
+
[default:sys.stdin.buffer]
|
|
294
|
+
-a ADDR, --addr ADDR Destination IP:Port [default:235.35.3.5:3535]
|
|
295
|
+
-b BIND_ADDR, --bind_addr BIND_ADDR
|
|
296
|
+
Local IP to bind [default:0.0.0.0]
|
|
297
|
+
-t TTL, --ttl TTL Multicast TTL (1 - 255) [default:32]
|
|
298
|
+
a@fu:~$
|
|
299
|
+
```
|
|
303
300
|
|
|
304
|
-
### [iodisco.com/scte35](https://iodisco.com/scte35)
|
|
305
|
-

|
|
306
301
|
|
|
307
302
|
|
|
308
303
|
|
|
309
|
-
|
|
304
|
+
### [iodisco.com/scte35](https://iodisco.com/scte35)
|
|
305
|
+

|
|
310
306
|
|
|
311
|
-
[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)
|
|
312
307
|
|
|
313
|
-
|
|
308
|
+
___
|
|
309
|
+
|
|
310
|
+
[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)
|
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
[__Install__](#install) |[__Cli__](#the-cli-tool) | [__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__](https://github.com/superkabuki/threefive3/blob/main/encode.md) | [__Examples__](https://github.com/superkabuki/threefive3/tree/main/examples)
|
|
2
|
+
<pre>
|
|
3
|
+
Myself and several others spent five years developing threefive,
|
|
4
|
+
and then I got F2A'ed out of the github account.
|
|
5
|
+
threefive3 is the next step.
|
|
6
|
+
|
|
7
|
+
Welcome to the show.
|
|
8
|
+
|
|
9
|
+
Adrian
|
|
10
|
+
|
|
11
|
+
</pre>
|
|
12
|
+
|
|
13
|
+
# The threefive3 SCTE-35 Cli Super Tool
|
|
14
|
+
# and python3 library.
|
|
15
|
+
|
|
16
|
+
✅ SCTE-35 __Parser__ ✅ SCTE-35 __Encoder__ ✅ SCTE-35 __HLS__ ✅ SCTE-35 __Xml+binary__ ✅ SCTE-35 __Cli__ ✅ SCTE-35 __library__
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
* Parses __SCTE-35__ from MPEGTS, HLS, XML+Binary, Base64, Bytes, Hex, Integers, or JSON.
|
|
20
|
+
* Encode __SCTE-35__ to Base64, Bytes, Hex, Int, JSON, or Xml+binary.
|
|
14
21
|
* Built-in network support for HTTP(S), UDP, and Multicast.
|
|
15
22
|
* Automatic AES decryption for HLS.
|
|
16
|
-
* All HLS
|
|
23
|
+
* All HLS __SCTE-35__ Tags are Supported.
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
# Latest release is v3.0.35
|
|
26
|
+
_Released Thursday April 3rd, 2025 4am EDT_
|
|
27
|
+
> Stay up to date, only the latest release is supported.
|
|
28
|
+
|
|
29
|
+
# Checkout the Super Cool SCTE-35 [__Examples__](https://github.com/superkabuki/threefive3/tree/main/examples)
|
|
30
|
+
|
|
31
|
+
## MPEGTS streams can be parsed for SCTE-35 with three lines of code.
|
|
22
32
|
|
|
23
33
|
```py3
|
|
24
34
|
a@fu:~/build5/scte35/scte35$ pypy3
|
|
@@ -34,51 +44,13 @@ Type "help", "copyright", "credits" or "license" for more information.
|
|
|
34
44
|
```
|
|
35
45
|
|
|
36
46
|
|
|
37
|
-
# threefive3 Road Map.
|
|
38
|
-
|
|
39
|
-
> The master plan for threefive3 is to consolidate code from several of my projects.
|
|
40
|
-
|
|
41
|
-
| Project | Description | Status |
|
|
42
|
-
|-----------------|---------------------------------------|----------|
|
|
43
|
-
| threefive | scte-35 parser | Done |
|
|
44
|
-
| bitn | bitslicer for byte strings | Done |
|
|
45
|
-
| new_reader | reader for files and network data | Done |
|
|
46
|
-
| showcues | hls scte35 parser | Done |
|
|
47
|
-
| m3ufu tagparser | hls scte-35 tag parser | Done |
|
|
48
|
-
| iframes | iframe detection for mpegts | Done |
|
|
49
|
-
| dash rip rock | scte-35 xml parser and generator | Done |
|
|
50
|
-
| six2scte35 | ffmpeg bin data stream back to scte-35 | Done |
|
|
51
|
-
| superkabuki | scte-35 packet injection | Next release |
|
|
52
|
-
| sideways | hls scte-35 tag injecton | No |
|
|
53
|
-
| gums | multicast server | Done |
|
|
54
|
-
| adbreak3 | fast cli scte-35 cue creation | No |
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
# Little Help?
|
|
58
|
-
|
|
59
|
-
I could use a hand.with these <br>
|
|
60
|
-
|
|
61
|
-
* Writing docs. Explain how to use threefive3.
|
|
62
|
-
* Easy Examples. Light coding.
|
|
63
|
-
* Unit Testing. light coding with some SCTE-35.
|
|
64
|
-
* Pylint and PEP compliance. medium python knowledge.
|
|
65
|
-
* Profiling and Benchmarking. Help make threefive3 faster.
|
|
66
|
-
* Replacing setup tools. Using setup.py for packaging has been deprecated, medium python knowledge.
|
|
67
|
-
* DASH parsing. I need somebody to explain the non-SCTE-35 parts of DASH to me.
|
|
68
|
-
|
|
69
|
-
You don't have to be a master of python or SCTE-35,<BR> but helping will make you better at both.<BR>
|
|
70
|
-
__I value enthusiasm over skill, I can teach you what you don't know.__ <BR>
|
|
71
|
-
Don't worry, I won't let you break anything, that's my job.
|
|
72
|
-
|
|
73
|
-
If you want to get involved, just open an issue and we can talk about it.
|
|
74
|
-
|
|
75
47
|
|
|
76
48
|
# `Documentation`
|
|
77
49
|
|
|
78
50
|
|
|
79
51
|
* [Install](#install)
|
|
80
52
|
|
|
81
|
-
|
|
53
|
+
### Cli
|
|
82
54
|
|
|
83
55
|
* [SCTE-35 Cli Super Tool](#the-cli-tool) Encodes, Decodes, and Recodes. This is pretty cool, it does SCTE-35 seven different ways.
|
|
84
56
|
* The cli tool comes with builtin documentation just type `threefive3 help`
|
|
@@ -87,8 +59,10 @@ If you want to get involved, just open an issue and we can talk about it.
|
|
|
87
59
|
* [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?
|
|
88
60
|
|
|
89
61
|
|
|
90
|
-
|
|
62
|
+
### `Classes`
|
|
91
63
|
|
|
64
|
+
* [Class Structure](https://github.com/superkabuki/threefive3/blob/main/classes.md)
|
|
65
|
+
*
|
|
92
66
|
* The python built in help is always the most up to date docs for the library.
|
|
93
67
|
|
|
94
68
|
```rebol
|
|
@@ -104,13 +78,12 @@ Type "help", "copyright", "credits" or "license" for more information.
|
|
|
104
78
|
* [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.
|
|
105
79
|
___
|
|
106
80
|
|
|
107
|
-
|
|
81
|
+
### `| more`
|
|
108
82
|
|
|
109
83
|
* [Online SCTE-35 Parser](https://iodisco.com/scte35) Supporte Base64, Bytes,Hex,Int, Json, Xml, and Xml+binary.
|
|
110
84
|
|
|
111
85
|
* [Encode SCTE-35](https://github.com/superkabuki/threefive3/blob/main/encode.md) Some encoding code examples.
|
|
112
86
|
|
|
113
|
-
* [FFmpeg SCTE35](https://github.com/superkabuki/FFmpeg_SCTE35) FFmpeg with the SuperKabui SCTE-35 Patch applied.
|
|
114
87
|
|
|
115
88
|
___
|
|
116
89
|
|
|
@@ -131,10 +104,8 @@ make install
|
|
|
131
104
|
```
|
|
132
105
|
___
|
|
133
106
|
|
|
134
|
-
|
|
135
107
|
### `The Cli tool`
|
|
136
108
|
|
|
137
|
-
|
|
138
109
|
#### The cli tool installs automatically with pip or the Makefile.
|
|
139
110
|
|
|
140
111
|
* [__SCTE-35 Inputs__](#inputs)
|
|
@@ -279,14 +250,40 @@ ___
|
|
|
279
250
|
___
|
|
280
251
|
|
|
281
252
|
|
|
253
|
+
### Stream Multicast with the threefive cli, it's easy.
|
|
254
|
+
|
|
255
|
+
* The threefive3 cli has long been a Multicast Receiver( client )
|
|
256
|
+
* The cli now comes with a builtin Multicast Sender( server).
|
|
257
|
+
* It's optimized for MPEGTS (1316 Datagrams) but you can send any video or file.
|
|
258
|
+
* The defaults will work in most situations, you don't even have to set the address.
|
|
259
|
+
* threefive3 cli also supports UDP Unicast Streaming.
|
|
260
|
+
|
|
261
|
+

|
|
262
|
+
|
|
263
|
+
```js
|
|
264
|
+
a@fu:~$ threefive3 mcast help
|
|
265
|
+
usage: threefive3 mcast [-h] [-i INPUT] [-a ADDR] [-b BIND_ADDR] [-t TTL]
|
|
266
|
+
|
|
267
|
+
optional arguments:
|
|
268
|
+
-h, --help show this help message and exit
|
|
269
|
+
-i INPUT, --input INPUT
|
|
270
|
+
like "/home/a/vid.ts" or "udp://@235.35.3.5:3535" or
|
|
271
|
+
"https://futzu.com/xaa.ts"
|
|
272
|
+
[default:sys.stdin.buffer]
|
|
273
|
+
-a ADDR, --addr ADDR Destination IP:Port [default:235.35.3.5:3535]
|
|
274
|
+
-b BIND_ADDR, --bind_addr BIND_ADDR
|
|
275
|
+
Local IP to bind [default:0.0.0.0]
|
|
276
|
+
-t TTL, --ttl TTL Multicast TTL (1 - 255) [default:32]
|
|
277
|
+
a@fu:~$
|
|
278
|
+
```
|
|
282
279
|
|
|
283
|
-
### [iodisco.com/scte35](https://iodisco.com/scte35)
|
|
284
|
-

|
|
285
280
|
|
|
286
281
|
|
|
287
282
|
|
|
288
|
-
|
|
283
|
+
### [iodisco.com/scte35](https://iodisco.com/scte35)
|
|
284
|
+

|
|
285
|
+
|
|
289
286
|
|
|
290
|
-
|
|
287
|
+
___
|
|
291
288
|
|
|
292
|
-
|
|
289
|
+
[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)
|
|
@@ -15,7 +15,8 @@ from threefive3.new_reader import reader
|
|
|
15
15
|
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
|
+
|
|
19
|
+
# import cProfile
|
|
19
20
|
# from sideways import cli as sidecli
|
|
20
21
|
|
|
21
22
|
REV = "\033[7;1m"
|
|
@@ -32,12 +33,13 @@ class SupaStream(Stream):
|
|
|
32
33
|
SupaStream is subclass of Stream used
|
|
33
34
|
to print raw SCTE-35 packets.
|
|
34
35
|
"""
|
|
36
|
+
|
|
35
37
|
def _parse_scte35(self, pkt, pid):
|
|
36
38
|
print2(pkt)
|
|
37
39
|
print2("")
|
|
38
40
|
super()._parse_scte35(pkt, pid)
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
|
|
41
43
|
def mk_sidecar(cue):
|
|
42
44
|
"""
|
|
43
45
|
mk_sidecar generates a sidecar file with the SCTE-35 Cues
|
|
@@ -74,8 +76,12 @@ HELP = f"""
|
|
|
74
76
|
|
|
75
77
|
threefive3 hls https://example.com/master.m3u8{U}
|
|
76
78
|
|
|
77
|
-
{B} iframes {U}{BLUE}
|
|
79
|
+
{B} iframes {U}{BLUE} Show MPEGTS iframes{NORM} threefive3 iframes video.ts
|
|
80
|
+
|
|
81
|
+
{B} mcast {U}{NORM}{BLUE} Multicast sender(server) help: {U} threefive3 mcast help
|
|
78
82
|
|
|
83
|
+
threefive3 mcast video.ts
|
|
84
|
+
|
|
79
85
|
{B} packets {U}{NORM}{BLUE} Print raw SCTE-35 packets:{NORM} threefive3 packets udp://@235.35.3.5:3535
|
|
80
86
|
|
|
81
87
|
{B} proxy {U}{NORM}{BLUE} Parse a stream and copy it to stdout:{NORM} threefive3 proxy video.ts
|
|
@@ -311,12 +317,9 @@ def to_funk(this):
|
|
|
311
317
|
strm.decode(func=funk()) # funk() works here
|
|
312
318
|
except: # try to load json or xml
|
|
313
319
|
cue = Cue()
|
|
314
|
-
## try:
|
|
320
|
+
## try:
|
|
315
321
|
cue.bites = cue._mk_bits(this)
|
|
316
322
|
cue.decode()
|
|
317
|
-
## except:
|
|
318
|
-
## print2("Bad Data:\n")
|
|
319
|
-
## sys.exit()
|
|
320
323
|
if cue:
|
|
321
324
|
funk()(cue) # func works here too.
|
|
322
325
|
|
|
@@ -337,7 +340,7 @@ def chk_stdin(args):
|
|
|
337
340
|
strm = Stream(sys.stdin.buffer)
|
|
338
341
|
strm._parse(one + two) # dont drop first packet
|
|
339
342
|
strm.decode(func=funk())
|
|
340
|
-
sys.exit()
|
|
343
|
+
sys.exit() # I keep forgetting why I do
|
|
341
344
|
return args
|
|
342
345
|
|
|
343
346
|
|
|
@@ -352,6 +355,7 @@ def chk_funk_map():
|
|
|
352
355
|
_ = [to_funk(arg) for arg in args] # multiple file input
|
|
353
356
|
sys.exit()
|
|
354
357
|
|
|
358
|
+
|
|
355
359
|
# cli map
|
|
356
360
|
|
|
357
361
|
cli_map = {"mcast": gumscli, "superkabuki": skcli}
|
|
@@ -362,12 +366,12 @@ def dashdashhelp():
|
|
|
362
366
|
dashdashhelp swaps out "help" with "--help"
|
|
363
367
|
for keys in cli_map. Pure bureaucracy.
|
|
364
368
|
I still can't believe I can just edit sys.argv at will,
|
|
365
|
-
it kind of makes sense, since I wrote
|
|
369
|
+
it kind of makes sense, since I wrote sys.argv in the first place,
|
|
366
370
|
but it just feels so wrong.
|
|
367
371
|
"""
|
|
368
372
|
if "help" in sys.argv:
|
|
369
373
|
idx = sys.argv.index("help")
|
|
370
|
-
sys.argv[idx]= "--help"
|
|
374
|
+
sys.argv[idx] = "--help"
|
|
371
375
|
|
|
372
376
|
|
|
373
377
|
def chk_cli_map():
|
|
@@ -397,14 +401,3 @@ def go():
|
|
|
397
401
|
if __name__ == "__main__":
|
|
398
402
|
go()
|
|
399
403
|
|
|
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()
|
|
@@ -31,7 +31,7 @@ setuptools.setup(
|
|
|
31
31
|
"Operating System :: POSIX :: BSD :: NetBSD",
|
|
32
32
|
"Operating System :: POSIX :: Linux",
|
|
33
33
|
"Topic :: Multimedia :: Video",
|
|
34
|
-
"Programming Language :: Python :: 3.
|
|
34
|
+
"Programming Language :: Python :: 3.7",
|
|
35
35
|
"Programming Language :: Python :: Implementation :: PyPy",
|
|
36
36
|
"Programming Language :: Python :: Implementation :: CPython",
|
|
37
37
|
],
|
|
@@ -110,14 +110,15 @@ class SCTE35Base:
|
|
|
110
110
|
def idxsplit(gonzo, sep):
|
|
111
111
|
"""
|
|
112
112
|
idxsplit is like split but you keep
|
|
113
|
-
the sep
|
|
113
|
+
the sep.
|
|
114
|
+
|
|
114
115
|
example:
|
|
115
116
|
>>> idxsplit('123456789',4)
|
|
116
117
|
>>>'456789'
|
|
117
118
|
"""
|
|
118
119
|
if sep in gonzo:
|
|
119
120
|
return gonzo[gonzo.index(sep) :]
|
|
120
|
-
return
|
|
121
|
+
return gonzo
|
|
121
122
|
|
|
122
123
|
def json(self):
|
|
123
124
|
"""
|
|
@@ -132,7 +133,7 @@ class SCTE35Base:
|
|
|
132
133
|
"""
|
|
133
134
|
|
|
134
135
|
def b2l(val):
|
|
135
|
-
if isinstance(val,
|
|
136
|
+
if isinstance(val, SCTE35Base):
|
|
136
137
|
val.kv_clean()
|
|
137
138
|
if isinstance(val, (list)):
|
|
138
139
|
val = [b2l(v) for v in val]
|
|
@@ -17,7 +17,6 @@ class Bitn:
|
|
|
17
17
|
self.bitsize = self.idx = len(bites) << 3
|
|
18
18
|
self.bits = int.from_bytes(bites, byteorder="big")
|
|
19
19
|
|
|
20
|
-
|
|
21
20
|
def __repr__(self):
|
|
22
21
|
return str(vars(self))
|
|
23
22
|
|
|
@@ -160,7 +159,7 @@ class NBin:
|
|
|
160
159
|
else:
|
|
161
160
|
dehexed = hex_str
|
|
162
161
|
self.add_int(dehexed, bit_len)
|
|
163
|
-
|
|
162
|
+
|
|
164
163
|
def add_flag(self, flg, bit_len=1):
|
|
165
164
|
"""
|
|
166
165
|
add_flag takes a boolean
|
|
@@ -92,11 +92,6 @@ class Cue(SCTE35Base):
|
|
|
92
92
|
del spliced.bites
|
|
93
93
|
self.descriptors.append(spliced)
|
|
94
94
|
|
|
95
|
-
def _get_dash_data(self, scte35_dict):
|
|
96
|
-
if self.dash_data:
|
|
97
|
-
scte35_dict["dash_data"] = self.dash_data
|
|
98
|
-
return scte35_dict
|
|
99
|
-
|
|
100
95
|
def _get_packet_data(self, scte35_dict):
|
|
101
96
|
if self.packet_data:
|
|
102
97
|
scte35_dict["packet_data"] = self.packet_data.get()
|
|
@@ -113,9 +108,7 @@ class Cue(SCTE35Base):
|
|
|
113
108
|
"command": self.command.get(),
|
|
114
109
|
"descriptors": self.get_descriptors(),
|
|
115
110
|
}
|
|
116
|
-
scte35_data = self._get_dash_data(scte35_data)
|
|
117
111
|
scte35_data = self._get_packet_data(scte35_data)
|
|
118
|
-
|
|
119
112
|
return scte35_data
|
|
120
113
|
return False
|
|
121
114
|
|
|
@@ -397,7 +390,6 @@ class Cue(SCTE35Base):
|
|
|
397
390
|
|
|
398
391
|
* load doesn't need to be called directly
|
|
399
392
|
unless you initialize a Cue without data.
|
|
400
|
-
|
|
401
393
|
"""
|
|
402
394
|
if isinstance(gonzo, bytes):
|
|
403
395
|
gonzo = gonzo.decode()
|
|
@@ -6,7 +6,7 @@ from .bitn import Bitn
|
|
|
6
6
|
from .base import SCTE35Base
|
|
7
7
|
from .segmentation import table20, table22, dvb_table2
|
|
8
8
|
from .upids import upid_map
|
|
9
|
-
from .stuff import red,blue
|
|
9
|
+
from .stuff import red, blue
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def k_by_v(adict, avalue):
|
|
@@ -313,26 +313,13 @@ class SegmentationDescriptor(SpliceDescriptor):
|
|
|
313
313
|
self.segmentation_message = table22[self.segmentation_type_id]
|
|
314
314
|
self._decode_segments(bitbin)
|
|
315
315
|
|
|
316
|
-
def _chk_sub_segments(self):
|
|
317
|
-
"""
|
|
318
|
-
chk_sub_segments sets sub_segment vars if not present
|
|
319
|
-
"""
|
|
320
|
-
if self.segmentation_type_id in self.SUB_SEG_TYPES:
|
|
321
|
-
if not self.sub_segment_num:
|
|
322
|
-
self.sub_segment_num = 0
|
|
323
|
-
self.sub_segments_expected = 0
|
|
324
|
-
|
|
325
316
|
def _decode_segments(self, bitbin):
|
|
326
317
|
self.segment_num = bitbin.as_int(8)
|
|
327
318
|
self.segments_expected = bitbin.as_int(8)
|
|
328
319
|
if self.segmentation_type_id in self.SUB_SEG_TYPES:
|
|
329
|
-
#
|
|
330
|
-
# are not available set both of them to zero
|
|
331
|
-
try:
|
|
320
|
+
if bitbin.idx > 15: # need 16 bits
|
|
332
321
|
self.sub_segment_num = bitbin.as_int(8)
|
|
333
322
|
self.sub_segments_expected = bitbin.as_int(8)
|
|
334
|
-
finally:
|
|
335
|
-
self._chk_sub_segments()
|
|
336
323
|
|
|
337
324
|
def encode(self, nbin=None):
|
|
338
325
|
"""
|
|
@@ -347,7 +334,6 @@ class SegmentationDescriptor(SpliceDescriptor):
|
|
|
347
334
|
nbin.forward(6)
|
|
348
335
|
if not self.segmentation_event_cancel_indicator:
|
|
349
336
|
self._encode_flags(nbin)
|
|
350
|
-
|
|
351
337
|
self._encode_segmentation(nbin)
|
|
352
338
|
return nbin.bites
|
|
353
339
|
|
|
@@ -398,26 +384,11 @@ class SegmentationDescriptor(SpliceDescriptor):
|
|
|
398
384
|
def _encode_segments(self, nbin):
|
|
399
385
|
self._chk_var(int, nbin.add_int, "segment_num", 8)
|
|
400
386
|
self._chk_var(int, nbin.add_int, "segments_expected", 8)
|
|
401
|
-
if self.segmentation_type_id in
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
0x34,
|
|
405
|
-
0x36,
|
|
406
|
-
0x38,
|
|
407
|
-
0x3A,
|
|
408
|
-
0x44,
|
|
409
|
-
0x46,
|
|
410
|
-
]:
|
|
411
|
-
try:
|
|
387
|
+
if self.segmentation_type_id in self.SUB_SEG_TYPES:
|
|
388
|
+
if self.sub_segment_num and self.sub_segments_expected:
|
|
389
|
+
# Both are required, encode if they exist.
|
|
412
390
|
self._chk_var(int, nbin.add_int, "sub_segment_num", 8)
|
|
413
391
|
self._chk_var(int, nbin.add_int, "sub_segments_expected", 8)
|
|
414
|
-
except:
|
|
415
|
-
blue(
|
|
416
|
-
"Adding sub_segment_num and sub_segments_expected. setting to 0, 0"
|
|
417
|
-
)
|
|
418
|
-
nbin.add_int(0, 8)
|
|
419
|
-
nbin.add_int(0, 8)
|
|
420
|
-
|
|
421
392
|
|
|
422
393
|
|
|
423
394
|
# map of known descriptors and associated classes
|