{"id":30011185,"url":"https://github.com/superkabuki/scte35_threefive","last_synced_at":"2025-08-05T12:54:35.705Z","repository":{"id":282379422,"uuid":"948390549","full_name":"superkabuki/SCTE35_threefive","owner":"superkabuki","description":"this is the new home of threefive, the most advanced, and complete SCTE-35 tool and lib available. threefive has been installed over One Million times. Real talk.","archived":false,"fork":false,"pushed_at":"2025-07-29T02:40:33.000Z","size":903,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T04:36:50.397Z","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}},"created_at":"2025-03-14T08:55:42.000Z","updated_at":"2025-07-29T02:40:36.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_threefive","commit_stats":null,"previous_names":["superkabuki/threefive3","superkabuki/scte-35","superkabuki/scte-35_threefive3","superkabuki/threefive","superkabuki/scte35_threefive"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/superkabuki/SCTE35_threefive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35_threefive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35_threefive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35_threefive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35_threefive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superkabuki","download_url":"https://codeload.github.com/superkabuki/SCTE35_threefive/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superkabuki%2FSCTE35_threefive/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268901136,"owners_count":24326067,"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-08-05T02:00:12.334Z","response_time":2576,"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-08-05T12:54:29.735Z","updated_at":"2025-08-05T12:54:35.682Z","avatar_url":"https://github.com/superkabuki.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# threefive is the #1 SCTE-35 tool on the planet.\n\u003csamp\u003e\u003ci\u003e\n After watching fifteen seasons of The Dallas Cowboy Cheerleaders,\u003cbr\u003e\"Making The Team\", I feel like this is my year to try out.\u003cbr\u003e It's my time, my time to shine.  ~Adrian\u003cbr\u003e\u003cbr\u003e\n✅  SCTE-35 Decoder   ✅  SCTE-35 Encoder   ✅  SCTE-35 Cli tool  ✅   SCTE-35 Library\n\n### latest is `v3.0.59` \n\u003c/i\u003e\u003c/samp\u003e\n\n\u003csamp\u003e\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) | [SCTE-35 __Online 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) | [__SuperKabuki__ SCTE-35 MPEGTS __Packet Injection__](inject.md) | [SCTE-35 __As a Service__](sassy.md) | [SCTE-35 __Sidecar Files__](https://github.com/superkabuki/SCTE-35_Sidecar_Files)\n\n\n### Over 1 million installs. Last month: 11,000 installs. Last week: 2300 installs.\n\u003cimg width=\"1032\" height=\"152\" alt=\"image\" src=\"https://github.com/user-attachments/assets/56ebd69d-845c-4122-9723-9e905654c609\" /\u003e\n\n\n\n\t\n---\n\n# threefive\n* __Decodes SCTE-35__ in __TEN__ formats: __MPEGTS, Base64, Bytes, Dicts, Hex,HLS, Integers,JSON,XML and XML+Binary__.\n* __Encodes SCTE-35__ in __EIGHT__ formats: __MPEGTS, Base64, Bytes, Hex, Int, JSON,XML, and Xml+binary.__\n* __Supports All HLS SCTE-35 Tags__.\n* __Does Automatic AES decryption__ for __MPEGTS__ and __HLS__.\n* __Has Built-in Multicast Sender__ and __Receiver__.\n* __Injects SCTE-35 Packets__ into __MPEGTS__ video.\n\n---\n\n# `Documentation`\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\n\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\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\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\n\n\u003c/details\u003e\n\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\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\n\u003cdetails\u003e\u003csummary\u003eXml\u003c/summary\u003e\n\n* __cli__\n\t* put xml SCTE-35 in a file and redirect it into threefive \n\t```js\n\tthreefive \u003c xmlbin.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 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---\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  \u003cimg width=\"1084\" height=\"689\" alt=\"image\" src=\"https://github.com/user-attachments/assets/35804a93-1002-46e5-b930-143c3cc1428e\" /\u003e\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 \u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eMonth\u003c/th\u003e\n    \u003cth\u003eSavings\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eJanuary\u003c/td\u003e\n    \u003ctd\u003e$100\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e \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\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperkabuki%2Fscte35_threefive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperkabuki%2Fscte35_threefive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperkabuki%2Fscte35_threefive/lists"}