threefive3 3.0.23__tar.gz → 3.0.27__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 (39) hide show
  1. {threefive3-3.0.23/threefive3.egg-info → threefive3-3.0.27}/PKG-INFO +2 -2
  2. {threefive3-3.0.23 → threefive3-3.0.27}/README.md +1 -1
  3. {threefive3-3.0.23 → threefive3-3.0.27}/bin/threefive3 +17 -11
  4. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/__init__.py +3 -13
  5. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/gums.py +1 -0
  6. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/hls.py +2 -2
  7. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/iframes.py +0 -4
  8. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/new_reader.py +2 -1
  9. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/stream.py +15 -7
  10. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/version.py +2 -2
  11. {threefive3-3.0.23 → threefive3-3.0.27/threefive3.egg-info}/PKG-INFO +2 -2
  12. {threefive3-3.0.23 → threefive3-3.0.27}/LICENSE +0 -0
  13. {threefive3-3.0.23 → threefive3-3.0.27}/setup.cfg +0 -0
  14. {threefive3-3.0.23 → threefive3-3.0.27}/setup.py +0 -0
  15. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/base.py +0 -0
  16. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/bitn.py +0 -0
  17. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/commands.py +0 -0
  18. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/crc.py +0 -0
  19. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/cue.py +0 -0
  20. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/descriptors.py +0 -0
  21. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/encode.py +0 -0
  22. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/hlstags.py +0 -0
  23. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/packetdata.py +0 -0
  24. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/section.py +0 -0
  25. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/segment.py +0 -0
  26. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/segmentation.py +0 -0
  27. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/sixfix.py +0 -0
  28. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/streamtypes.py +0 -0
  29. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/stuff.py +0 -0
  30. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/superkabuki.py +0 -0
  31. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/sxp.py +0 -0
  32. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/upids.py +0 -0
  33. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/words.py +0 -0
  34. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/x2c.py +0 -0
  35. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3/xml.py +0 -0
  36. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3.egg-info/SOURCES.txt +0 -0
  37. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3.egg-info/dependency_links.txt +0 -0
  38. {threefive3-3.0.23 → threefive3-3.0.27}/threefive3.egg-info/requires.txt +0 -0
  39. {threefive3-3.0.23 → threefive3-3.0.27}/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.23
3
+ Version: 3.0.27
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
@@ -38,7 +38,7 @@ Canada has a virtual monopoly on the World's mustard seed supply and they will u
38
38
  * Automatic AES decryption for HLS.
39
39
  * All HLS SCTE-35 Tags are Supported.
40
40
 
41
- ### Latest release is v3.0.21
41
+ ### Latest release is v3.0.25
42
42
  > Stay up to date, only the latest release is supported.
43
43
  ___
44
44
  ### MPEGTS streams can be parsed for SCTE-35 with three lines of code.
@@ -17,7 +17,7 @@ Canada has a virtual monopoly on the World's mustard seed supply and they will u
17
17
  * Automatic AES decryption for HLS.
18
18
  * All HLS SCTE-35 Tags are Supported.
19
19
 
20
- ### Latest release is v3.0.21
20
+ ### Latest release is v3.0.25
21
21
  > Stay up to date, only the latest release is supported.
22
22
  ___
23
23
  ### MPEGTS streams can be parsed for SCTE-35 with three lines of code.
@@ -16,7 +16,6 @@ from threefive3 import Cue, Stream, print2, blue, version, red
16
16
  from threefive3.hls import cli as hlscli
17
17
  from threefive3.sixfix import sixfix
18
18
  import cProfile
19
-
20
19
  # from sideways import cli as sidecli
21
20
 
22
21
  REV = "\033[7;1m"
@@ -33,13 +32,12 @@ class SupaStream(Stream):
33
32
  SupaStream is subclass of Stream used
34
33
  to print raw SCTE-35 packets.
35
34
  """
36
-
37
35
  def _parse_scte35(self, pkt, pid):
38
36
  print2(pkt)
39
37
  print2("")
40
38
  super()._parse_scte35(pkt, pid)
41
39
 
42
-
40
+
43
41
  def mk_sidecar(cue):
44
42
  """
45
43
  mk_sidecar generates a sidecar file with the SCTE-35 Cues
@@ -56,7 +54,7 @@ def mk_sidecar(cue):
56
54
  HELP = f"""
57
55
  {BLUE} threefive3 cli tool {U}
58
56
 
59
- {B} Default {U} {BLUE}The default action is to read an input and write an output.{U}
57
+ {B} Default {U} {BLUE}The default action is to read a input and write a SCTE-35 output.{U}
60
58
 
61
59
  {BLUE}Inputs {U} mpegts, base64, hex, json, xml, and xmlbin{U}.
62
60
 
@@ -79,9 +77,6 @@ HELP = f"""
79
77
 
80
78
  {B} iframes {U}{BLUE} show MPEGTS iframes{NORM} threefive3 iframes video.ts
81
79
 
82
- {B} mcast {U}{BLUE} Create a Multicast Stream {NORM} threefive3 mcast -I video.ts
83
- {U}{BLUE}See mcast help {NORM} threefive3 mcast help
84
-
85
80
  {B} packets {U}{NORM}{BLUE} Print raw SCTE-35 packets:{NORM} threefive3 packets udp://@235.35.3.5:3535
86
81
 
87
82
  {B} proxy {U}{NORM}{BLUE} Parse a stream and copy it to stdout:{NORM} threefive3 proxy video.ts
@@ -328,8 +323,8 @@ def to_funk(this):
328
323
  try:
329
324
  cue.bites = cue._mk_bits(this)
330
325
  cue.decode()
331
- except Error:
332
- print2(Error)
326
+ except:
327
+ print2("Bad Data:\n")
333
328
  sys.exit()
334
329
  if cue:
335
330
  funk()(cue) # func works here too.
@@ -351,7 +346,7 @@ def chk_stdin(args):
351
346
  strm = Stream(sys.stdin.buffer)
352
347
  strm._parse(one + two) # dont drop first packet
353
348
  strm.decode(func=funk())
354
- sys.exit() # I keep forgetting why I do
349
+ sys.exit() # I keep forgetting why I do
355
350
  return args
356
351
 
357
352
 
@@ -366,7 +361,6 @@ def chk_funk_map():
366
361
  _ = [to_funk(arg) for arg in args] # multiple file input
367
362
  sys.exit()
368
363
 
369
-
370
364
  # cli map
371
365
 
372
366
  cli_map = {"mcast": gumscli, "superkabuki": skcli}
@@ -411,3 +405,15 @@ def go():
411
405
 
412
406
  if __name__ == "__main__":
413
407
  go()
408
+
409
+
410
+ def go():
411
+ if len(sys.argv) < 2:
412
+ sys.argv.append("json")
413
+ chk_print_map()
414
+ chk_mpegts_map()
415
+ chk_funk_map()
416
+
417
+
418
+ if __name__ == "__main__":
419
+ go()
@@ -2,10 +2,13 @@
2
2
  threefive3.__init__.py
3
3
  """
4
4
 
5
+ from .base import SCTE35Base
5
6
  from .cue import Cue
6
7
  from .encode import mk_splice_null, mk_time_signal, mk_splice_insert
7
8
  from .hls import HlsParser
8
9
  from .hlstags import TagParser
10
+ from .iframes import IFramer
11
+ from .new_reader import reader
9
12
  from .section import SpliceInfoSection
10
13
  from .segment import Segment
11
14
  from .stream import Stream
@@ -32,16 +35,3 @@ from .descriptors import (
32
35
  TimeDescriptor,
33
36
  descriptor_map,
34
37
  )
35
-
36
- from .upids import (
37
- Upid,
38
- NoUpid,
39
- AirId,
40
- Atsc,
41
- Eidr,
42
- Isan,
43
- Mid,
44
- Mpu,
45
- Umid,
46
- upid_map,
47
- )
@@ -57,6 +57,7 @@ class GumS:
57
57
  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
58
58
  sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
59
59
  if hasattr(socket, "SO_REUSEPORT"):
60
+ blue('setting SO_REUSEPORT')
60
61
  sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
61
62
  return sock
62
63
 
@@ -1026,8 +1026,8 @@ class HlsParser:
1026
1026
  uri = base_url + "/" + nline
1027
1027
  uri.replace("\n", "")
1028
1028
  # print(f"{REV} Rendition Found {NORM} {uri} ")
1029
- if b'RESOLUTION' not in line:
1030
- self.rendition=uri
1029
+ if b"RESOLUTION" not in line:
1030
+ self.rendition = uri
1031
1031
  return
1032
1032
  self.rendition = uri
1033
1033
 
@@ -89,10 +89,6 @@ class IFramer:
89
89
  """
90
90
  _is_key is key frame detection.
91
91
  """
92
- if b"\x00\x00\x01" in pkt:
93
- idx = pkt.index(b"\x00\x00\x01")
94
- if pkt[idx + 3 : idx + 4] in [b"\xe0", b"\xc0", b"\xbd"]:
95
- return True
96
92
  if self._nal(pkt):
97
93
  return True
98
94
  if self._afc_flag(pkt):
@@ -77,7 +77,7 @@ def lshiftbuf(socked):
77
77
  try:
78
78
  rcvbuf_size = rcvbuf_size << shift
79
79
  socked.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, rcvbuf_size)
80
- blue(f" socket.SO_RCVBUF left shifted to {rcvbuf_size}")
80
+ blue(f" socket.SO_RCVBUF set to {rcvbuf_size}")
81
81
  except:
82
82
  blue("Unable to left shift socket.SO_RCVBUF")
83
83
 
@@ -87,6 +87,7 @@ def _mk_socked():
87
87
  lshiftbuf(socked)
88
88
  socked.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
89
89
  if hasattr(socket, "SO_REUSEPORT"):
90
+ blue('setting SO_REUSEPORT')
90
91
  socked.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
91
92
  socked.settimeout(TIMEOUT)
92
93
  return socked
@@ -419,12 +419,21 @@ class Stream:
419
419
  parse pts and store by program key
420
420
  in the dict Stream._pid_pts
421
421
  """
422
- pts = self.iframer.ticks(pkt)
423
- if pts:
424
- prgm = self.pid2prgm(pid)
425
- self.maps.prgm_pts[prgm] = pts
426
- if prgm not in self.start:
427
- self.start[prgm] = pts
422
+ ## if b"\x00\x00\x01" in pkt:
423
+ ## idx = pkt.index(b"\x00\x00\x01")
424
+ ## if pkt[idx + 3 : idx + 4] in [b"\xe0", b"\xc0", b"\xbd"]:
425
+ payload = self._parse_payload(pkt)
426
+ if len(payload) > 13:
427
+ if self._pts_flag(payload):
428
+ pts = (payload[9] & 14) << 29
429
+ pts |= payload[10] << 22
430
+ pts |= (payload[11] >> 1) << 15
431
+ pts |= payload[12] << 7
432
+ pts |= payload[13] >> 1
433
+ prgm = self.pid2prgm(pid)
434
+ self.maps.prgm_pts[prgm] = pts
435
+ if prgm not in self.start:
436
+ self.start[prgm] = pts
428
437
 
429
438
  def _parse_pcr(self, pkt, pid):
430
439
  if self._afc_flag(pkt[3]):
@@ -545,7 +554,6 @@ class Stream:
545
554
  def _strip_scte35_pes(self, pkt):
546
555
  pay = self._parse_payload(pkt)
547
556
  if self.SCTE35_PES_START in pay:
548
- # print2(f"# Stripping PES Header from SCTE35 @ {self.pid2pts(pid)}")
549
557
  pay = pay.split(self.SCTE35_PES_START, 1)[-1]
550
558
  peslen = pay[4] + 5 # PES header length
551
559
  pay = pay[peslen:]
@@ -1,10 +1,10 @@
1
1
  """
2
- scte35.version
2
+ threefive3.version
3
3
  from the cli tool run: threefive3 version
4
4
  """
5
5
 
6
6
  major = 3
7
7
  minor = 0
8
- maintenance = 23
8
+ maintenance = 27
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.23
3
+ Version: 3.0.27
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
@@ -38,7 +38,7 @@ Canada has a virtual monopoly on the World's mustard seed supply and they will u
38
38
  * Automatic AES decryption for HLS.
39
39
  * All HLS SCTE-35 Tags are Supported.
40
40
 
41
- ### Latest release is v3.0.21
41
+ ### Latest release is v3.0.25
42
42
  > Stay up to date, only the latest release is supported.
43
43
  ___
44
44
  ### MPEGTS streams can be parsed for SCTE-35 with three lines of code.
File without changes
File without changes
File without changes