{"id":24848655,"url":"https://github.com/superkabuki/SCTE35","last_synced_at":"2025-10-14T20:30:39.502Z","repository":{"id":282379422,"uuid":"948390549","full_name":"superkabuki/SCTE35","owner":"superkabuki","description":"SCTE-35 | threefive, the most advanced, and complete SCTE-35 tool and lib available. threefive will save us all.","archived":false,"fork":false,"pushed_at":"2025-10-06T22:01:47.000Z","size":1099,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T23:33:09.090Z","etag":null,"topics":["adbreak","adrianofdoom","adtech","best","hls-live-streaming","hls-scte35","mpegts","python3","scte","scte-214","scte-35","scte-35-hls","scte35","spliceinfosection","threefive","threefive3"],"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-10-06T22:01:50.000Z","dependencies_parsed_at":"2025-03-14T10:21:49.115Z","dependency_job_id":"40b8fe93-ab6d-4920-8303-ee95cefd7f7a","html_url":"https://github.com/superkabuki/SCTE35","commit_stats":null,"previous_names":["superkabuki/threefive3","superkabuki/scte-35","superkabuki/scte-35_threefive3","superkabuki/threefive","superkabuki/scte35_threefive","superkabuki/scte35"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/superkabuki/SCTE35","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superkabuki","download_url":"https://codeload.github.com/superkabuki/SCTE35/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020905,"owners_count":26086948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","best","hls-live-streaming","hls-scte35","mpegts","python3","scte","scte-214","scte-35","scte-35-hls","scte35","spliceinfosection","threefive","threefive3"],"created_at":"2025-01-31T12:16:40.096Z","updated_at":"2025-10-14T20:30:39.496Z","avatar_url":"https://github.com/superkabuki.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# threefive is the Highest Rated SCTE-35 Parser. Ever.\n\n# SCTE-35 CLI tool and python3 library\n\n## [Latest version is v3.0.63](v3063.md)\n\n\n### Q. `Who uses threefive?` \n\n### A. `Everybody.` \n_(threefive has been installed over one million times according to [pypi.org](https://pypi.org)_\n\n\n# `Features`\n\u003csamp\u003e\n\n* __Decodes SCTE-35__ from:\n\t* MPEGTS\n \t* Base64\n  \t*  Bytes\n  \t*  DASH\n  \t*  Dicts\n  \t*  Hex\n  \t*  HLS\n  \t*  Integers\n  \t*  JSON\n  \t*  XML\n  \t*  XML+Binary\n* __Encodes SCTE-35__ to:\n\t* MPEGTS\n \t* Base64\n  \t* Bytes\n  \t* Hex\n  \t* Integers\n  \t* JSON\n  \t* XML\n  \t* XML+Binary\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\u003csamp\u003e\n\n#  `Tip Of The Week`\nIf you want to have a Segmentation Descriptor without a UPID \u003cBR\u003e\nset __segmentation_upid_length__= __0__ \u003cBR\u003e\nset __segmentation_upid_type__= __0__\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 lib__](#using-the-library) _decode SCTE-35 with less than ten lines of code_\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__](#stream-multicast-with-the-threefive-cli-its-easy) _threefive is a multicast client and server_\n* [SCTE-35 __Online Parser__](https://iodisco.com/scte35) _powered by threefive, hosted on my server_\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## `Install`\n* [Install](#install)\n\n## `Quick Start` \n\n\n* Here's how to decode these SCTE-35 formats with threefive.\n* This covers both the Cli tool and library.\n\n\u003cdetails\u003e\u003csummary\u003e MPEGTS \u003c/summary\u003e \u003c/summary\u003e\n* MPEGTS streams can be  Files, Http(s), Multicast, 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\u003cdetails\u003e\u003csummary\u003eBase64\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\u003eBytes\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\u003eHex\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\u003eInt\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\u003eJSON\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\u003eXml\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\u003eXml+binary\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\n## `Examples` \n* [__Examples__](https://github.com/superkabuki/threefive/tree/main/examples)\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## `| 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\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## `Using the library`\n\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## Stream Multicast with the threefive cli, 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![image](https://github.com/user-attachments/assets/6042b8e0-5d6b-4de0-b6b0-9556cecc184f)\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## [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%2FSCTE35","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperkabuki%2FSCTE35","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperkabuki%2FSCTE35/lists"}