Metadata-Version: 2.1
Name: scte35
Version: 0.0.13
Summary: scte35 is a SCTE-35 Decoder and Encoder for MPEGTS, HLS and Everything else.
Home-page: https://github.com/superkabuki/scte35
Author: Adrian of Doom
Author-email: spam@iodisco.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: License :: OSI Approved :: Sleepycat License
Classifier: Environment :: Console
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX :: BSD :: OpenBSD
Classifier: Operating System :: POSIX :: BSD :: NetBSD
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: POSIX :: SCO
Classifier: Operating System :: Unix
Classifier: Operating System :: Microsoft :: Windows :: Windows 3.1 or Earlier
Classifier: Operating System :: Other OS
Classifier: Topic :: Multimedia :: Video
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: iframes (>=0.0.7)
Requires-Dist: m3ufu (>=0.0.89)
Requires-Dist: new-reader (>=0.1.11)
Requires-Dist: sideways (>=0.0.23)
Requires-Dist: pyaes

# `scte35`
threefive continued.  SCTE-35 for the People.

# `Install`
* python3 via pip
```py3
python3 -mpip install scte35
```
* pypy3 
```py3
pypy3 -mpip install scte35
```
* from the git repo
```js
git clone https://github.com/superkabuki/scte35.git
cd scte35
make install
```
___


# `The Cli tool`
> One thing I hate about video is all the complexity. I tried to keep the cli as simple as possible.
> Let me show you how it works.

## `Decoding SCTE-35` 
* the cli can __decode SCTE-35__ from __MPEGTS Streams, Base64, Hex, HLS, JSON, Xml, and Xml+Bin__ formats.
* Most __input__ formats are __auto-detected__ 

### `Base64` 

```asm
scte35 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='
```

### `Hex`

```smalltalk
scte35 '0xfc302c00000003289800fff00a05000000017f5f999901010011020f43554549000000007f8001003500002d974195'
```

### `HLS`

```lua
scte35 hls https://example.com/master.m3u8
```

### `Json`

```lua
cat json.json | scte35
```
### `Xml`

```lua
scte35  < xml.xml
```
### `Xml+bin`

```lua
scte35 < xmlbin.xml
```
___
## `Output`

* Base64, Bytes, Hex, Json, Int, Xml, or Xml+bin can be specified as output.
* default output is `json`
```json
{
    "info_section": {
        "table_id": "0xfc",
        "section_syntax_indicator": false,
        "private": false,
        "sap_type": "0x03",
        "sap_details": "No Sap Type",
        "section_length": 44,
        "protocol_version": 0,
        "encrypted_packet": false,
        "encryption_algorithm": 0,
        "pts_adjustment": 2.3,
        "cw_index": "0x00",
        "tier": "0x0fff",
        "splice_command_length": 10,
        "splice_command_type": 5,
        "descriptor_loop_length": 17,
        "crc": "0x2d974195"
  ...

```

### `base64`
```lua
scte35 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' base64
```
* _output_
```lua
/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=
```
### `bytes`
```lua
scte35 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' bytes
```
* _output_
```lua
b'\xfc0,\x00\x00\x00\x03(\x98\x00\xff\xf0\n\x05\x00\x00\x00\x01\x7f_\x99\x99\x01\x01\x00\x11\x02\x0fCUEI\x00\x00\x00\x00\x7f\x80\x01\x005\x00\x00-\x97A\x95'
```
### `hex`
```lua
scte35 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' hex
```
* _output_
```lua
0xfc302c00000003289800fff00a05000000017f5f999901010011020f43554549000000007f8001003500002d974195
```
### `int`
```lua
scte35 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' int
```
* _output_
```lua
151622312799635094191794191736756941723013293850254190245706580675544251579467254651746556435953373552591284683157
```
### `xml`
```lua
scte35 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' xml
```
* _output_
```xml
<scte35:SpliceInfoSection xmlns:scte35="https://scte.org/schemas/35"  ptsAdjustment="207000" protocolVersion="0" sapType="3" tier="4095">
   <scte35:SpliceInsert spliceEventId="1" spliceEventCancelIndicator="false" spliceImmediateFlag="true" eventIdComplianceFlag="true" availNum="1" availsExpected="1" outOfNetworkIndicator="false" uniqueProgramId="39321"/>
   <!-- Provider Placement Opportunity End -->
   <scte35:SegmentationDescriptor segmentationEventId="0" segmentationEventCancelIndicator="false" segmentationEventIdComplianceIndicator="true" segmentationTypeId="53" segmentNum="0" segmentsExpected="0">
      <scte35:DeliveryRestrictions webDeliveryAllowedFlag="false" noRegionalBlackoutFlag="false" archiveAllowedFlag="false" deviceRestrictions="0"/>
      <!-- Type 0x01 is deprecated. Use type 0x0C, MPU. -->
      <scte35:SegmentationUpid segmentationUpidType="1" segmentationUpidFormat="hexbinary"/>
   </scte35:SegmentationDescriptor>
</scte35:SpliceInfoSection>
```
### `xml+bin`
```xml
scte35 '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=' xmlbin
```
* _output_
```xml
<scte35:Signal xmlns:scte35="https://scte.org/schemas/35">
   <scte35:Binary>/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU=</scte35:Binary>
</scte35:Signal>
```
___

## `File and Network Protocols`

### `File`

```lua
scte35 video.ts
```

### `Http(s)`

```lua
scte35 https://example.com/master.m3u8
```

### `Multicast`

```lua
scte35 udp://@235.35.3.5:9999
```

### `stdin`

```lua
cat video.ts | scte35
```

### `Udp Unicast`

```lua
scte35 udp://10.0.0.7:5555
```
___
## `hls`
```lua
scte35 hls https://example.com/master.m3u8
```
___
## `packets`     
* Print raw SCTE-35 packets from multicast mpegts video
```lua
scte35 packets udp://@235.35.3.5:3535
```
___
## `proxy`       
* Parse a https stream and write raw video to stdout
```lua
scte35 proxy video.ts
```
___
## `pts`         
* Print PTS from mpegts video
```lua
 scte35 pts video.ts
```
___
## `sidecar`     
* Parse a stream, write pts,write SCTE-35 Cues to sidecar.txt
```lua
  scte35 sidecar video.ts
```
___
## `sixfix`      
* Fix SCTE-35 data mangled by ffmpeg
```lua
 scte35 sixfix video.ts
```
___
## `show`        
* Probe mpegts video _( kind of like ffprobe )_
```lua
 scte35 show video.ts
```
___
## `version`     
* Show version
```lua
 scte35 version
```
___
## `help`        
* Help
```lua
 scte35 help
```
___




