threefive3 3.0.9__tar.gz → 3.0.13__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 (34) hide show
  1. {threefive3-3.0.9/threefive3.egg-info → threefive3-3.0.13}/PKG-INFO +60 -74
  2. {threefive3-3.0.9 → threefive3-3.0.13}/README.md +59 -73
  3. {threefive3-3.0.9 → threefive3-3.0.13}/bin/threefive3 +1 -1
  4. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/bitn.py +3 -0
  5. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/cue.py +4 -3
  6. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/hls.py +9 -7
  7. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/iframes.py +1 -1
  8. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/segment.py +5 -3
  9. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/sixfix.py +3 -3
  10. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/stream.py +33 -47
  11. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/version.py +1 -1
  12. {threefive3-3.0.9 → threefive3-3.0.13/threefive3.egg-info}/PKG-INFO +60 -74
  13. {threefive3-3.0.9 → threefive3-3.0.13}/LICENSE +0 -0
  14. {threefive3-3.0.9 → threefive3-3.0.13}/setup.cfg +0 -0
  15. {threefive3-3.0.9 → threefive3-3.0.13}/setup.py +0 -0
  16. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/__init__.py +0 -0
  17. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/base.py +0 -0
  18. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/commands.py +0 -0
  19. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/crc.py +0 -0
  20. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/descriptors.py +0 -0
  21. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/new_reader.py +0 -0
  22. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/packetdata.py +0 -0
  23. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/section.py +0 -0
  24. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/segmentation.py +0 -0
  25. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/spare.py +0 -0
  26. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/streamtypes.py +0 -0
  27. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/sxp.py +0 -0
  28. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/upids.py +0 -0
  29. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/x2c.py +0 -0
  30. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3/xml.py +0 -0
  31. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3.egg-info/SOURCES.txt +0 -0
  32. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3.egg-info/dependency_links.txt +0 -0
  33. {threefive3-3.0.9 → threefive3-3.0.13}/threefive3.egg-info/requires.txt +0 -0
  34. {threefive3-3.0.9 → threefive3-3.0.13}/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.9
3
+ Version: 3.0.13
4
4
  Summary: threefive continued.
5
5
  Home-page: https://github.com/superkabuki/scte35
6
6
  Author: Adrian of Doom
@@ -22,71 +22,52 @@ Requires-Dist: m3ufu>=0.0.89
22
22
  Requires-Dist: sideways>=0.0.23
23
23
  Requires-Dist: pyaes
24
24
 
25
- ![image](https://github.com/user-attachments/assets/adae03a1-9f85-403e-9dce-d134e0996903)
25
+ [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)
26
26
 
27
- # Latest version is v3.0.9
28
27
 
29
- # Why threefive3, why not just threefive?
28
+ # threefive3
29
+ SCTE-35 Parser ✅
30
+ SCTE-35 Encoder ✅
31
+ SCTE-35 HLS ✅
32
+ SCTE-35 Xml ✅
33
+ SCTE-35 Cli ✅
34
+ SCTE-35 library ✅
35
+ <br>
36
+ <br>
37
+ # What people are saying about threefive3:
30
38
 
31
- * __Answer #1__
32
- * <s>Github F2A'ed out of my account, and I have no idea where I put the recovery codes. I have more than one Internet account, where I am supposed to keep all this data? Should I store in some company's cloud so they can read it or give it away to Eastern European script kiddies? F2A is complete nonsense. It doesn't matter how secure it is, if a security measure prevents me from accessing my account, that's not secure, that's locked out.</s>
39
+ <br>
33
40
 
34
- * __Answer #2__
35
- * <s> Two repos with the same name, would be confusing. </s>
36
-
37
- * __Answer #3__
38
- * <s>I wanted to rethink everything. After going through the code, I kept about 75% of it. I completely rewrote the Xml parser,I did a lot of work with the Cue class, HLS, and really tuned up the cli. The cli is amazing and super easy to use.</s>
39
-
40
- * __Answer #4__
41
- * <s>I came up with a really cool name, but it wasn't available on pypi.org for a package name.</s>
42
-
43
- * __Answer #5__
44
- * <s>Really, I was just getting a little bored with the whole thing, I just wanted to shake things up a little, keep it fun.</s>
41
+ _I was satisfied with everything, only a linear entrance of.... there was a bomb with him._ ~ __Suzy in Swanee__
42
+ <br>
43
+ ___
44
+ _A little bigger than i thought, but lighter._ ~ __Bob in Buford__
45
+ <br>
46
+ ___
47
+ _Class! I choked very much, took it for the dacha, as an easily transported option, the sound was just hurt! And generally listen to music. Perfectly pumps speakers from ancient muses. Center Sony! Without distortion, background noise, detailed sound. In short, who does not need highend much, so I recommend it!_
48
+ ~ __Larry in Lawrenceville__
49
+ <br>
50
+ ___
51
+ _It's good, it's good. It's good. It's good. It's good. It's good. It's good. It's good. It's good. It's good_
52
+ ~ __Connie in Columbia__
53
+ <br>
54
+ ___
45
55
 
46
- * __Answer #6__
47
- * <s>Have you seen chewy Tic Tacs? They're just mini jelly beans.</s>
56
+ # FAQ
57
+ * Q. What is the latest version?
48
58
 
49
- * __Answer #7__
50
- * <s>I'll tell you the truth, everything is a lie.</s>
59
+ * A. `v3.0.13`
60
+ ---
61
+ * Q. How do I upgrade my code from threefive to the __more powerful super advanced threefive3?__
51
62
 
52
- * __Answer #8__
53
- * Obama is a lizard. I'm not sure about his wife.
54
-
55
- # How do I upgrade my code to threefive3?
56
- > Despite making a lot of changes, the api remains. threefive3 is pretty much a drop in replacement for threefive. I used sed to upgrade my code.
63
+ * A. `sed.`
57
64
  ```js
58
65
  sed -i 's/threefive/threefive3/g'
59
66
  ```
60
- > One thing to note, calling load or decode is no longer necessary for the Cue class, however, the methods are there in case you do call them.
61
- >
62
- >
63
- # Is threefive3 faster than threefive?
64
- ### `threefive` vs. `threefive3` vs. `threefive3 next release`
65
- #
66
- ![image](https://github.com/user-attachments/assets/c3b8f741-01f4-40c1-b980-5c9df40c288c)
67
-
68
-
69
-
70
-
71
- * _testing was done on a beatup chrome book reporting 5GB of RAM running Debian Sid and PyPy 7.3.11_
72
-
73
67
  ---
68
+ * Q. Does threefive3 have super cool new features?
74
69
 
75
- # Now with Super Advanced Error Detection and Stuff.
76
- * This is super cool.
77
- * Does not generate Fatal errors, it won't break your process.
78
- * Displays what is in error and how to correct it.
79
- * Works in the cli
80
- * Works in code.
81
- ![image](https://github.com/user-attachments/assets/50331e73-cd0a-46d6-b265-1b212d625737)
82
-
83
-
84
- # Issues and Bugs.
85
- * If you think you have a bug, I'll quickly fix it, but first I need you to prove it to me. __Show me the entire error message, the code you're running, and if the SCTE-35 is in video, the video stream. You think your stream has proprietary data, we call those UPIDS. I am not going to spend my time trying to guess what your issue might be because you don't trust me.
86
- ---
87
- # Special Requests.
88
- * If need some work done, this is what I do for a living, you can hire me.
89
- * If you want to discuss your project open an issue and I'll send you my contact info.
70
+ * A. `Yes.`
90
71
  ---
91
72
 
92
73
  # `Install`
@@ -107,11 +88,10 @@ make install
107
88
  ___
108
89
 
109
90
  # `The Cli tool`
110
- > The cli audetects data being available on stdin and that allows it to autodetect the SCTE-35 format as well as MPEGTS steams. Now every SCTE-35 data format, except hls, is autodetected on the commandline, as well as stdin.HLS requires the `hls` ketyword.
91
+ > The cli polls stdin and that allows it to autodetect the SCTE-35 format as well as MPEGTS steams. Now every SCTE-35 data format, except hls, is autodetected on the commandline, as well as stdin.<br>HLS requires the `hls` ketyword.
111
92
 
112
93
  ### The cli tool installs automatically with pip or the Makefile.
113
94
 
114
-
115
95
  * [__SCTE-35 Inputs__](#inputs)
116
96
  * [__SCTE-35 Outputs__](#outputs)
117
97
  * [Parse __MPEGTS__ streams for __SCTE-35__](#streams)
@@ -120,7 +100,6 @@ ___
120
100
  * [Display raw __SCTE-35 packets__ from __video streams__](#packets)
121
101
  * [__Repair SCTE-35 streams__ changed to __bin data__ by __ffmpeg__](#sixfix)
122
102
 
123
-
124
103
  # `Inputs`
125
104
 
126
105
  * Most __inputs__ are __auto-detected.__
@@ -135,9 +114,9 @@ ___
135
114
  | __HLS__ |`threefive3 hls https://example.com/master.m3u8` |
136
115
  | __JSON__ |`threefive3 < json.json` |
137
116
  | __Xml__ | `threefive3 < xml.xml` |
138
- | __Xmlbin__ | `threefive3 < xmlbin.xml` |
117
+ | __Xmlbin__ | `js threefive3 < xmlbin.xml` |
139
118
 
140
- # Streams
119
+ # `Streams`
141
120
 
142
121
  |Protocol | Cli Example |
143
122
  |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -169,56 +148,64 @@ ___
169
148
 
170
149
  ### `hls`
171
150
  * parse hls manifests and segments for SCTE-35
172
- ```rebol
151
+ ```smalltalk
173
152
  threefive3 hls https://example.com/master.m3u8
174
153
  ```
175
154
  ___
176
155
  ### `Iframes`
177
156
  * Show iframes PTS in an MPEGTS video
178
- ```rebol
157
+
158
+ ```smalltalk
179
159
  threefive3 iframes https://example.com/video.ts
180
160
  ```
181
161
  ___
182
162
  ### `packets`
183
163
  * Print raw SCTE-35 packets from multicast mpegts video
184
- ```rebol
164
+
165
+ ```smalltalk
185
166
  threefive3 packets udp://@235.35.3.5:3535
186
167
  ```
187
168
  ___
188
169
  ### `proxy`
189
170
  * Parse a https stream and write raw video to stdout
190
- ```rebol
171
+
172
+ ```smalltalk
191
173
  threefive3 proxy video.ts
192
174
  ```
193
175
  ___
194
176
  ### `pts`
195
177
  * Print PTS from mpegts video
196
- ```rebol
197
- threefive3 pts video.ts
178
+
179
+ ```smalltalk
180
+ threefive3 pts video.ts
198
181
  ```
199
182
  ___
200
183
  ### `sidecar`
201
184
  * Parse a stream, write pts,write SCTE-35 Cues to sidecar.txt
202
- ```rebol
203
- threefive3 sidecar video.ts
185
+
186
+ ```smalltalk
187
+ threefive3 sidecar video.ts
204
188
  ```
205
189
  ___
206
190
  ### `sixfix`
207
191
  * Fix SCTE-35 data mangled by ffmpeg
208
- ```rebol
209
- threefive3 sixfix video.ts
192
+
193
+ ```smalltalk
194
+ threefive3 sixfix video.ts
210
195
  ```
211
196
  ___
212
197
  ### `show`
213
198
 
214
199
  * Probe mpegts video _( kind of like ffprobe )_
215
- ```rebol
200
+
201
+ ```smalltalk
216
202
  threefive3 show video.ts
217
203
  ```
218
204
  ___
219
205
  ### `version`
220
206
  * Show version
221
- ```rebol
207
+
208
+ ```smalltalk
222
209
  threefive3 version
223
210
  ```
224
211
  ___
@@ -228,7 +215,6 @@ ___
228
215
  threefive3 help
229
216
  ```
230
217
  ## [iodisco.com/scte35](https://iodisco.com/scte35)
231
- [![image](https://github.com/user-attachments/assets/28d228c5-56e2-41d3-a053-eebd3af958f1)
232
- ![image](https://github.com/user-attachments/assets/07c52c21-e83e-438d-91b0-6f502f0d1d43)](https://iodisco.com/scte35)
233
- ___
218
+ ![image](https://github.com/user-attachments/assets/4df85c44-a078-4da0-97e2-5daefcf2509d)
219
+
234
220
 
@@ -1,68 +1,49 @@
1
- ![image](https://github.com/user-attachments/assets/adae03a1-9f85-403e-9dce-d134e0996903)
1
+ [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)
2
2
 
3
- # Latest version is v3.0.9
4
3
 
5
- # Why threefive3, why not just threefive?
4
+ # threefive3
5
+ SCTE-35 Parser ✅
6
+ SCTE-35 Encoder ✅
7
+ SCTE-35 HLS ✅
8
+ SCTE-35 Xml ✅
9
+ SCTE-35 Cli ✅
10
+ SCTE-35 library ✅
11
+ <br>
12
+ <br>
13
+ # What people are saying about threefive3:
6
14
 
7
- * __Answer #1__
8
- * <s>Github F2A'ed out of my account, and I have no idea where I put the recovery codes. I have more than one Internet account, where I am supposed to keep all this data? Should I store in some company's cloud so they can read it or give it away to Eastern European script kiddies? F2A is complete nonsense. It doesn't matter how secure it is, if a security measure prevents me from accessing my account, that's not secure, that's locked out.</s>
15
+ <br>
9
16
 
10
- * __Answer #2__
11
- * <s> Two repos with the same name, would be confusing. </s>
12
-
13
- * __Answer #3__
14
- * <s>I wanted to rethink everything. After going through the code, I kept about 75% of it. I completely rewrote the Xml parser,I did a lot of work with the Cue class, HLS, and really tuned up the cli. The cli is amazing and super easy to use.</s>
15
-
16
- * __Answer #4__
17
- * <s>I came up with a really cool name, but it wasn't available on pypi.org for a package name.</s>
18
-
19
- * __Answer #5__
20
- * <s>Really, I was just getting a little bored with the whole thing, I just wanted to shake things up a little, keep it fun.</s>
17
+ _I was satisfied with everything, only a linear entrance of.... there was a bomb with him._ ~ __Suzy in Swanee__
18
+ <br>
19
+ ___
20
+ _A little bigger than i thought, but lighter._ ~ __Bob in Buford__
21
+ <br>
22
+ ___
23
+ _Class! I choked very much, took it for the dacha, as an easily transported option, the sound was just hurt! And generally listen to music. Perfectly pumps speakers from ancient muses. Center Sony! Without distortion, background noise, detailed sound. In short, who does not need highend much, so I recommend it!_
24
+ ~ __Larry in Lawrenceville__
25
+ <br>
26
+ ___
27
+ _It's good, it's good. It's good. It's good. It's good. It's good. It's good. It's good. It's good. It's good_
28
+ ~ __Connie in Columbia__
29
+ <br>
30
+ ___
21
31
 
22
- * __Answer #6__
23
- * <s>Have you seen chewy Tic Tacs? They're just mini jelly beans.</s>
32
+ # FAQ
33
+ * Q. What is the latest version?
24
34
 
25
- * __Answer #7__
26
- * <s>I'll tell you the truth, everything is a lie.</s>
35
+ * A. `v3.0.13`
36
+ ---
37
+ * Q. How do I upgrade my code from threefive to the __more powerful super advanced threefive3?__
27
38
 
28
- * __Answer #8__
29
- * Obama is a lizard. I'm not sure about his wife.
30
-
31
- # How do I upgrade my code to threefive3?
32
- > Despite making a lot of changes, the api remains. threefive3 is pretty much a drop in replacement for threefive. I used sed to upgrade my code.
39
+ * A. `sed.`
33
40
  ```js
34
41
  sed -i 's/threefive/threefive3/g'
35
42
  ```
36
- > One thing to note, calling load or decode is no longer necessary for the Cue class, however, the methods are there in case you do call them.
37
- >
38
- >
39
- # Is threefive3 faster than threefive?
40
- ### `threefive` vs. `threefive3` vs. `threefive3 next release`
41
- #
42
- ![image](https://github.com/user-attachments/assets/c3b8f741-01f4-40c1-b980-5c9df40c288c)
43
-
44
-
45
-
46
-
47
- * _testing was done on a beatup chrome book reporting 5GB of RAM running Debian Sid and PyPy 7.3.11_
48
-
49
43
  ---
44
+ * Q. Does threefive3 have super cool new features?
50
45
 
51
- # Now with Super Advanced Error Detection and Stuff.
52
- * This is super cool.
53
- * Does not generate Fatal errors, it won't break your process.
54
- * Displays what is in error and how to correct it.
55
- * Works in the cli
56
- * Works in code.
57
- ![image](https://github.com/user-attachments/assets/50331e73-cd0a-46d6-b265-1b212d625737)
58
-
59
-
60
- # Issues and Bugs.
61
- * If you think you have a bug, I'll quickly fix it, but first I need you to prove it to me. __Show me the entire error message, the code you're running, and if the SCTE-35 is in video, the video stream. You think your stream has proprietary data, we call those UPIDS. I am not going to spend my time trying to guess what your issue might be because you don't trust me.
62
- ---
63
- # Special Requests.
64
- * If need some work done, this is what I do for a living, you can hire me.
65
- * If you want to discuss your project open an issue and I'll send you my contact info.
46
+ * A. `Yes.`
66
47
  ---
67
48
 
68
49
  # `Install`
@@ -83,11 +64,10 @@ make install
83
64
  ___
84
65
 
85
66
  # `The Cli tool`
86
- > The cli audetects data being available on stdin and that allows it to autodetect the SCTE-35 format as well as MPEGTS steams. Now every SCTE-35 data format, except hls, is autodetected on the commandline, as well as stdin.HLS requires the `hls` ketyword.
67
+ > The cli polls stdin and that allows it to autodetect the SCTE-35 format as well as MPEGTS steams. Now every SCTE-35 data format, except hls, is autodetected on the commandline, as well as stdin.<br>HLS requires the `hls` ketyword.
87
68
 
88
69
  ### The cli tool installs automatically with pip or the Makefile.
89
70
 
90
-
91
71
  * [__SCTE-35 Inputs__](#inputs)
92
72
  * [__SCTE-35 Outputs__](#outputs)
93
73
  * [Parse __MPEGTS__ streams for __SCTE-35__](#streams)
@@ -96,7 +76,6 @@ ___
96
76
  * [Display raw __SCTE-35 packets__ from __video streams__](#packets)
97
77
  * [__Repair SCTE-35 streams__ changed to __bin data__ by __ffmpeg__](#sixfix)
98
78
 
99
-
100
79
  # `Inputs`
101
80
 
102
81
  * Most __inputs__ are __auto-detected.__
@@ -111,9 +90,9 @@ ___
111
90
  | __HLS__ |`threefive3 hls https://example.com/master.m3u8` |
112
91
  | __JSON__ |`threefive3 < json.json` |
113
92
  | __Xml__ | `threefive3 < xml.xml` |
114
- | __Xmlbin__ | `threefive3 < xmlbin.xml` |
93
+ | __Xmlbin__ | `js threefive3 < xmlbin.xml` |
115
94
 
116
- # Streams
95
+ # `Streams`
117
96
 
118
97
  |Protocol | Cli Example |
119
98
  |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -145,56 +124,64 @@ ___
145
124
 
146
125
  ### `hls`
147
126
  * parse hls manifests and segments for SCTE-35
148
- ```rebol
127
+ ```smalltalk
149
128
  threefive3 hls https://example.com/master.m3u8
150
129
  ```
151
130
  ___
152
131
  ### `Iframes`
153
132
  * Show iframes PTS in an MPEGTS video
154
- ```rebol
133
+
134
+ ```smalltalk
155
135
  threefive3 iframes https://example.com/video.ts
156
136
  ```
157
137
  ___
158
138
  ### `packets`
159
139
  * Print raw SCTE-35 packets from multicast mpegts video
160
- ```rebol
140
+
141
+ ```smalltalk
161
142
  threefive3 packets udp://@235.35.3.5:3535
162
143
  ```
163
144
  ___
164
145
  ### `proxy`
165
146
  * Parse a https stream and write raw video to stdout
166
- ```rebol
147
+
148
+ ```smalltalk
167
149
  threefive3 proxy video.ts
168
150
  ```
169
151
  ___
170
152
  ### `pts`
171
153
  * Print PTS from mpegts video
172
- ```rebol
173
- threefive3 pts video.ts
154
+
155
+ ```smalltalk
156
+ threefive3 pts video.ts
174
157
  ```
175
158
  ___
176
159
  ### `sidecar`
177
160
  * Parse a stream, write pts,write SCTE-35 Cues to sidecar.txt
178
- ```rebol
179
- threefive3 sidecar video.ts
161
+
162
+ ```smalltalk
163
+ threefive3 sidecar video.ts
180
164
  ```
181
165
  ___
182
166
  ### `sixfix`
183
167
  * Fix SCTE-35 data mangled by ffmpeg
184
- ```rebol
185
- threefive3 sixfix video.ts
168
+
169
+ ```smalltalk
170
+ threefive3 sixfix video.ts
186
171
  ```
187
172
  ___
188
173
  ### `show`
189
174
 
190
175
  * Probe mpegts video _( kind of like ffprobe )_
191
- ```rebol
176
+
177
+ ```smalltalk
192
178
  threefive3 show video.ts
193
179
  ```
194
180
  ___
195
181
  ### `version`
196
182
  * Show version
197
- ```rebol
183
+
184
+ ```smalltalk
198
185
  threefive3 version
199
186
  ```
200
187
  ___
@@ -204,7 +191,6 @@ ___
204
191
  threefive3 help
205
192
  ```
206
193
  ## [iodisco.com/scte35](https://iodisco.com/scte35)
207
- [![image](https://github.com/user-attachments/assets/28d228c5-56e2-41d3-a053-eebd3af958f1)
208
- ![image](https://github.com/user-attachments/assets/07c52c21-e83e-438d-91b0-6f502f0d1d43)](https://iodisco.com/scte35)
209
- ___
194
+ ![image](https://github.com/user-attachments/assets/4df85c44-a078-4da0-97e2-5daefcf2509d)
195
+
210
196
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/pypy3
1
+ #!/usr/bin/python3
2
2
 
3
3
  """
4
4
  scte35 command line SCTE35 decoder.
@@ -18,6 +18,9 @@ class BitBin:
18
18
  self.bitsize = self.idx = len(bites) << 3
19
19
  self.bits = int.from_bytes(bites, byteorder="big")
20
20
 
21
+ def __repr__(self):
22
+ return str(vars(self))
23
+
21
24
  def as_90k(self, num_bits):
22
25
  """
23
26
  Returns num_bits
@@ -72,9 +72,10 @@ class Cue(SCTE35Base):
72
72
  bites = self.mk_info_section(bites)
73
73
  bites = self._set_splice_command(bites)
74
74
  bites = self._mk_descriptors(bites)
75
- crc = hex(int.from_bytes(bites[0:4], byteorder="big"))
76
- self.info_section.crc = crc
77
- return True
75
+ if bites:
76
+ crc = hex(int.from_bytes(bites[0:4], byteorder="big"))
77
+ self.info_section.crc = crc
78
+ return True
78
79
  return False
79
80
 
80
81
  def _descriptor_loop(self, loop_bites):
@@ -6,6 +6,7 @@ scte35.hls hls.py
6
6
  """
7
7
 
8
8
  import datetime
9
+ import os
9
10
  import sys
10
11
  import time
11
12
  from collections import deque
@@ -152,8 +153,10 @@ class Scte35Profile:
152
153
 
153
154
  @staticmethod
154
155
  def _clean(line):
156
+ '''
157
+ remove whitespace and quotes
158
+ '''
155
159
  translate_map = {34: 94, 10: 94, 9: 94, 32: 94, 39: 94}
156
- # translate " ", "\n", "\t", '"', "'" to ^ and delete.
157
160
  return line.translate(translate_map).replace("^", "")
158
161
 
159
162
  def clean_n_split(self, line):
@@ -209,13 +212,12 @@ class Scte35Profile:
209
212
 
210
213
  def read_profile(self, pro_file):
211
214
  """
212
- read_profile reads sc.profile
215
+ read_profile reads hls.profile
213
216
  """
214
- try:
217
+ if os.path.isfile(pro_file):
215
218
  with open(pro_file, "r", encoding="utf-8") as pro_handle:
216
219
  self._parse_profile(pro_handle)
217
- finally:
218
- self.show_profile("Profile:")
220
+ self.show_profile("Profile:")
219
221
 
220
222
  def set_pts(self, cue):
221
223
  """
@@ -272,7 +274,7 @@ class Scte35Profile:
272
274
  """
273
275
  validate_splice_insert is named appropriately.
274
276
  """
275
- line = self._is_splice_insert_cueout(self, cue)
277
+ line = self._is_splice_insert_cueout(cue)
276
278
  if not line:
277
279
  line = "#EXT-X-CUE-IN\n"
278
280
  return line
@@ -892,7 +894,7 @@ class CuePuller:
892
894
 
893
895
  def chk_window_size(self, lines):
894
896
  """
895
- chk_window_size sets the sliding window size
897
+ mk_window_size sets the sliding window size
896
898
  for the output to match that off the input and
897
899
  determine how long to keep media data info
898
900
  for segments.
@@ -5,7 +5,7 @@ threefive3.iframes
5
5
 
6
6
  import sys
7
7
  from functools import partial
8
- from new_reader import reader
8
+ from .new_reader import reader
9
9
  from .spare import print2
10
10
 
11
11
 
@@ -121,8 +121,10 @@ class Segment(Stream):
121
121
  decode a mpegts segment.
122
122
  """
123
123
  super().decode(func=self.show_cue)
124
- self.pts_start = self.as_90k(self.start.popitem()[1])
125
- self.pts_last = self.as_90k(list(self.maps.prgm_pts.items())[0][1])
124
+ if self.start:
125
+ self.pts_start = self.as_90k(self.start.popitem()[1])
126
+ self.pts_last = self.as_90k(list(self.maps.prgm_pts.items())[0][1])
127
+ self.duration = round(self.pts_last - self.pts_start, 6)
128
+
126
129
  if self.tmp:
127
130
  os.unlink(self.tmp)
128
- self.duration = round(self.pts_last - self.pts_start, 6)
@@ -105,11 +105,11 @@ class SixFix(Stream):
105
105
  nbin.add_bites(n_streams)
106
106
  a_crc = crc32(nbin.bites)
107
107
  nbin.add_int(a_crc, 32)
108
- n_payload = nbin.bites
109
- pad = 187 - (len(n_payload) + 4)
110
108
  pointer_field = b"\x00"
109
+ n_payload = pointer_field +nbin.bites
110
+ pad =184 -len(n_payload)
111
111
  if pad > 0:
112
- n_payload = pointer_field + n_payload + (b"\xff" * pad)
112
+ n_payload = n_payload + (b"\xff" * pad)
113
113
  self.pmt_payloads[prgm] = n_payload
114
114
 
115
115
  def _chk_payload(self, pay, pid):
@@ -230,10 +230,11 @@ class Stream:
230
230
  """
231
231
  while self._tsdata:
232
232
  one = self._tsdata.read(1)
233
- if one[0] == self.SYNC_BYTE:
234
- tail = self._tsdata.read(self.PACKET_SIZE - 1)
235
- self._parse(one + tail)
236
- return True
233
+ if one:
234
+ if one[0]== self.SYNC_BYTE:
235
+ tail = self._tsdata.read(self.PACKET_SIZE - 1)
236
+ self._parse(one + tail)
237
+ return True
237
238
  print2("No Stream Found\n")
238
239
  return False
239
240
 
@@ -448,20 +449,18 @@ class Stream:
448
449
  head_size += afl + 1 # +1 for afl byte
449
450
  return pkt[head_size:]
450
451
 
451
- def _pmt_pid(self, pay, pid, outdata):
452
+ def _pmt_pid(self, pkt, pid):
452
453
  if pid in self.pids.pmt:
453
- outdata = self._parse_pmt(pay, pid)
454
- return outdata
454
+ pay = self._parse_payload(pkt)
455
+ self._parse_pmt(pay, pid)
455
456
 
456
- def _pat_pid(self, pay, pid, outdata):
457
+ def _pat_pid(self, pay, pid):
457
458
  if pid == self.pids.PAT_PID:
458
- outdata = self._parse_pat(pay)
459
- return outdata
459
+ self._parse_pat(pay)
460
460
 
461
- def _sdt_pid(self, pay, pid, outdata):
461
+ def _sdt_pid(self, pay, pid,):
462
462
  if pid == self.pids.SDT_PID:
463
- outdata = self._parse_sdt(pay)
464
- return outdata
463
+ self._parse_sdt(pay)
465
464
 
466
465
  def _parse_tables(self, pkt, pid):
467
466
  """
@@ -469,14 +468,11 @@ class Stream:
469
468
  PAT, PMT, and SDT tables
470
469
  based on pid of the pkt
471
470
  """
472
- outdata = False
471
+ self._pmt_pid(pkt, pid,)
473
472
  pay = self._parse_payload(pkt)
474
- if self._same_as_last(pay, pid):
475
- return outdata
476
- outdata = self._pmt_pid(pay, pid, outdata)
477
- outdata = self._pat_pid(pay, pid, outdata)
478
- outdata = self._sdt_pid(pay, pid, outdata)
479
- return outdata
473
+ if not self._same_as_last(pay, pid):
474
+ self._pat_pid(pay, pid)
475
+ self._sdt_pid(pay, pid)
480
476
 
481
477
  def _parse_info(self, pkt):
482
478
  """
@@ -506,20 +502,15 @@ class Stream:
506
502
  pid = self._parse_info(pkt)
507
503
  if pid in self.pids.pcr:
508
504
  self._chk_pcr(pkt, pid)
505
+ if self._pusi_flag(pkt):
509
506
  self._chk_pts(pkt, pid)
510
507
  return self._chk_scte35(pkt, pid)
511
508
 
512
- ## This is stupid slow. set.union performance sucks.
513
- ## def _pid_has_scte35(self, pid):
514
- # 4.47 secs
515
- ## return pid in self.pids.scte35.union(self.pids.maybe_scte35)
516
509
  def _pid_has_scte35(self, pid):
517
- # 3.37, 3,371, 3.381, 3.400, 3.388, 3.374, 3.384
518
- # return (pid in self.pids.scte35 or pid in self.pids.maybe_scte35)
519
- # 3.348, 3.324, 3.326,3.325,3.312, 3.300, 3.328 winner
520
- return pid in (self.pids.scte35 or self.pids.maybe_scte35)
521
- # 4.128 wtf? I tested it seven times 4.135, 4.125, 4.279, 4.128, 4.118,4.138
522
- # return pid in (self.pids.scte35|self.pids.maybe_scte35)
510
+ # return pid in self.pids.scte35.union(self.pids.maybe_scte35) # union sucks. 4.47 secs
511
+ # return (pid in self.pids.scte35 or pid in self.pids.maybe_scte35) # 3.37 secs
512
+ return pid in (self.pids.scte35 or self.pids.maybe_scte35) # 3.326 secs
513
+ # return pid in (self.pids.scte35|self.pids.maybe_scte35) # wtf? 4.128 secs
523
514
 
524
515
  def _chk_partial(self, pay, pid, sep):
525
516
  if pid in self.maps.partial:
@@ -591,8 +582,8 @@ class Stream:
591
582
  return cue
592
583
 
593
584
  def _mk_pinfo(self, service_id, pn, sn):
594
- # if service_id not in self.maps.prgm:
595
- self.maps.prgm[service_id] = ProgramInfo()
585
+ if service_id not in self.maps.prgm:
586
+ self.maps.prgm[service_id] = ProgramInfo()
596
587
  pinfo = self.maps.prgm[service_id]
597
588
  pinfo.provider = pn
598
589
  pinfo.service = sn
@@ -653,28 +644,23 @@ class Stream:
653
644
  idx += chunk_size
654
645
  return True
655
646
 
656
- def _mk_pmt_payload(self, pay, pid):
657
- seclen = False
658
- program_number = False
659
- pay = self._chk_partial(pay, pid, self.PMT_TID)
660
- if not pay:
661
- return False, False, False
662
- seclen = self._parse_length(pay[1], pay[2])
663
- if self._section_incomplete(pay, pid, seclen):
664
- return False, False, False
665
- program_number = self._parse_program(pay[3], pay[4])
666
- return pay, seclen, program_number
667
647
 
668
648
  def _parse_pmt(self, pay, pid):
669
649
  """
670
650
  parse program maps for streams
671
651
  """
672
- pay, seclen, program_number = self._mk_pmt_payload(pay, pid)
652
+ pay = self._chk_partial(pay, pid, self.PMT_TID)
653
+ if not pay:
654
+ return False
655
+ seclen = self._parse_length(pay[1], pay[2])
656
+ if self._section_incomplete(pay, pid, seclen):
657
+ return False
658
+ program_number = self._parse_program(pay[3], pay[4])
673
659
  if not program_number:
674
660
  return False
675
661
  pcr_pid = self._parse_pid(pay[8], pay[9])
676
- # if program_number not in self.maps.prgm:
677
- self.maps.prgm[program_number] = ProgramInfo()
662
+ if program_number not in self.maps.prgm:
663
+ self.maps.prgm[program_number] = ProgramInfo()
678
664
  pinfo = self.maps.prgm[program_number]
679
665
  pinfo.pid = pid
680
666
  pinfo.pcr_pid = pcr_pid
@@ -693,7 +679,7 @@ class Stream:
693
679
  """
694
680
  # 5 bytes for stream_type info
695
681
  chunk_size = 5
696
- end_idx = (idx + si_len) - chunk_size
682
+ end_idx = (idx + si_len) -4
697
683
  while idx < end_idx:
698
684
  stream_type, pid, ei_len = self._parse_stream_type(pay, idx)
699
685
  pinfo = self.maps.prgm[program_number]
@@ -5,6 +5,6 @@ from the cli tool run: threefive3 version
5
5
 
6
6
  major = 3
7
7
  minor = 0
8
- maintenance = 9
8
+ maintenance = 13
9
9
 
10
10
  version = f"{major}.{minor}.{maintenance}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: threefive3
3
- Version: 3.0.9
3
+ Version: 3.0.13
4
4
  Summary: threefive continued.
5
5
  Home-page: https://github.com/superkabuki/scte35
6
6
  Author: Adrian of Doom
@@ -22,71 +22,52 @@ Requires-Dist: m3ufu>=0.0.89
22
22
  Requires-Dist: sideways>=0.0.23
23
23
  Requires-Dist: pyaes
24
24
 
25
- ![image](https://github.com/user-attachments/assets/adae03a1-9f85-403e-9dce-d134e0996903)
25
+ [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)
26
26
 
27
- # Latest version is v3.0.9
28
27
 
29
- # Why threefive3, why not just threefive?
28
+ # threefive3
29
+ SCTE-35 Parser ✅
30
+ SCTE-35 Encoder ✅
31
+ SCTE-35 HLS ✅
32
+ SCTE-35 Xml ✅
33
+ SCTE-35 Cli ✅
34
+ SCTE-35 library ✅
35
+ <br>
36
+ <br>
37
+ # What people are saying about threefive3:
30
38
 
31
- * __Answer #1__
32
- * <s>Github F2A'ed out of my account, and I have no idea where I put the recovery codes. I have more than one Internet account, where I am supposed to keep all this data? Should I store in some company's cloud so they can read it or give it away to Eastern European script kiddies? F2A is complete nonsense. It doesn't matter how secure it is, if a security measure prevents me from accessing my account, that's not secure, that's locked out.</s>
39
+ <br>
33
40
 
34
- * __Answer #2__
35
- * <s> Two repos with the same name, would be confusing. </s>
36
-
37
- * __Answer #3__
38
- * <s>I wanted to rethink everything. After going through the code, I kept about 75% of it. I completely rewrote the Xml parser,I did a lot of work with the Cue class, HLS, and really tuned up the cli. The cli is amazing and super easy to use.</s>
39
-
40
- * __Answer #4__
41
- * <s>I came up with a really cool name, but it wasn't available on pypi.org for a package name.</s>
42
-
43
- * __Answer #5__
44
- * <s>Really, I was just getting a little bored with the whole thing, I just wanted to shake things up a little, keep it fun.</s>
41
+ _I was satisfied with everything, only a linear entrance of.... there was a bomb with him._ ~ __Suzy in Swanee__
42
+ <br>
43
+ ___
44
+ _A little bigger than i thought, but lighter._ ~ __Bob in Buford__
45
+ <br>
46
+ ___
47
+ _Class! I choked very much, took it for the dacha, as an easily transported option, the sound was just hurt! And generally listen to music. Perfectly pumps speakers from ancient muses. Center Sony! Without distortion, background noise, detailed sound. In short, who does not need highend much, so I recommend it!_
48
+ ~ __Larry in Lawrenceville__
49
+ <br>
50
+ ___
51
+ _It's good, it's good. It's good. It's good. It's good. It's good. It's good. It's good. It's good. It's good_
52
+ ~ __Connie in Columbia__
53
+ <br>
54
+ ___
45
55
 
46
- * __Answer #6__
47
- * <s>Have you seen chewy Tic Tacs? They're just mini jelly beans.</s>
56
+ # FAQ
57
+ * Q. What is the latest version?
48
58
 
49
- * __Answer #7__
50
- * <s>I'll tell you the truth, everything is a lie.</s>
59
+ * A. `v3.0.13`
60
+ ---
61
+ * Q. How do I upgrade my code from threefive to the __more powerful super advanced threefive3?__
51
62
 
52
- * __Answer #8__
53
- * Obama is a lizard. I'm not sure about his wife.
54
-
55
- # How do I upgrade my code to threefive3?
56
- > Despite making a lot of changes, the api remains. threefive3 is pretty much a drop in replacement for threefive. I used sed to upgrade my code.
63
+ * A. `sed.`
57
64
  ```js
58
65
  sed -i 's/threefive/threefive3/g'
59
66
  ```
60
- > One thing to note, calling load or decode is no longer necessary for the Cue class, however, the methods are there in case you do call them.
61
- >
62
- >
63
- # Is threefive3 faster than threefive?
64
- ### `threefive` vs. `threefive3` vs. `threefive3 next release`
65
- #
66
- ![image](https://github.com/user-attachments/assets/c3b8f741-01f4-40c1-b980-5c9df40c288c)
67
-
68
-
69
-
70
-
71
- * _testing was done on a beatup chrome book reporting 5GB of RAM running Debian Sid and PyPy 7.3.11_
72
-
73
67
  ---
68
+ * Q. Does threefive3 have super cool new features?
74
69
 
75
- # Now with Super Advanced Error Detection and Stuff.
76
- * This is super cool.
77
- * Does not generate Fatal errors, it won't break your process.
78
- * Displays what is in error and how to correct it.
79
- * Works in the cli
80
- * Works in code.
81
- ![image](https://github.com/user-attachments/assets/50331e73-cd0a-46d6-b265-1b212d625737)
82
-
83
-
84
- # Issues and Bugs.
85
- * If you think you have a bug, I'll quickly fix it, but first I need you to prove it to me. __Show me the entire error message, the code you're running, and if the SCTE-35 is in video, the video stream. You think your stream has proprietary data, we call those UPIDS. I am not going to spend my time trying to guess what your issue might be because you don't trust me.
86
- ---
87
- # Special Requests.
88
- * If need some work done, this is what I do for a living, you can hire me.
89
- * If you want to discuss your project open an issue and I'll send you my contact info.
70
+ * A. `Yes.`
90
71
  ---
91
72
 
92
73
  # `Install`
@@ -107,11 +88,10 @@ make install
107
88
  ___
108
89
 
109
90
  # `The Cli tool`
110
- > The cli audetects data being available on stdin and that allows it to autodetect the SCTE-35 format as well as MPEGTS steams. Now every SCTE-35 data format, except hls, is autodetected on the commandline, as well as stdin.HLS requires the `hls` ketyword.
91
+ > The cli polls stdin and that allows it to autodetect the SCTE-35 format as well as MPEGTS steams. Now every SCTE-35 data format, except hls, is autodetected on the commandline, as well as stdin.<br>HLS requires the `hls` ketyword.
111
92
 
112
93
  ### The cli tool installs automatically with pip or the Makefile.
113
94
 
114
-
115
95
  * [__SCTE-35 Inputs__](#inputs)
116
96
  * [__SCTE-35 Outputs__](#outputs)
117
97
  * [Parse __MPEGTS__ streams for __SCTE-35__](#streams)
@@ -120,7 +100,6 @@ ___
120
100
  * [Display raw __SCTE-35 packets__ from __video streams__](#packets)
121
101
  * [__Repair SCTE-35 streams__ changed to __bin data__ by __ffmpeg__](#sixfix)
122
102
 
123
-
124
103
  # `Inputs`
125
104
 
126
105
  * Most __inputs__ are __auto-detected.__
@@ -135,9 +114,9 @@ ___
135
114
  | __HLS__ |`threefive3 hls https://example.com/master.m3u8` |
136
115
  | __JSON__ |`threefive3 < json.json` |
137
116
  | __Xml__ | `threefive3 < xml.xml` |
138
- | __Xmlbin__ | `threefive3 < xmlbin.xml` |
117
+ | __Xmlbin__ | `js threefive3 < xmlbin.xml` |
139
118
 
140
- # Streams
119
+ # `Streams`
141
120
 
142
121
  |Protocol | Cli Example |
143
122
  |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -169,56 +148,64 @@ ___
169
148
 
170
149
  ### `hls`
171
150
  * parse hls manifests and segments for SCTE-35
172
- ```rebol
151
+ ```smalltalk
173
152
  threefive3 hls https://example.com/master.m3u8
174
153
  ```
175
154
  ___
176
155
  ### `Iframes`
177
156
  * Show iframes PTS in an MPEGTS video
178
- ```rebol
157
+
158
+ ```smalltalk
179
159
  threefive3 iframes https://example.com/video.ts
180
160
  ```
181
161
  ___
182
162
  ### `packets`
183
163
  * Print raw SCTE-35 packets from multicast mpegts video
184
- ```rebol
164
+
165
+ ```smalltalk
185
166
  threefive3 packets udp://@235.35.3.5:3535
186
167
  ```
187
168
  ___
188
169
  ### `proxy`
189
170
  * Parse a https stream and write raw video to stdout
190
- ```rebol
171
+
172
+ ```smalltalk
191
173
  threefive3 proxy video.ts
192
174
  ```
193
175
  ___
194
176
  ### `pts`
195
177
  * Print PTS from mpegts video
196
- ```rebol
197
- threefive3 pts video.ts
178
+
179
+ ```smalltalk
180
+ threefive3 pts video.ts
198
181
  ```
199
182
  ___
200
183
  ### `sidecar`
201
184
  * Parse a stream, write pts,write SCTE-35 Cues to sidecar.txt
202
- ```rebol
203
- threefive3 sidecar video.ts
185
+
186
+ ```smalltalk
187
+ threefive3 sidecar video.ts
204
188
  ```
205
189
  ___
206
190
  ### `sixfix`
207
191
  * Fix SCTE-35 data mangled by ffmpeg
208
- ```rebol
209
- threefive3 sixfix video.ts
192
+
193
+ ```smalltalk
194
+ threefive3 sixfix video.ts
210
195
  ```
211
196
  ___
212
197
  ### `show`
213
198
 
214
199
  * Probe mpegts video _( kind of like ffprobe )_
215
- ```rebol
200
+
201
+ ```smalltalk
216
202
  threefive3 show video.ts
217
203
  ```
218
204
  ___
219
205
  ### `version`
220
206
  * Show version
221
- ```rebol
207
+
208
+ ```smalltalk
222
209
  threefive3 version
223
210
  ```
224
211
  ___
@@ -228,7 +215,6 @@ ___
228
215
  threefive3 help
229
216
  ```
230
217
  ## [iodisco.com/scte35](https://iodisco.com/scte35)
231
- [![image](https://github.com/user-attachments/assets/28d228c5-56e2-41d3-a053-eebd3af958f1)
232
- ![image](https://github.com/user-attachments/assets/07c52c21-e83e-438d-91b0-6f502f0d1d43)](https://iodisco.com/scte35)
233
- ___
218
+ ![image](https://github.com/user-attachments/assets/4df85c44-a078-4da0-97e2-5daefcf2509d)
219
+
234
220
 
File without changes
File without changes
File without changes