threefive 3.0.89__tar.gz → 3.0.91__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 (45) hide show
  1. {threefive-3.0.89 → threefive-3.0.91}/PKG-INFO +2 -19
  2. {threefive-3.0.89 → threefive-3.0.91}/README.md +1 -18
  3. {threefive-3.0.89 → threefive-3.0.91}/pyproject.toml +1 -1
  4. {threefive-3.0.89 → threefive-3.0.91}/threefive/descriptors.py +4 -4
  5. {threefive-3.0.89 → threefive-3.0.91}/threefive/segment.py +2 -1
  6. {threefive-3.0.89 → threefive-3.0.91}/threefive/stream.py +9 -44
  7. {threefive-3.0.89 → threefive-3.0.91}/threefive/version.py +1 -1
  8. {threefive-3.0.89 → threefive-3.0.91}/threefive.egg-info/PKG-INFO +2 -19
  9. {threefive-3.0.89 → threefive-3.0.91}/LICENSE +0 -0
  10. {threefive-3.0.89 → threefive-3.0.91}/setup.cfg +0 -0
  11. {threefive-3.0.89 → threefive-3.0.91}/threefive/__init__.py +0 -0
  12. {threefive-3.0.89 → threefive-3.0.91}/threefive/aac.py +0 -0
  13. {threefive-3.0.89 → threefive-3.0.91}/threefive/base.py +0 -0
  14. {threefive-3.0.89 → threefive-3.0.91}/threefive/bitn.py +0 -0
  15. {threefive-3.0.89 → threefive-3.0.91}/threefive/bump.py +0 -0
  16. {threefive-3.0.89 → threefive-3.0.91}/threefive/cli.py +0 -0
  17. {threefive-3.0.89 → threefive-3.0.91}/threefive/commands.py +0 -0
  18. {threefive-3.0.89 → threefive-3.0.91}/threefive/crc.py +0 -0
  19. {threefive-3.0.89 → threefive-3.0.91}/threefive/crctable.py +0 -0
  20. {threefive-3.0.89 → threefive-3.0.91}/threefive/cue.py +0 -0
  21. {threefive-3.0.89 → threefive-3.0.91}/threefive/encode.py +0 -0
  22. {threefive-3.0.89 → threefive-3.0.91}/threefive/gums.py +0 -0
  23. {threefive-3.0.89 → threefive-3.0.91}/threefive/hls.py +0 -0
  24. {threefive-3.0.89 → threefive-3.0.91}/threefive/hlsprofile.py +0 -0
  25. {threefive-3.0.89 → threefive-3.0.91}/threefive/hlstags.py +0 -0
  26. {threefive-3.0.89 → threefive-3.0.91}/threefive/iframes.py +0 -0
  27. {threefive-3.0.89 → threefive-3.0.91}/threefive/new_reader.py +0 -0
  28. {threefive-3.0.89 → threefive-3.0.91}/threefive/packetdata.py +0 -0
  29. {threefive-3.0.89 → threefive-3.0.91}/threefive/pmt.py +0 -0
  30. {threefive-3.0.89 → threefive-3.0.91}/threefive/section.py +0 -0
  31. {threefive-3.0.89 → threefive-3.0.91}/threefive/segmentation.py +0 -0
  32. {threefive-3.0.89 → threefive-3.0.91}/threefive/sixfix.py +0 -0
  33. {threefive-3.0.89 → threefive-3.0.91}/threefive/speedo.py +0 -0
  34. {threefive-3.0.89 → threefive-3.0.91}/threefive/streamtypes.py +0 -0
  35. {threefive-3.0.89 → threefive-3.0.91}/threefive/stuff.py +0 -0
  36. {threefive-3.0.89 → threefive-3.0.91}/threefive/superkabuki.py +0 -0
  37. {threefive-3.0.89 → threefive-3.0.91}/threefive/throttle.py +0 -0
  38. {threefive-3.0.89 → threefive-3.0.91}/threefive/udp.py +0 -0
  39. {threefive-3.0.89 → threefive-3.0.91}/threefive/upids.py +0 -0
  40. {threefive-3.0.89 → threefive-3.0.91}/threefive/uxp.py +0 -0
  41. {threefive-3.0.89 → threefive-3.0.91}/threefive/xml.py +0 -0
  42. {threefive-3.0.89 → threefive-3.0.91}/threefive.egg-info/SOURCES.txt +0 -0
  43. {threefive-3.0.89 → threefive-3.0.91}/threefive.egg-info/dependency_links.txt +0 -0
  44. {threefive-3.0.89 → threefive-3.0.91}/threefive.egg-info/entry_points.txt +0 -0
  45. {threefive-3.0.89 → threefive-3.0.91}/threefive.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: threefive
3
- Version: 3.0.89
3
+ Version: 3.0.91
4
4
  Summary: threefive is The #1 SCTE-35 Decoder and Encoder on the Planet.
5
5
  Author-email: AdrianofDoom <spam@iodisco.com>
6
6
  License-Expression: Sleepycat
@@ -35,24 +35,7 @@ ___
35
35
  * threefive now has support for SCTE-35-2. __Event Descriptors__ and __Property__ types from __the recently published 2026 SCTE-35 Specification can be decoded, modified, and encoded with threefive.
36
36
  ___
37
37
 
38
- ## [ Latest version is v3.0.89 ]
39
- ___
40
- ## [ Examples ]
41
- * [aac_id3header.py](aac_id3header.py) - use the __threefive.aac.AacParser__ class to parse __HLS AAC__ segments for __PTS__ in __ID3 header tags__. _(__Updated__ 01/07/2026)_
42
- * [id3.aac](id3.aac) test file for __aac_id3header.py__ _(__New!__ 01/12/2026)_
43
- * [base64toxmlbin.py](base64toxmlbin.py) - __convert__ __base64__ encoded __SCTE-35__ to __xml+binary__ encoded SCTE-35 and back.
44
- * [cue2vtt.py](cue2vtt.py) - display __SCTE-35__ in __WebVTT__ subtitles to __verify__ __SCTE-35__ __splice points__.
45
- * [decodenext.py](decodenext.py) - parse __MPEGTS__ streams for __SCTE-35__ using __Stream.decode_next()__. _(__Updated__ 01/12/2026)_
46
- * [dtmf.py](dtmf.py) - parse __base64__ __SCTE-35__ with a __DTMF__ descriptor and __re-encode__ to __SCTE-35__ in __Hex__ format.
47
- * [edit_break_duration.py](edit_break_duration.py) - change the __SCTE-35__ __break duration__ and __re-encode__ __SCTE-35__.
48
- * [event_descriptors.py](event_descriptors.py) - The __Event Descriptor__ examples from the __2026 SCTE-35 part 2 specification__. _(__New!__ 05/10/2026)_
49
- * [encode_time_signal.py](encode_time_signal.py) - __encode__ a __SCTE-35__ __Cue__ with a __TimeSignal__ from scratch.
50
- * [parsehlstags.py](parsehlstags.py) - use the __TagParser__ class to parse __HLS tags__ from a __m3u8__ file and group the tags by segment.
51
- * [proxy.py](proxy.py) - how to use the __Stream.proxy()__ method for parsing __SCTE-35__ and __piping__ video.
52
- * [quickstream.py](quickstream.py) - how to __add SCTE-35 parsing__ for __MPEGTS__ streams to __your application__.
53
- * [spliceinsert.py](spliceinsert.py) - a __SCTE-35__ __Splice Insert__ example.
54
- * [upid_custom_output.py](upid_custom_output.py) - __customizing Upid data output__ for a variety of __Upids__. _(__New!__ 01/11/2026)_
55
- * [custom_upid_handling.py](custom_upid_handling.py) - Custom __user defined UPID__ handling example. _(__New!__ 01/11/2026)_
38
+ ## [ Latest version is v3.0.91 ]
56
39
  ___
57
40
 
58
41
 
@@ -16,24 +16,7 @@ ___
16
16
  * threefive now has support for SCTE-35-2. __Event Descriptors__ and __Property__ types from __the recently published 2026 SCTE-35 Specification can be decoded, modified, and encoded with threefive.
17
17
  ___
18
18
 
19
- ## [ Latest version is v3.0.89 ]
20
- ___
21
- ## [ Examples ]
22
- * [aac_id3header.py](aac_id3header.py) - use the __threefive.aac.AacParser__ class to parse __HLS AAC__ segments for __PTS__ in __ID3 header tags__. _(__Updated__ 01/07/2026)_
23
- * [id3.aac](id3.aac) test file for __aac_id3header.py__ _(__New!__ 01/12/2026)_
24
- * [base64toxmlbin.py](base64toxmlbin.py) - __convert__ __base64__ encoded __SCTE-35__ to __xml+binary__ encoded SCTE-35 and back.
25
- * [cue2vtt.py](cue2vtt.py) - display __SCTE-35__ in __WebVTT__ subtitles to __verify__ __SCTE-35__ __splice points__.
26
- * [decodenext.py](decodenext.py) - parse __MPEGTS__ streams for __SCTE-35__ using __Stream.decode_next()__. _(__Updated__ 01/12/2026)_
27
- * [dtmf.py](dtmf.py) - parse __base64__ __SCTE-35__ with a __DTMF__ descriptor and __re-encode__ to __SCTE-35__ in __Hex__ format.
28
- * [edit_break_duration.py](edit_break_duration.py) - change the __SCTE-35__ __break duration__ and __re-encode__ __SCTE-35__.
29
- * [event_descriptors.py](event_descriptors.py) - The __Event Descriptor__ examples from the __2026 SCTE-35 part 2 specification__. _(__New!__ 05/10/2026)_
30
- * [encode_time_signal.py](encode_time_signal.py) - __encode__ a __SCTE-35__ __Cue__ with a __TimeSignal__ from scratch.
31
- * [parsehlstags.py](parsehlstags.py) - use the __TagParser__ class to parse __HLS tags__ from a __m3u8__ file and group the tags by segment.
32
- * [proxy.py](proxy.py) - how to use the __Stream.proxy()__ method for parsing __SCTE-35__ and __piping__ video.
33
- * [quickstream.py](quickstream.py) - how to __add SCTE-35 parsing__ for __MPEGTS__ streams to __your application__.
34
- * [spliceinsert.py](spliceinsert.py) - a __SCTE-35__ __Splice Insert__ example.
35
- * [upid_custom_output.py](upid_custom_output.py) - __customizing Upid data output__ for a variety of __Upids__. _(__New!__ 01/11/2026)_
36
- * [custom_upid_handling.py](custom_upid_handling.py) - Custom __user defined UPID__ handling example. _(__New!__ 01/11/2026)_
19
+ ## [ Latest version is v3.0.91 ]
37
20
  ___
38
21
 
39
22
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  [project]
3
3
  name = "threefive"
4
- version = "3.0.89"
4
+ version = "3.0.91"
5
5
  authors = [
6
6
  { name="AdrianofDoom", email="spam@iodisco.com" },
7
7
  ]
@@ -626,7 +626,7 @@ class EventDescriptor(SpliceDescriptor):
626
626
  self.elapsed = None
627
627
  self.remain = None
628
628
  self.property_count = 0
629
- self.properties = []
629
+ self.property_list = []
630
630
 
631
631
  def decode(self, bitbin=None):
632
632
  """
@@ -646,7 +646,7 @@ class EventDescriptor(SpliceDescriptor):
646
646
  while pc:
647
647
  prop = Property()
648
648
  prop.decode(bitbin)
649
- self.properties.append(prop)
649
+ self.property_list.append(prop)
650
650
  pc -= 1
651
651
 
652
652
  def encode(self, nbin=None):
@@ -664,7 +664,7 @@ class EventDescriptor(SpliceDescriptor):
664
664
  nbin.add_int(elapsed, 40)
665
665
  nbin.add_int(remain, 40)
666
666
  nbin.add_int(len(self.properties), 8)
667
- for prop in self.properties:
667
+ for prop in self.property_list:
668
668
  prop.encode(nbin)
669
669
  return nbin.bites
670
670
 
@@ -683,7 +683,7 @@ class EventDescriptor(SpliceDescriptor):
683
683
  "remain": int(self.remain * 10000),
684
684
  }
685
685
  ed = Node("EventDescriptor", attrs=attrs, ns=ns)
686
- for prop in self.properties:
686
+ for prop in self.property_list:
687
687
  ed.addchild(prop.xml())
688
688
  return ed
689
689
 
@@ -112,12 +112,13 @@ class Segment(Stream):
112
112
  """
113
113
  if not self.shush:
114
114
  cue.show()
115
- self._add_cue(cue)
115
+ self._add_cue(cue.encode())
116
116
 
117
117
  def decode(self, func=None):
118
118
  """
119
119
  decode a mpegts segment.
120
120
  """
121
+ func =self.show_cue
121
122
  num_pkts = 1400
122
123
  for pkt in self.iter_pkts(num_pkts=num_pkts):
123
124
  if not pkt:
@@ -91,7 +91,11 @@ class MPStream:
91
91
  st = Stream(None)
92
92
  st.pids = pids
93
93
  st.maps = maps
94
- return [cue for cue in [st._parse(pkt) for pkt in st.packetize(chunk)] if cue]
94
+ for pkt in st.packetize(chunk):
95
+ cue = st._parse(pkt)
96
+ if cue:
97
+ yield cue
98
+ # return [cue for cue in [st._parse(pkt) for pkt in st.packetize(chunk)] if cue]
95
99
 
96
100
  def chunker(self):
97
101
  """
@@ -360,41 +364,6 @@ class Stream(Based):
360
364
  speedo.end()
361
365
  return False
362
366
 
363
- def duration(self):
364
- """
365
- duration - get duration for local video files
366
- """
367
- # prgm=1
368
- duration = 0
369
- num_pkts = 1000
370
- head, tail = 0, 0
371
-
372
- for pkt in self.iter_pkts(num_pkts=num_pkts):
373
- pid = self._parse_pid(pkt[1], pkt[2])
374
- if self._pusi_flag(pkt):
375
- self._parse_pts(pkt, pid)
376
- pts = self.pid2pts(pid)
377
- if pts:
378
- head = pts
379
- break
380
- fsize = os.stat(self.tsfile).st_size
381
- spot = self._tsdata.tell()
382
- tail_size = 188 * num_pkts
383
- if (fsize - spot) > tail_size:
384
- self._tsdata.seek(-tail_size, 2)
385
- while self._tsdata.tell() <= fsize - 188:
386
- pkt = self._tsdata.read(188)
387
- pid = self._parse_pid(pkt[1], pkt[2])
388
- if self._pusi_flag(pkt):
389
- self._parse_pts(pkt, pid)
390
- pts = self.pid2pts(pid)
391
- tail = self.pid2pts(pid)
392
- if tail < head:
393
- tail += self.ROLLOVER9K
394
- duration = self.as_hms(tail - head)
395
- print2(f"Start: {head} End: {tail} Duration: {duration}")
396
- return duration
397
-
398
367
  def mpdecode(self, func=show_cue):
399
368
  """
400
369
  mpdecode decode with multiprocessing
@@ -409,15 +378,11 @@ class Stream(Based):
409
378
  func can be set to a custom function that accepts
410
379
  a threefive.Cue instance as it's only argument.
411
380
  """
412
- if "PyPy" not in sys.version:
413
- return self.mpdecode(func=func)
414
381
  num_pkts = 2100
415
- chunksize = self.PACKET_SIZE * num_pkts
416
- while chunk := io.BufferedReader(self._tsdata, buffer_size=chunksize):
417
- while pkt := chunk.read(188):
418
- cue = self._parse(pkt)
419
- if cue:
420
- func(cue)
382
+ for pkt in self.iter_pkts(num_pkts):
383
+ cue = self._parse(pkt)
384
+ if cue:
385
+ func(cue)
421
386
  return False
422
387
 
423
388
  def decode_next(self):
@@ -5,6 +5,6 @@ from the cli tool run: threefive version
5
5
 
6
6
  MAJOR = 3
7
7
  MINOR = 0
8
- MINI = 89
8
+ MINI = 91
9
9
 
10
10
  version = f"{MAJOR}.{MINOR}.{MINI}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: threefive
3
- Version: 3.0.89
3
+ Version: 3.0.91
4
4
  Summary: threefive is The #1 SCTE-35 Decoder and Encoder on the Planet.
5
5
  Author-email: AdrianofDoom <spam@iodisco.com>
6
6
  License-Expression: Sleepycat
@@ -35,24 +35,7 @@ ___
35
35
  * threefive now has support for SCTE-35-2. __Event Descriptors__ and __Property__ types from __the recently published 2026 SCTE-35 Specification can be decoded, modified, and encoded with threefive.
36
36
  ___
37
37
 
38
- ## [ Latest version is v3.0.89 ]
39
- ___
40
- ## [ Examples ]
41
- * [aac_id3header.py](aac_id3header.py) - use the __threefive.aac.AacParser__ class to parse __HLS AAC__ segments for __PTS__ in __ID3 header tags__. _(__Updated__ 01/07/2026)_
42
- * [id3.aac](id3.aac) test file for __aac_id3header.py__ _(__New!__ 01/12/2026)_
43
- * [base64toxmlbin.py](base64toxmlbin.py) - __convert__ __base64__ encoded __SCTE-35__ to __xml+binary__ encoded SCTE-35 and back.
44
- * [cue2vtt.py](cue2vtt.py) - display __SCTE-35__ in __WebVTT__ subtitles to __verify__ __SCTE-35__ __splice points__.
45
- * [decodenext.py](decodenext.py) - parse __MPEGTS__ streams for __SCTE-35__ using __Stream.decode_next()__. _(__Updated__ 01/12/2026)_
46
- * [dtmf.py](dtmf.py) - parse __base64__ __SCTE-35__ with a __DTMF__ descriptor and __re-encode__ to __SCTE-35__ in __Hex__ format.
47
- * [edit_break_duration.py](edit_break_duration.py) - change the __SCTE-35__ __break duration__ and __re-encode__ __SCTE-35__.
48
- * [event_descriptors.py](event_descriptors.py) - The __Event Descriptor__ examples from the __2026 SCTE-35 part 2 specification__. _(__New!__ 05/10/2026)_
49
- * [encode_time_signal.py](encode_time_signal.py) - __encode__ a __SCTE-35__ __Cue__ with a __TimeSignal__ from scratch.
50
- * [parsehlstags.py](parsehlstags.py) - use the __TagParser__ class to parse __HLS tags__ from a __m3u8__ file and group the tags by segment.
51
- * [proxy.py](proxy.py) - how to use the __Stream.proxy()__ method for parsing __SCTE-35__ and __piping__ video.
52
- * [quickstream.py](quickstream.py) - how to __add SCTE-35 parsing__ for __MPEGTS__ streams to __your application__.
53
- * [spliceinsert.py](spliceinsert.py) - a __SCTE-35__ __Splice Insert__ example.
54
- * [upid_custom_output.py](upid_custom_output.py) - __customizing Upid data output__ for a variety of __Upids__. _(__New!__ 01/11/2026)_
55
- * [custom_upid_handling.py](custom_upid_handling.py) - Custom __user defined UPID__ handling example. _(__New!__ 01/11/2026)_
38
+ ## [ Latest version is v3.0.91 ]
56
39
  ___
57
40
 
58
41
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes