{"id":35820064,"url":"https://github.com/superkabuki/threefive_is_scte35","last_synced_at":"2026-02-03T06:04:56.745Z","repository":{"id":282379422,"uuid":"948390549","full_name":"superkabuki/threefive_is_scte35","owner":"superkabuki","description":"threefive is the most advanced, and complete SCTE-35 tool and python3 library available. ","archived":false,"fork":false,"pushed_at":"2025-12-30T01:39:17.000Z","size":1102,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-30T15:56:48.607Z","etag":null,"topics":["adbreak","adrianofdoom","adtech","fu-based-technology","hls-live-streaming","hls-scte35","mpegts","python3","scte-214","scte-35","scte-35-hls","scte35","splice-fu","threefive","udp4life","video","video-streaming"],"latest_commit_sha":null,"homepage":"https://iodisco.com/scte35","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/superkabuki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-14T08:55:42.000Z","updated_at":"2025-12-30T01:39:20.000Z","dependencies_parsed_at":"2025-03-14T10:21:49.115Z","dependency_job_id":"40b8fe93-ab6d-4920-8303-ee95cefd7f7a","html_url":"https://github.com/superkabuki/threefive_is_scte35","commit_stats":null,"previous_names":["superkabuki/threefive3","superkabuki/scte-35","superkabuki/scte-35_threefive3","superkabuki/threefive","superkabuki/scte35_threefive","superkabuki/scte35","superkabuki/threefive_is_scte35","superkabuki/scte35-kabuki"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/superkabuki/threefive_is_scte35","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2Fthreefive_is_scte35","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2Fthreefive_is_scte35/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2Fthreefive_is_scte35/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2Fthreefive_is_scte35/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superkabuki","download_url":"https://codeload.github.com/superkabuki/threefive_is_scte35/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2Fthreefive_is_scte35/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adbreak","adrianofdoom","adtech","fu-based-technology","hls-live-streaming","hls-scte35","mpegts","python3","scte-214","scte-35","scte-35-hls","scte35","splice-fu","threefive","udp4life","video","video-streaming"],"created_at":"2026-01-07T18:00:32.916Z","updated_at":"2026-02-03T06:04:56.738Z","avatar_url":"https://github.com/superkabuki.png","language":"Python","funding_links":[],"categories":["SCTE-35 \u0026 SCTE-104"],"sub_categories":[],"readme":"# [ threefive ]\n## https://github.com/superkabuki/threefive\n\n### __threefive__ is the industry leading SCTE-35 tool. \n\n___\n\n### [ Terms and Conditions ]\n*    __You be cool, and I'll be cool.__\n*    __Questions?__ Ask them. \n*    __Features?__ Speak up. I'm open to new ideas..\n*    __Comments?__ Make them. \n*    __Got Code?__ Do a pull request.\n___\n### [ News ]\n* __Python3 vs. Pypy3__ [__parsing SCTE35 with threefive__](https://github.com/superkabuki/threefive_is_scte35#python3-vs-pypy3-running-threefive) (watch the cool video)\n \n* __threefive now supports__ [__Secure Reliable Transport__](https://github.com/superkabuki/threefive_is_scte35/blob/main/README.md#threefive-now-supports-srt)\n\n___\n\n### [ Latest version is  v3.0.71 ]\n* [why can`t you be more cyclomatic like your brother?](cyclomatic.md)\n* All ansi color codes striped when output is not a tty.\n*  __threefive.Cue.xmlbin()__ now returns a __threefive.xml.Node instance like__ __threefive.Cue.xml()__. \n* __threefive.Stream__ has a new method __threefive.Stream.rt(func=show_cue)__  that parses SCTE-35 and proxies the stream to stdout at realtime speed.\n* \u003cs\u003e__threefive.Stream.decode()__ now shows parse speed.\u003c/s\u003e\n* __Cli tool__ new features\n\t* __New  __bump__ keyword to adjust SCTE-35 PTS. Supports positive and negative adjustments.\n    * New __rt__  keyword parses SCTE-35, writes a SCTE-35 sidecar file, and outputs the MPEGTS stream to stdout at realtime speed.   \n\t*  \u003cs\u003eAll __MPEGTS__ related tasks show parsing speed.\u003c/s\u003e\n\t* __threefive mcast__ now throttles Multicast output to realtime speed.\n    * __threefive packets__ and __threefive pts__ now works with __SRT__.\n\n___\n\n### [ Features ]\n\n\u003csamp\u003e\n\n* __Decode SCTE-35__ from MPEGTS ✔ Base64 ✔ Bytes ✔ DASH ✔ Hex ✔ HLS ✔ Integers ✔ JSON ✔ XML  ✔ XML+Binary ✔ DASH ✔ Dicts ✔  \n\n* __Encodes SCTE-35__ to MPEGTS ✔ Base64 ✔ Bytes ✔ Hex ✔ Integers ✔ JSON ✔ XML ✔ XML+Binary ✔\n\n* __threefive file protocols__ Pipes(stdin, stdout) ✔ Files ✔\n\n* __threefive network protocols__ HTTP(s) ✔ Multicast ✔ UDP ✔ SRT ✔ \n\n* __Automatic AES decryption__ for __MPEGTS__ and __HLS__. ✔\n\n* __Built-in Multicast Sender__ and __Receiver__. ✔\n\n* __Injects SCTE-35 Packets__ into __MPEGTS__ video ✔.\n\n___\n\n###  [ Tip Of The Week ]\n\n*  __Stream.decode_next()__ is now a generator\n\n```py3\n\tfrom threefive import Stream\n\n    strm =Stream(some_url)\n    for cue in strm.decode_next():\n\t\tyour_complicated_function(cue, one_arg , two_arg, 13,)\n```        \n\n___\n\n# [ Documentation ]\n\t\n* [__Install__](#install) \n* [SCTE-35 Decoding __Quick Start__ ](#quick-start) _threefive makes decoding SCTE-35 fast and easy_\n* [SCTE-35 __Examples__](https://github.com/superkabuki/threefive/tree/main/examples) _examples of all kinds of SCTE-35 stuff_\n* [SCTE-35 __Cli__](#-the-cli-tool-) _decode SCTE-35 on the command line_\n* [__Using the threefive library__](#using-the-library) _decode SCTE-35 with less than ten lines of code_\n\t* [__Using the threefive.Cue class__](https://github.com/superkabuki/threefive/blob/main/lib.md) \n* [SCTE-35 __HLS__](https://github.com/superkabuki/threefive/blob/main/hls.md) _parse SCTE-35 in HLS__\n* [SCTE-35 __XML__ ](https://github.com/superkabuki/SCTE-35/blob/main/xml.md) and [More __XML__](node.md) _threefive can parse and encode SCTE-35 xml_\n* [__Encode__ SCTE-35](https://github.com/superkabuki/threefive/blob/main/encode.md) _threefive can encode SCTE-35 in every SCTE-35 format_\n* [SCTE-35 __Sidecar Files__](https://github.com/superkabuki/SCTE-35_Sidecar_Files) _threefive supports SCTE-35 sidecar files_\n* [__SuperKabuki__ SCTE-35 MPEGTS __Packet Injection__](inject.md) _inject SCTE-35 into MPEGTS streams_ \n* [threefive __Classes__](#classes) _threefive is OO, made to subclass_\n\t* [__Cue__ Class](https://github.com/superkabuki/threefive/blob/main/cue.md) _this class you'll use often_ \n\t* [__Stream__ Class](https://github.com/superkabuki/threefive/blob/main/stream.md) _this is the class for parsing MPEGTS_\n* [Use threefive to stream __Multicast__](#-threefive-streams-multicast-its-easy-) _threefive is a multicast client and server_\n* [threefive SCTE-35 __Online Parser__](https://iodisco.com/scte35) hosted on my server_\n* [ SCTE-35 __Online Parser__ powered by threefive](http://www.domus1938.com/scte35parser) _another online parser powered by threefive_\n* [SCTE-35 __As a Service__](sassy.md) _if you can make an http request, you can parse SCTE-35, no install needed._\n* [Make your __threefive__ script an executable with __cython__](cython.md) _threefive is compatible with all python tools_\n\u003c/samp\u003e\n\n\n##  [Install]\n* python3 via pip\n```rebol\npython3 -mpip install threefive\n```\n* pypy3 \n```rebol\npypy3 -mpip install threefive\n```\n* from the git repo\n```rebol\ngit clone https://github.com/superkabuki/scte35.git\ncd threefive\nmake install\n```\n___\n\n\n## [Quick Start] \n\n\n* Most of the stuff in threefive all works the same way.\n\n### [cli tool]\n\n* The default action is to read a input and write a SCTE-35 output.\n\n  *  __Inputs:__  mpegts, base64, hex, json,and xml, and xmlbin.\n\n  *  __Outputs:__ base64, bytes, hex, int, json, xml, and xmlbin.\n\n  *  __Sources:__ SCTE35 can read from  strings, files, stdin, http(s), multicast,srt and udp.\n\n|Input     |Output     | How to use                                              |\n|----------|-----------|---------------------------------------------------------|\n|__mpegts__|__base64__ | threefive https://example.com/video.ts  __base64__      |\n|          |           |                                                         |\n|__base64__|__hex__    | threefive '/DAWAAAAAAAAAP/wBQb+AKmKxwAACzuu2Q==' __hex__|\n|          |           |                               |                     |\n|__xmlbin__|__int__    | threefive   \u003c xmlbin.xml __int__                        |\n|          |           |                                                         |\n|__xml__   |__json__   | threefive   \u003c xml.xml                                   |\n|          |           |                                                         |\n|__mpegts__|__xml+bin__| threefive video.ts __xmlbin__                           |\n|          |   |   |                                                     |\n|__json__  |__xml__    | threefive  \u003c json.json  __xml__                         |\n|          |           |                                                         |\n\n\n* __Additional functionality__ in the threefive cli tool.\n\n| Description                              | How To Use                                       |\n|------------------------------------------|---------------------------------------------------------|\n| Adjust __SCTE-35__ PTS values by seconds  | threefive __bump__ -i input.ts -o output.ts -b -37.45   |\n|\t\t\t\t\t\t\t\t\t\t\t|\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n| Parse HLS for __SCTE35__                 |threefive __hls__ https://example.com/master.m3u8        |\n|                                          |                                                         |\n| Inject __SCTE35__ packets                |threefive __inject__ -i in.video -s sidecar.txt -o out.ts|\n|                                          |                                                         |\n| Show raw __SCTE35__ packets              |threefive __packets__ udp://@235.35.3.5:3535             |\n|\t\t\t\t\t\t\t\t\t\t\t|\t\t\t\t\t\t\t\t\t\t\t\t\t\t| \n| Copy MPEGTS stream to stdout at realtime speed| threefive __rt__ input.ts | mplayer -\t\t\t\t|\n|                                          |                                                         |\n| Create __SCTE35__ sidecar file           |threefive __sidecar__ video.ts                           |\n|                                          |                                                         |\n|Fix __SCTE-35__ data mangled by __ffmpeg__| threefive __sixfix__ video.ts                           |\n|                                          |                                                         |\n| Show streams in mpegts stream            | threefive __show__ https://example.com/video.ts         |\n|                                          |                                                         |\n| Show __iframes__ in mpegts stream        |threefive __iframes__ srt://10.10.1.3:9000               |\n|                                          |                                                         |\n| Show __PTS__ values from mpegts stream   | threefive __pts__ udp://192.168.1.10:9000               |\n|                                          |                                                         |\n|__Proxy__ the __mpegts__ stream to stdout |threefive __proxy__ https://wexample.com/video.ts        |\n|                                          |                                                         |\n| __Multicast__ anything                   |threefive __mcast__ some.file                            |\n|                                          |                                                         |\n\n___\n\n##  [Examples]\n\n \u003cdetails\u003e\u003csummary\u003e\n\n### mpegts \n\n \u003c/summary\u003e\n \n* MPEGTS streams can be  Files, Http(s), Multicast,SRT, UDP Unicast, or  stdin. \n\n* __cli__\n```js\nthreefive https://example.com/video.ts\n```\n* wildcards work too.\n```js\nthreefive /mpegts/*.ts\n```\n\n* __lib__\n```py3\n\nfrom threefive import Stream\nstream = Stream('https://example.com/video.ts')\nstream.decode()\n\n```\n\n\u003c/details\u003e\n\n\n\n\u003cdetails\u003e\u003csummary\u003e\n\n### Base64\n\n\u003c/summary\u003e\n\n* __cli__\n```js\nthreefive '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='\n```\n* __lib__\n```py3\n\nfrom threefive import Cue\ndata = '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='\ncue=Cue(data)\ncue.show()\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\u003csummary\u003e\n\n### Bytes\n\n\u003c/summary\u003e\n\n* __cli__\n\t* Bytes don't work on the cli\n\n* __lib__\n```py3\n\nfrom threefive import Cue\ndata =  b'\\xfc0\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xf0\\x05\\x06\\xfe\\x00\\xc0D\\xa0\\x00\\x00\\x00\\xb5k\\x88'\ncue=Cue(data)\ncue.show()\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\u003csummary\u003e\n\t\n### Hex\n\n\u003c/summary\u003e\n\n* Can be a hex literal or hex string or bytes.\n\n* __cli__\n```js\nthreefive  0xfc301600000000000000fff00506fed605225b0000b0b65f3b\n```\n* __lib__\n```py3\n\nfrom threefive import Cue\ndata =  0xfc301600000000000000fff00506fed605225b0000b0b65f3b\ncue=Cue(data)\ncue.show()\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\u003csummary\u003e\n\t\n### Int\n\n\u003c/summary\u003e\n\n* Can be a literal integer or string or bytes.\n\n* __cli__\n```js\nthreefive  1583008701074197245727019716796221243043855984942057168199483\n```\n* __lib__\n```py3\n\nfrom threefive import Cue\ndata =  1583008701074197245727019716796221243043855984942057168199483\ncue=Cue(data)\ncue.show()\n```\n\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\u003csummary\u003e\n\t\n### JSON\n\n\u003c/summary\u003e\n\n* __cli__\n\t* \tput JSON SCTE-35 in a file and redirect it into threefive \n```js\nthreefive  \u003c json.json\n```\n* __lib__\n\n```py3\n\n from threefive import Cue\n data = '''{\n    \"info_section\": {\n        \"table_id\": \"0xfc\",\n        \"section_syntax_indicator\": false,\n        \"private\": false,\n        \"sap_type\": \"0x03\",\n        \"sap_details\": \"No Sap Type\",\n        \"section_length\": 22,\n        \"protocol_version\": 0,\n        \"encrypted_packet\": false,\n        \"encryption_algorithm\": 0,\n        \"pts_adjustment\": 0.0,\n        \"cw_index\": \"0x00\",\n        \"tier\": \"0x0fff\",\n        \"splice_command_length\": 5,\n        \"splice_command_type\": 6,\n        \"descriptor_loop_length\": 0,\n        \"crc\": \"0xb56b88\"\n    },\n    \"command\": {\n        \"command_length\": 5,\n        \"command_type\": 6,\n        \"name\": \"Time Signal\",\n        \"time_specified_flag\": true,\n        \"pts_time\": 140.005333\n    },\n    \"descriptors\": []\n}\n'''\ncue=Cue(data)\ncue.show()\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\u003csummary\u003e\u003cu\u003e\n\n### Xml\n\n\u003c/u\u003e\n\u003c/summary\u003e\n\n* __cli__\n\t* put xml SCTE-35 in a [file](xml.xml) and redirect it into threefive \n\t```js\n\tthreefive \u003c xml.xml\n\t```\n* __lib__\n```py3\nfrom threefive import Cue\ndata =  '''\n\u003cscte35:SpliceInfoSection xmlns:scte35=\"https://scte.org/schemas/35\" \n        ptsAdjustment=\"0\" protocolVersion=\"0\" sapType=\"3\" tier=\"4095\"\u003e\n   \u003cscte35:TimeSignal\u003e\n      \u003cscte35:SpliceTime ptsTime=\"12600480\"/\u003e\n   \u003c/scte35:TimeSignal\u003e\n\u003c/scte35:SpliceInfoSection\u003e\n'''\ncue=Cue(data)\n\ncue.show()\n```\n\n\n\u003c/details\u003e\n\n\n\n\u003cdetails\u003e\u003csummary\u003e\n\t\n### Xml+binary\n\n\u003c/summary\u003e\n\n* __cli__\n\t* write xml+binary to a [file](xmlbin.xml) and redirect it to threefive\n```js\nthreefive \u003c xmlbin.xml\n```\n* __lib__\n```py3\n\nfrom threefive import Cue\ndata = '''\u003cscte35:Signal xmlns:scte35=\"https://scte.org/schemas/35\"\u003e\n    \u003cscte35:Binary\u003e/DAWAAAAAAAAAP/wBQb+AMBEoAAAALVriA==\u003c/scte35:Binary\u003e\n\u003c/scte35:Signal\u003e\n'''\ncue=Cue(data)\ncue.show()\n```\n\n\u003c/details\u003e\n\n\u003c/samp\u003e\n\n##  [__More Examples__](https://github.com/superkabuki/threefive/tree/main/examples)\n\n## [XML]\n* [XML](https://github.com/superkabuki/SCTE-35/blob/main/xml.md) __New__! _updated 05/01/2025_\n## [Cli]\n* [SCTE-35 Cli Super Tool](#the-cli-tool) Encodes, Decodes, and Recodes. This is pretty cool, it does SCTE-35 seven different ways.\n     * The cli tool comes with builtin documentation just type `threefive help`\n## [HLS]\n* [Advanced Parsing of SCTE-35 in HLS with threefive](https://github.com/superkabuki/threefive/blob/main/hls.md) All HLS SCTE-35 tags, Sidecar Files, AAC ID3 Header Timestamps, SCTE-35 filters... Who loves you baby?\n\n##  [MPEGTS Packet Injection]\n* [The SuperKabuki MPEGTS Packet Injection Engine in the Cli](inject.md)\n\n##  [SCTE-35 As a Service]\n* Decode SCTE-35 without installing anything. If you can make an https request, you can use [__Sassy__](sassy.md) to decode SCTE-35. . \n\n##  [Classes]\n* The python built in help is always the most up to date docs for the library.\n\n```py3\n\na@fu:~/build7/threefive$ pypy3\n\n\u003e\u003e\u003e\u003e from threefive import Stream\n\u003e\u003e\u003e\u003e help(Stream)\n\n```\n\n* [Class Structure](https://github.com/superkabuki/threefive/blob/main/classes.md)\n* [Cue Class](https://github.com/superkabuki/threefive/blob/main/cue.md)  Cue is the main SCTE-35 class to use. \n* [Stream Class](https://github.com/superkabuki/threefive/blob/main/stream.md)  The Stream class handles MPEGTS SCTE-35 streams local, Http(s), UDP, and Multicast.\n\n___\n\n### [threefive now supports SRT]\n\n* _( You have to unmute the audio )_\n\nhttps://github.com/user-attachments/assets/a323ea90-867f-480f-a55f-e9339263e511\n\n\u003cBR\u003e \n\n* [more SRT and threefive info](srt.md)\n\n\n* _checkout [SRTfu](https://github.com/superkabuki/srtfu)_\n\n___\n\n## [more]\n\n* [Online SCTE-35 Parser](https://iodisco.com/scte35)  Supporte Base64, Bytes,Hex,Int, Json, Xml, and Xml+binary.\n\n* [Encode SCTE-35](https://github.com/superkabuki/threefive/blob/main/encode.md) Some encoding code examples. \n___\n\n\n## __Python3 vs Pypy3 running threefive__\n\n* __( You have to unmute the audio )__\n\nhttps://github.com/user-attachments/assets/9e88fb38-6ad0-487a-a801-90faba9d72c6\n\n\n\n___\n\n# Using the library\n* Let me show you how easy threefive is to use.\n\n* reading SCTE-35 xml from a file\n```py3\na@fu:~/threefive$ pypy3\nPython 3.9.16 (7.3.11+dfsg-2+deb12u3, Dec 30 2024, 22:36:23)\n[PyPy 7.3.11 with GCC 12.2.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e\u003e from threefive import reader\n\u003e\u003e\u003e\u003e from threefive import Cue\n\u003e\u003e\u003e\u003e data =reader('/home/a/xml.xml').read()\n```\n* load it into a threefive.Cue instance\n```py3\n\u003e\u003e\u003e\u003e cue = Cue(data)\n```\n* Show the data as JSON\n```py3\n\u003e\u003e\u003e\u003e cue.show()\n{\n    \"info_section\": {\n        \"table_id\": \"0xfc\",\n        \"section_syntax_indicator\": false,\n        \"private\": false,\n        \"sap_type\": \"0x03\",\n        \"sap_details\": \"No Sap Type\",\n        \"section_length\": 92,\n        \"protocol_version\": 0,\n        \"encrypted_packet\": false,\n        \"encryption_algorithm\": 0,\n        \"pts_adjustment\": 0.0,\n        \"cw_index\": \"0x00\",\n        \"tier\": \"0x0fff\",\n        \"splice_command_length\": 15,\n        \"splice_command_type\": 5,\n        \"descriptor_loop_length\": 60,\n        \"crc\": \"0x7632935\"\n    },\n    \"command\": {\n        \"command_length\": 15,\n        \"command_type\": 5,\n        \"name\": \"Splice Insert\",\n        \"break_auto_return\": false,\n        \"break_duration\": 180.0,\n        \"splice_event_id\": 1073743095,\n        \"splice_event_cancel_indicator\": false,\n        \"out_of_network_indicator\": true,\n        \"program_splice_flag\": false,\n        \"duration_flag\": true,\n        \"splice_immediate_flag\": false,\n        \"event_id_compliance_flag\": true,\n        \"unique_program_id\": 1,\n        \"avail_num\": 12,\n        \"avails_expected\": 5\n    },\n    \"descriptors\": [\n        {\n            \"tag\": 0,\n            \"identifier\": \"CUEI\",\n            \"name\": \"Avail Descriptor\",\n            \"provider_avail_id\": 12,\n            \"descriptor_length\": 8\n        },\n        {\n            \"tag\": 0,\n            \"identifier\": \"CUEI\",\n            \"name\": \"Avail Descriptor\",\n            \"provider_avail_id\": 13,\n            \"descriptor_length\": 8\n        },\n      \n\n    ]\n}\n```\n* convert the data back to xml\n```py3\n\u003e\u003e\u003e\u003e print(cue.xml())\n\u003cscte35:SpliceInfoSection xmlns:scte35=\"https://scte.org/schemas/35\"  ptsAdjustment=\"0\" protocolVersion=\"0\" sapType=\"3\" tier=\"4095\"\u003e\n   \u003cscte35:SpliceInsert spliceEventId=\"1073743095\" spliceEventCancelIndicator=\"false\" spliceImmediateFlag=\"false\" eventIdComplianceFlag=\"true\" availNum=\"12\" availsExpected=\"5\" outOfNetworkIndicator=\"true\" uniqueProgramId=\"1\"\u003e\n      \u003cscte35:BreakDuration autoReturn=\"false\" duration=\"16200000\"/\u003e\n   \u003c/scte35:SpliceInsert\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"12\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"13\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"14\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"15\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"16\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"17\"/\u003e\n\u003c/scte35:SpliceInfoSection\u003e\n```\n* convert to xml+binary\n```py3\n\u003e\u003e\u003e\u003e print(cue.xmlbin())\n\u003cscte35:Signal xmlns:scte35=\"https://scte.org/schemas/35\"\u003e\n    \u003cscte35:Binary\u003e/DBcAAAAAAAAAP/wDwVAAAT3f69+APcxQAABDAUAPAAIQ1VFSQAAAAwACENVRUkAAAANAAhDVUVJAAAADgAIQ1VFSQAAAA8ACENVRUkAAAAQAAhDVUVJAAAAEQdjKTU=\u003c/scte35:Binary\u003e\n\u003c/scte35:Signal\u003e\n```\n* convert to base64\n```py3\n\u003e\u003e\u003e\u003e print(cue.base64())\n/DBcAAAAAAAAAP/wDwVAAAT3f69+APcxQAABDAUAPAAIQ1VFSQAAAAwACENVRUkAAAANAAhDVUVJAAAADgAIQ1VFSQAAAA8ACENVRUkAAAAQAAhDVUVJAAAAEQdjKTU=\n```\n* convert to hex\n```py3\n\u003e\u003e\u003e\u003e print(cue.hex())\n0xfc305c00000000000000fff00f05400004f77faf7e00f7314000010c05003c0008435545490000000c0008435545490000000d0008435545490000000e0008435545490000000f000843554549000000100008435545490000001107632935\n```\n* show just the splice command\n```py3\n\u003e\u003e\u003e\u003e cue.command.show()\n{\n    \"command_length\": 15,\n    \"command_type\": 5,\n    \"name\": \"Splice Insert\",\n    \"break_auto_return\": false,\n    \"break_duration\": 180.0,\n    \"splice_event_id\": 1073743095,\n    \"splice_event_cancel_indicator\": false,\n    \"out_of_network_indicator\": true,\n    \"program_splice_flag\": false,\n    \"duration_flag\": true,\n    \"splice_immediate_flag\": false,\n    \"event_id_compliance_flag\": true,\n    \"unique_program_id\": 1,\n    \"avail_num\": 12,\n    \"avails_expected\": 5\n}\n```\n* edit the break duration\n```py3\n\u003e\u003e\u003e\u003e cue.command.break_duration=30\n\u003e\u003e\u003e\u003e cue.command.show()\n{\n    \"command_length\": 15,\n    \"command_type\": 5,\n    \"name\": \"Splice Insert\",\n    \"break_auto_return\": false,\n    \"break_duration\": 30,\n    \"splice_event_id\": 1073743095,\n    \"splice_event_cancel_indicator\": false,\n    \"out_of_network_indicator\": true,\n    \"program_splice_flag\": false,\n    \"duration_flag\": true,\n    \"splice_immediate_flag\": false,\n    \"event_id_compliance_flag\": true,\n    \"unique_program_id\": 1,\n    \"avail_num\": 12,\n    \"avails_expected\": 5\n}\n```\n\n* re-encode to base64 with the new duration\n```py3\n\u003e\u003e\u003e\u003e cue.base64()\n'/DBcAAAAAAAAAP/wDwVAAAT3f69+ACky4AABDAUAPAAIQ1VFSQAAAAwACENVRUkAAAANAAhDVUVJAAAADgAIQ1VFSQAAAA8ACENVRUkAAAAQAAhDVUVJAAAAEe1FB6g='\n```\n* re-encode to xml with the new duration\n```py3\n\u003e\u003e\u003e\u003e print(cue.xml())\n\u003cscte35:SpliceInfoSection xmlns:scte35=\"https://scte.org/schemas/35\"  ptsAdjustment=\"0\" protocolVersion=\"0\" sapType=\"3\" tier=\"4095\"\u003e\n   \u003cscte35:SpliceInsert spliceEventId=\"1073743095\" spliceEventCancelIndicator=\"false\" spliceImmediateFlag=\"false\" eventIdComplianceFlag=\"true\" availNum=\"12\" availsExpected=\"5\" outOfNetworkIndicator=\"true\" uniqueProgramId=\"1\"\u003e\n      \u003cscte35:BreakDuration autoReturn=\"false\" duration=\"2700000\"/\u003e\n   \u003c/scte35:SpliceInsert\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"12\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"13\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"14\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"15\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"16\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"17\"/\u003e\n\u003c/scte35:SpliceInfoSection\u003e\n```\n* show just the descriptors\n```py3\n\u003e\u003e\u003e\u003e _ = [d.show() for d in cue.descriptors]\n{\n    \"tag\": 0,\n    \"identifier\": \"CUEI\",\n    \"name\": \"Avail Descriptor\",\n    \"provider_avail_id\": 12,\n    \"descriptor_length\": 8\n}\n{\n    \"tag\": 0,\n    \"identifier\": \"CUEI\",\n    \"name\": \"Avail Descriptor\",\n    \"provider_avail_id\": 13,\n    \"descriptor_length\": 8\n}\n{\n    \"tag\": 0,\n    \"identifier\": \"CUEI\",\n    \"name\": \"Avail Descriptor\",\n    \"provider_avail_id\": 14,\n    \"descriptor_length\": 8\n}\n{\n    \"tag\": 0,\n    \"identifier\": \"CUEI\",\n    \"name\": \"Avail Descriptor\",\n    \"provider_avail_id\": 15,\n    \"descriptor_length\": 8\n}\n{\n    \"tag\": 0,\n    \"identifier\": \"CUEI\",\n    \"name\": \"Avail Descriptor\",\n    \"provider_avail_id\": 16,\n    \"descriptor_length\": 8\n}\n{\n    \"tag\": 0,\n    \"identifier\": \"CUEI\",\n    \"name\": \"Avail Descriptor\",\n    \"provider_avail_id\": 17,\n    \"descriptor_length\": 8\n}\n```\n* pop off the last descriptor and re-encode to xml\n```py3\n\n\u003e\u003e\u003e\u003e cue.descriptors.pop()\n{'tag': 0, 'identifier': 'CUEI', 'name': 'Avail Descriptor', 'private_data': None, 'provider_avail_id': 17, 'descriptor_length': 8}\n\u003e\u003e\u003e\u003e print(cue.xml())\n\u003cscte35:SpliceInfoSection xmlns:scte35=\"https://scte.org/schemas/35\"  ptsAdjustment=\"0\" protocolVersion=\"0\" sapType=\"3\" tier=\"4095\"\u003e\n   \u003cscte35:SpliceInsert spliceEventId=\"1073743095\" spliceEventCancelIndicator=\"false\" spliceImmediateFlag=\"false\" eventIdComplianceFlag=\"true\" availNum=\"12\" availsExpected=\"5\" outOfNetworkIndicator=\"true\" uniqueProgramId=\"1\"\u003e\n      \u003cscte35:BreakDuration autoReturn=\"false\" duration=\"2700000\"/\u003e\n   \u003c/scte35:SpliceInsert\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"12\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"13\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"14\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"15\"/\u003e\n   \u003cscte35:AvailDescriptor providerAvailId=\"16\"/\u003e\n\u003c/scte35:SpliceInfoSection\u003e\n```\n\n\n## [ The Cli tool ]\n\n#### The cli tool installs automatically with pip or the Makefile.\n\n* [__SCTE-35 Inputs__](#inputs)\n* [__SCTE-35 Outputs__](#outputs)\n* [Parse __MPEGTS__ streams for __SCTE-35__](#streams)\n* [Parse __SCTE-35__ in __hls__](#hls)\n* [Display __MPEGTS__ __iframes__](#iframes)\n* [Display raw __SCTE-35 packets__ from __video streams__](#packets)\n* [__Repair SCTE-35 streams__ changed to __bin data__ by __ffmpeg__](#sixfix)\n\n#### `Inputs`\n\n* Most __inputs__ are __auto-detected.__ \n* __stdin__ is __auto selected__ and __auto detected.__\n* __SCTE-35 data is printed to stderr__\n* __stdout is used when piping video__\n* mpegts can be specified by file name or URI.\n```rebol\nthreefive udp://@235.2.5.35:3535\n```\n* If a file comtains a SCTE-35 cue as a string( base64,hex,int,json,or xml+bin), redirect the file contents.\n```rebol\n\n  threefive \u003c json.json  \n\n ```\n\n* quoted strings(( base64,hex,int,json or xml+bin), can be passed directly on the command line as well.\n\n```awk\n\nthreefive '/DAWAAAAAAAAAP/wBQb+ztd7owAAdIbbmw=='\n\n```\n\n\n| Input Type |     Cli Example                                                                                             |\n|------------|-------------------------------------------------------------------------------------------------------------|\n| __Base64__     |  `threefive '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='`\n| __Hex__        |`threefive 0xfc301600000000000000fff00506fed605225b0000b0b65f3b`|\n| __HLS__         |`threefive hls https://example.com/master.m3u8`                                                             |\n| __JSON__        |`threefive \u003c json.json`  |\n| __Xmlbin__      | `js threefive \u003c xmlbin.xml`                                                                                 |\n\n# `Streams`\n\n|Protocol       |  Cli Example                                                                                                                                       |\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n|  __File__         |   `threefive video.ts`                                                                                                                            |\n|  __Http(s)__      |   `threefive https://example.com/video.ts`                                                                                                        |\n|  __Stdin__        |  `threefive \u003c video.ts`            |\n|  __UDP Multicast__|  `threefive udp://@235.35.3.5:9999`                                                                          |\n|  __UDP Unicast__  |                                                                      `threefive udp://10.0.0.7:5555`                                              |\n|  __HLS__          |                                                                                                    `threefive hls https://example.com/master.m3u8`|\n|               |                                                                                                                                                    |\n\n\n#### Outputs\n* output type is determined by the key words __base64, bytes, hex, int, json, and xmlbin__.\n* __json is the default__.\n* __Any input (except HLS,) can be returned as any output__\n  * examples __Base64 to Hex__ etc...) \n\n\n| Output Type | Cli Example         |\n|-------------|----------------------------------------------------------|\n|__Base 64__     |                                                                                                                                                                    `threefive 0xfc301600000000000000fff00506fed605225b0000b0b65f3b  base64  `                                                                                                                                                                                                                                                                                                                                         |\n| __Bytes__       |                                                                                 `threefive 0xfc301600000000000000fff00506fed605225b0000b0b65f3b  bytes`                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| __Hex__         | `threefive '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='  hex`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| __Integer__     |                                                                                                                                                                                                                                                       `threefive '/DAsAAAAAyiYAP/wCgUAAAABf1+ZmQEBABECD0NVRUkAAAAAf4ABADUAAC2XQZU='  int`   |\n| __JSON__        |                                                                                                                                                                                                                                                                                                              `threefive 0xfc301600000000000000fff00506fed605225b0000b0b65f3b json ` |\n| __Xml+bin__     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        `threefive 0xfc301600000000000000fff00506fed605225b0000b0b65f3b xmlbin   `      |`\n\n#### `hls`\n* parse hls manifests and segments for SCTE-35\n```smalltalk\nthreefive hls https://example.com/master.m3u8\n```\n___\n#### `Iframes`\n* Show iframes PTS in an MPEGTS video\n\n```smalltalk\nthreefive iframes https://example.com/video.ts\n```\n___\n\n#### `packets`   \n* Print raw SCTE-35 packets from multicast mpegts video\n\n```smalltalk\nthreefive packets udp://@235.35.3.5:3535\n```\n___\n#### `proxy`   \n* Parse a https stream and write raw video to stdout\n\n```smalltalk\nthreefive proxy video.ts\n```\n___\n#### `pts`    \n* Print PTS from mpegts video\n\n```smalltalk\nthreefive pts video.ts\n```\n___\n#### `sidecar`  \n* Parse a stream, write pts,write SCTE-35 Cues to sidecar.txt\n\n```smalltalk\nthreefive sidecar video.ts\n```\n___\n#### `sixfix`  \n* Fix SCTE-35 data mangled by ffmpeg\n\n```smalltalk\nthreefive sixfix video.ts\n```\n___\n#### `show`  \n\n* Probe mpegts video _( kind of like ffprobe )_\n\n```smalltalk\n threefive show video.ts\n```\n___\n#### `version`     \n* Show version\n\n```smalltalk\n threefive version\n```\n___\n#### `help`        \n* Help\n```rebol\n threefive help\n```\n___\n\n\n## [ threefive Streams Multicast, it's easy. ]\n\n* The threefive cli has long been a Multicast Receiver( client )\n* The cli now comes with a builtin Multicast Sender( server).\n * __Start the Receiver first__\n* It's optimized for MPEGTS (1316 byte Datagrams) but you can send any video or file.\n* The defaults will work in most situations, you don't even have to set the address.\n* threefive cli also supports UDP Unicast Streaming.\n   \n```js\na@fu:~$ threefive mcast help\nusage: threefive mcast [-h] [-i INPUT] [-a ADDR] [-b BIND_ADDR] [-t TTL]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -i INPUT, --input INPUT\n                        like \"/home/a/vid.ts\" or \"udp://@235.35.3.5:3535\" or\n                        \"https://futzu.com/xaa.ts\"\n                        [default:sys.stdin.buffer]\n  -a ADDR, --addr ADDR  Destination IP:Port [default:235.35.3.5:3535]\n  -b BIND_ADDR, --bind_addr BIND_ADDR\n                        Local IP to bind [default:0.0.0.0]\n  -t TTL, --ttl TTL     Multicast TTL (1 - 255) [default:32]\na@fu:~$ \n```\n\n* the video shows three streams being read and played from threefive's multicast, one stream is being converted to srt.\n* the command\n```sh\na@fu:~/scratch/threefive$ threefive mcast -i ~/mpegts/ms.ts \n\n```\n\nhttps://github.com/user-attachments/assets/df95b8da-5ca6-4bf3-b029-c95204841e43\n\n\n___\n\n\n## [iodisco.com/scte35](https://iodisco.com/scte35)\n\n\n\n\n\n \u003csvg width=\"100\" height=\"100\"\u003e\n  \u003ccircle cx=\"50\" cy=\"50\" r=\"40\" stroke=\"green\" stroke-width=\"4\" fill=\"yellow\" /\u003e\n\u003c/svg\u003e \n\n \u003cimg width=\"258\" height=\"256\" alt=\"image\" src=\"https://github.com/user-attachments/assets/642cb803-9465-408e-bb6e-03549eb22d78\" /\u003e\n\n___\n [__Install__](#install) |[__SCTE-35 Cli__](#the-cli-tool) | [__SCTE-35 HLS__](https://github.com/superkabuki/threefive/blob/main/hls.md) | [__Cue__ Class](https://github.com/superkabuki/threefive/blob/main/cue.md) | [__Stream__ Class](https://github.com/superkabuki/threefive/blob/main/stream.md) | [__Online SCTE-35 Parser__](https://iodisco.com/scte35) | [__Encode SCTE-35__](https://github.com/superkabuki/threefive/blob/main/encode.md) | [__SCTE-35 Examples__](https://github.com/superkabuki/threefive/tree/main/examples)\n | [__SCTE-35 XML__ ](https://github.com/superkabuki/SCTE-35/blob/main/xml.md) and [More __XML__](node.md) | [__threefive runs Four Times Faster on pypy3__](https://pypy.org/) | [__SuperKabuki SCTE-35 MPEGTS Packet Injection__](inject.md)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperkabuki%2Fthreefive_is_scte35","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperkabuki%2Fthreefive_is_scte35","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperkabuki%2Fthreefive_is_scte35/lists"}