threefive3 3.0.5__tar.gz → 3.0.9__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 (37) hide show
  1. threefive3-3.0.9/LICENSE +24 -0
  2. threefive3-3.0.9/PKG-INFO +234 -0
  3. threefive3-3.0.9/README.md +210 -0
  4. {threefive3-3.0.5 → threefive3-3.0.9}/bin/threefive3 +9 -5
  5. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/base.py +8 -0
  6. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/cue.py +15 -14
  7. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/hls.py +148 -84
  8. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/iframes.py +32 -14
  9. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/sixfix.py +14 -12
  10. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/stream.py +108 -72
  11. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/sxp.py +14 -12
  12. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/upids.py +5 -10
  13. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/version.py +1 -1
  14. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/x2c.py +33 -16
  15. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/xml.py +1 -1
  16. threefive3-3.0.9/threefive3.egg-info/PKG-INFO +234 -0
  17. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3.egg-info/SOURCES.txt +1 -0
  18. threefive3-3.0.5/PKG-INFO +0 -255
  19. threefive3-3.0.5/README.md +0 -233
  20. threefive3-3.0.5/threefive3.egg-info/PKG-INFO +0 -255
  21. {threefive3-3.0.5 → threefive3-3.0.9}/setup.cfg +0 -0
  22. {threefive3-3.0.5 → threefive3-3.0.9}/setup.py +0 -0
  23. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/__init__.py +0 -0
  24. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/bitn.py +0 -0
  25. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/commands.py +0 -0
  26. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/crc.py +0 -0
  27. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/descriptors.py +0 -0
  28. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/new_reader.py +0 -0
  29. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/packetdata.py +0 -0
  30. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/section.py +0 -0
  31. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/segment.py +0 -0
  32. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/segmentation.py +0 -0
  33. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/spare.py +0 -0
  34. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3/streamtypes.py +0 -0
  35. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3.egg-info/dependency_links.txt +0 -0
  36. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3.egg-info/requires.txt +1 -1
  37. {threefive3-3.0.5 → threefive3-3.0.9}/threefive3.egg-info/top_level.txt +0 -0
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2024, Adrian of Doom
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,234 @@
1
+ Metadata-Version: 2.1
2
+ Name: threefive3
3
+ Version: 3.0.9
4
+ Summary: threefive continued.
5
+ Home-page: https://github.com/superkabuki/scte35
6
+ Author: Adrian of Doom
7
+ Author-email: spam@iodisco.com
8
+ Classifier: License :: OSI Approved :: Sleepycat License
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Operating System :: POSIX :: BSD :: OpenBSD
12
+ Classifier: Operating System :: POSIX :: BSD :: NetBSD
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Topic :: Multimedia :: Video
15
+ Classifier: Programming Language :: Python :: 3.6
16
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
17
+ Classifier: Programming Language :: Python :: Implementation :: CPython
18
+ Requires-Python: >=3.6
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: m3ufu>=0.0.89
22
+ Requires-Dist: sideways>=0.0.23
23
+ Requires-Dist: pyaes
24
+
25
+ ![image](https://github.com/user-attachments/assets/adae03a1-9f85-403e-9dce-d134e0996903)
26
+
27
+ # Latest version is v3.0.9
28
+
29
+ # Why threefive3, why not just threefive?
30
+
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>
33
+
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>
45
+
46
+ * __Answer #6__
47
+ * <s>Have you seen chewy Tic Tacs? They're just mini jelly beans.</s>
48
+
49
+ * __Answer #7__
50
+ * <s>I'll tell you the truth, everything is a lie.</s>
51
+
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.
57
+ ```js
58
+ sed -i 's/threefive/threefive3/g'
59
+ ```
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
+ ---
74
+
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.
90
+ ---
91
+
92
+ # `Install`
93
+ * python3 via pip
94
+ ```rebol
95
+ python3 -mpip install threefive3
96
+ ```
97
+ * pypy3
98
+ ```rebol
99
+ pypy3 -mpip install threefive3
100
+ ```
101
+ * from the git repo
102
+ ```rebol
103
+ git clone https://github.com/superkabuki/scte35.git
104
+ cd scte35
105
+ make install
106
+ ```
107
+ ___
108
+
109
+ # `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.
111
+
112
+ ### The cli tool installs automatically with pip or the Makefile.
113
+
114
+
115
+ * [__SCTE-35 Inputs__](#inputs)
116
+ * [__SCTE-35 Outputs__](#outputs)
117
+ * [Parse __MPEGTS__ streams for __SCTE-35__](#streams)
118
+ * [Parse __SCTE-35__ in __hls__](#hls)
119
+ * [Display __MPEGTS__ __iframes__](#iframes)
120
+ * [Display raw __SCTE-35 packets__ from __video streams__](#packets)
121
+ * [__Repair SCTE-35 streams__ changed to __bin data__ by __ffmpeg__](#sixfix)
122
+
123
+
124
+ # `Inputs`
125
+
126
+ * Most __inputs__ are __auto-detected.__
127
+ * __stdin__ is __auto selected__ and __auto detected.__
128
+ * __SCTE-35 data is printed to stderr__
129
+ * __stdout is used when piping video__
130
+
131
+ | Input Type | Cli Example |
132
+ |------------|-------------------------------------------------------------------------------------------------------------|
133
+ | __Base64__ | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='`
134
+ | __Hex__ |`threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b`|
135
+ | __HLS__ |`threefive3 hls https://example.com/master.m3u8` |
136
+ | __JSON__ |`threefive3 < json.json` |
137
+ | __Xml__ | `threefive3 < xml.xml` |
138
+ | __Xmlbin__ | `threefive3 < xmlbin.xml` |
139
+
140
+ # Streams
141
+
142
+ |Protocol | Cli Example |
143
+ |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
144
+ | File | `threefive3 video.ts` |
145
+ | Http(s) | `threefive3 https://example.com/video.ts` |
146
+ | Stdin | `threefive3 < video.ts` |
147
+ | UDP Multicast| `threefive3 udp://@235.35.3.5:9999` |
148
+ | UDP Unicast | `threefive3 udp://10.0.0.7:5555` |
149
+ | HLS | `threefive3 hls https://example.com/master.m3u8`|
150
+ | | |
151
+
152
+
153
+ ### Outputs
154
+ * output type is determined by the key words __base64, bytes, hex, int, json, xml, and xmlbin__.
155
+ * __json is the default__.
156
+ * __Any input (except HLS,) can be returned as any output__
157
+ * examples __Base64 to Hex__, or __Mpegts to Xml__, etc...)
158
+
159
+
160
+ | Output Type | Cli Example |
161
+ |-------------|----------------------------------------------------------|
162
+ |__Base 64__ | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b base64 ` |
163
+ | __Bytes__ | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b bytes` |
164
+ | Hex | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' hex` |
165
+ | Integer | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' int` |
166
+ | JSON | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b json ` |
167
+ | Xml | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' xml ` ` |
168
+ | Xml+bin | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b xmlbin ` |`
169
+
170
+ ### `hls`
171
+ * parse hls manifests and segments for SCTE-35
172
+ ```rebol
173
+ threefive3 hls https://example.com/master.m3u8
174
+ ```
175
+ ___
176
+ ### `Iframes`
177
+ * Show iframes PTS in an MPEGTS video
178
+ ```rebol
179
+ threefive3 iframes https://example.com/video.ts
180
+ ```
181
+ ___
182
+ ### `packets`
183
+ * Print raw SCTE-35 packets from multicast mpegts video
184
+ ```rebol
185
+ threefive3 packets udp://@235.35.3.5:3535
186
+ ```
187
+ ___
188
+ ### `proxy`
189
+ * Parse a https stream and write raw video to stdout
190
+ ```rebol
191
+ threefive3 proxy video.ts
192
+ ```
193
+ ___
194
+ ### `pts`
195
+ * Print PTS from mpegts video
196
+ ```rebol
197
+ threefive3 pts video.ts
198
+ ```
199
+ ___
200
+ ### `sidecar`
201
+ * Parse a stream, write pts,write SCTE-35 Cues to sidecar.txt
202
+ ```rebol
203
+ threefive3 sidecar video.ts
204
+ ```
205
+ ___
206
+ ### `sixfix`
207
+ * Fix SCTE-35 data mangled by ffmpeg
208
+ ```rebol
209
+ threefive3 sixfix video.ts
210
+ ```
211
+ ___
212
+ ### `show`
213
+
214
+ * Probe mpegts video _( kind of like ffprobe )_
215
+ ```rebol
216
+ threefive3 show video.ts
217
+ ```
218
+ ___
219
+ ### `version`
220
+ * Show version
221
+ ```rebol
222
+ threefive3 version
223
+ ```
224
+ ___
225
+ ### `help`
226
+ * Help
227
+ ```rebol
228
+ threefive3 help
229
+ ```
230
+ ## [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
+ ___
234
+
@@ -0,0 +1,210 @@
1
+ ![image](https://github.com/user-attachments/assets/adae03a1-9f85-403e-9dce-d134e0996903)
2
+
3
+ # Latest version is v3.0.9
4
+
5
+ # Why threefive3, why not just threefive?
6
+
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>
9
+
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>
21
+
22
+ * __Answer #6__
23
+ * <s>Have you seen chewy Tic Tacs? They're just mini jelly beans.</s>
24
+
25
+ * __Answer #7__
26
+ * <s>I'll tell you the truth, everything is a lie.</s>
27
+
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.
33
+ ```js
34
+ sed -i 's/threefive/threefive3/g'
35
+ ```
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
+ ---
50
+
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.
66
+ ---
67
+
68
+ # `Install`
69
+ * python3 via pip
70
+ ```rebol
71
+ python3 -mpip install threefive3
72
+ ```
73
+ * pypy3
74
+ ```rebol
75
+ pypy3 -mpip install threefive3
76
+ ```
77
+ * from the git repo
78
+ ```rebol
79
+ git clone https://github.com/superkabuki/scte35.git
80
+ cd scte35
81
+ make install
82
+ ```
83
+ ___
84
+
85
+ # `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.
87
+
88
+ ### The cli tool installs automatically with pip or the Makefile.
89
+
90
+
91
+ * [__SCTE-35 Inputs__](#inputs)
92
+ * [__SCTE-35 Outputs__](#outputs)
93
+ * [Parse __MPEGTS__ streams for __SCTE-35__](#streams)
94
+ * [Parse __SCTE-35__ in __hls__](#hls)
95
+ * [Display __MPEGTS__ __iframes__](#iframes)
96
+ * [Display raw __SCTE-35 packets__ from __video streams__](#packets)
97
+ * [__Repair SCTE-35 streams__ changed to __bin data__ by __ffmpeg__](#sixfix)
98
+
99
+
100
+ # `Inputs`
101
+
102
+ * Most __inputs__ are __auto-detected.__
103
+ * __stdin__ is __auto selected__ and __auto detected.__
104
+ * __SCTE-35 data is printed to stderr__
105
+ * __stdout is used when piping video__
106
+
107
+ | Input Type | Cli Example |
108
+ |------------|-------------------------------------------------------------------------------------------------------------|
109
+ | __Base64__ | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='`
110
+ | __Hex__ |`threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b`|
111
+ | __HLS__ |`threefive3 hls https://example.com/master.m3u8` |
112
+ | __JSON__ |`threefive3 < json.json` |
113
+ | __Xml__ | `threefive3 < xml.xml` |
114
+ | __Xmlbin__ | `threefive3 < xmlbin.xml` |
115
+
116
+ # Streams
117
+
118
+ |Protocol | Cli Example |
119
+ |---------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
120
+ | File | `threefive3 video.ts` |
121
+ | Http(s) | `threefive3 https://example.com/video.ts` |
122
+ | Stdin | `threefive3 < video.ts` |
123
+ | UDP Multicast| `threefive3 udp://@235.35.3.5:9999` |
124
+ | UDP Unicast | `threefive3 udp://10.0.0.7:5555` |
125
+ | HLS | `threefive3 hls https://example.com/master.m3u8`|
126
+ | | |
127
+
128
+
129
+ ### Outputs
130
+ * output type is determined by the key words __base64, bytes, hex, int, json, xml, and xmlbin__.
131
+ * __json is the default__.
132
+ * __Any input (except HLS,) can be returned as any output__
133
+ * examples __Base64 to Hex__, or __Mpegts to Xml__, etc...)
134
+
135
+
136
+ | Output Type | Cli Example |
137
+ |-------------|----------------------------------------------------------|
138
+ |__Base 64__ | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b base64 ` |
139
+ | __Bytes__ | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b bytes` |
140
+ | Hex | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' hex` |
141
+ | Integer | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' int` |
142
+ | JSON | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b json ` |
143
+ | Xml | `threefive3 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' xml ` ` |
144
+ | Xml+bin | `threefive3 0xfc301600000000000000fff00506fed605225b0000b0b65f3b xmlbin ` |`
145
+
146
+ ### `hls`
147
+ * parse hls manifests and segments for SCTE-35
148
+ ```rebol
149
+ threefive3 hls https://example.com/master.m3u8
150
+ ```
151
+ ___
152
+ ### `Iframes`
153
+ * Show iframes PTS in an MPEGTS video
154
+ ```rebol
155
+ threefive3 iframes https://example.com/video.ts
156
+ ```
157
+ ___
158
+ ### `packets`
159
+ * Print raw SCTE-35 packets from multicast mpegts video
160
+ ```rebol
161
+ threefive3 packets udp://@235.35.3.5:3535
162
+ ```
163
+ ___
164
+ ### `proxy`
165
+ * Parse a https stream and write raw video to stdout
166
+ ```rebol
167
+ threefive3 proxy video.ts
168
+ ```
169
+ ___
170
+ ### `pts`
171
+ * Print PTS from mpegts video
172
+ ```rebol
173
+ threefive3 pts video.ts
174
+ ```
175
+ ___
176
+ ### `sidecar`
177
+ * Parse a stream, write pts,write SCTE-35 Cues to sidecar.txt
178
+ ```rebol
179
+ threefive3 sidecar video.ts
180
+ ```
181
+ ___
182
+ ### `sixfix`
183
+ * Fix SCTE-35 data mangled by ffmpeg
184
+ ```rebol
185
+ threefive3 sixfix video.ts
186
+ ```
187
+ ___
188
+ ### `show`
189
+
190
+ * Probe mpegts video _( kind of like ffprobe )_
191
+ ```rebol
192
+ threefive3 show video.ts
193
+ ```
194
+ ___
195
+ ### `version`
196
+ * Show version
197
+ ```rebol
198
+ threefive3 version
199
+ ```
200
+ ___
201
+ ### `help`
202
+ * Help
203
+ ```rebol
204
+ threefive3 help
205
+ ```
206
+ ## [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
+ ___
210
+
@@ -13,7 +13,8 @@ from threefive3.new_reader import reader
13
13
  from threefive3 import Cue, Stream, print2, version
14
14
  from threefive3.hls import cli as hlscli
15
15
  from threefive3.sixfix import sixfix
16
- from sideways import cli as sidecli
16
+
17
+ # from sideways import cli as sidecli
17
18
 
18
19
  REV = "\033[7;1m"
19
20
  NORM = "\033[27m\033[0m"
@@ -308,7 +309,7 @@ def to_funk(this):
308
309
  """
309
310
  to_funk prints a cue in a variety of formats.
310
311
  """
311
- cue=None
312
+ cue = None
312
313
  if this in ["", b""]:
313
314
  return
314
315
  try:
@@ -320,6 +321,7 @@ def to_funk(this):
320
321
  cue = Cue(this)
321
322
  except:
322
323
  print2("Bad Data")
324
+ sys.exit()
323
325
  if cue:
324
326
  funk()(cue) # func works here too.
325
327
 
@@ -336,9 +338,11 @@ def chk_stdin(args):
336
338
  two = reader(sys.stdin.buffer).read()
337
339
  args.append((one + two).decode()) # no rewind on stdin
338
340
  else:
339
- reader(sys.stdin.buffer).read(187) # drop first packet
340
- Stream(sys.stdin.buffer).decode(func=funk())
341
- sys.exit()
341
+ two = reader(sys.stdin.buffer).read(187)
342
+ strm = Stream(sys.stdin.buffer)
343
+ strm._parse(one + two) # dont drop first packet
344
+ strm.decode(func=funk())
345
+ sys.exit() # I keep forgetting why I do
342
346
  return args
343
347
 
344
348
 
@@ -105,6 +105,14 @@ class SCTE35Base:
105
105
  return True
106
106
  return False
107
107
 
108
+ def hasis(self, what):
109
+ """
110
+ hasis obj "has" a what and what "is" returned.
111
+ """
112
+ if self.has(what):
113
+ return vars(self)[what]
114
+ return None
115
+
108
116
  @staticmethod
109
117
  def idxsplit(gonzo, sep):
110
118
  """
@@ -15,6 +15,7 @@ from .xml import Node
15
15
  from .segmentation import table22
16
16
  from .x2c import xml2cue
17
17
 
18
+
18
19
  class Cue(SCTE35Base):
19
20
  """
20
21
  The threefive3.Cue class handles parsing
@@ -25,7 +26,7 @@ class Cue(SCTE35Base):
25
26
  >>>> Base64 = "/DAvAAAAAAAA///wBQb+dGKQoAAZAhdDVUVJSAAAjn+fCAgAAAAALKChijUCAKnMZ1g="
26
27
  >>>> cue = threefive3.Cue(Base64)
27
28
  >>>> cue.show()
28
-
29
+
29
30
  * A cue instance can be initialized with
30
31
  Base64, Bytes, Hex, Int, Json, Xml, or Xml+binary data.
31
32
 
@@ -38,7 +39,7 @@ class Cue(SCTE35Base):
38
39
  >>>> cue.command.pts_time
39
40
  21695.740089
40
41
 
41
-
42
+
42
43
  """
43
44
 
44
45
  def __init__(self, data=None, packet_data=None):
@@ -58,11 +59,10 @@ class Cue(SCTE35Base):
58
59
  def __repr__(self):
59
60
  return str(self.__dict__)
60
61
 
61
-
62
62
  def decode(self):
63
63
  """
64
64
  Cue.decode() parses for SCTE35 data
65
-
65
+
66
66
  * decode doesn't need to be called directly
67
67
  unless you initialize a Cue without data.
68
68
  """
@@ -210,13 +210,14 @@ class Cue(SCTE35Base):
210
210
  Cue.info_section.descriptor_loop_length,
211
211
  then call Cue._descriptor_loop
212
212
  """
213
- if len(bites) < 2:
214
- return False
215
- dll = (bites[0] << 8) | bites[1]
216
- self.info_section.descriptor_loop_length = dll
217
- bites = bites[2:]
218
- self._descriptor_loop(bites[:dll])
219
- return bites[dll:]
213
+ ## if len(bites) < 2:
214
+ ## return False
215
+ while bites:
216
+ dll = (bites[0] << 8) | bites[1]
217
+ self.info_section.descriptor_loop_length = dll
218
+ bites = bites[2:]
219
+ self._descriptor_loop(bites[:dll])
220
+ return bites[dll:]
220
221
 
221
222
  def mk_info_section(self, bites):
222
223
  """
@@ -376,10 +377,10 @@ class Cue(SCTE35Base):
376
377
  'command': {dict},
377
378
  'descriptors': [list of {dicts}],
378
379
  }
379
-
380
+
380
381
  * load doesn't need to be called directly
381
382
  unless you initialize a Cue without data.
382
-
383
+
383
384
  """
384
385
  if isinstance(gonzo, bytes):
385
386
  gonzo = gonzo.decode()
@@ -401,7 +402,7 @@ class Cue(SCTE35Base):
401
402
  self.encode()
402
403
  return self.bites
403
404
 
404
- def _from_xml(self,gonzo):
405
+ def _from_xml(self, gonzo):
405
406
  """
406
407
  _from_xml converts xml to data that can
407
408
  be loaded by a Cue instance.