{"id":15373102,"url":"https://github.com/vi/ts2xml","last_synced_at":"2025-04-15T14:13:44.505Z","repository":{"id":137140251,"uuid":"5406887","full_name":"vi/ts2xml","owner":"vi","description":"Dump mpegts files as XML, decoding various headers","archived":false,"fork":false,"pushed_at":"2013-08-18T21:04:54.000Z","size":51,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T14:13:40.484Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-14T01:18:02.000Z","updated_at":"2018-12-08T05:42:14.000Z","dependencies_parsed_at":"2023-03-11T12:11:21.315Z","dependency_job_id":null,"html_url":"https://github.com/vi/ts2xml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fts2xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fts2xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fts2xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fts2xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vi","download_url":"https://codeload.github.com/vi/ts2xml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249085429,"owners_count":21210267,"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","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":[],"created_at":"2024-10-01T13:54:17.622Z","updated_at":"2025-04-15T14:13:44.477Z","avatar_url":"https://github.com/vi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"ts2xml reads mpegts file from stdin and dumps it as special XML file containing packets with their headers.\n\nts2xml is stateful: it reads PATs and PMTs and remembers how PIDs should be handled.\n\nExample of resulting XML file:\n\n    \u003cts2xml\u003e\n    \u003cpacket\u003e\n        \u003cpayload_unit_start/\u003e\n        \u003cpid\u003e0x0\u003c/pid\u003e\n        \u003cprogram_association_table\u003e\n            \u003csection_length\u003e13\u003c/section_length\u003e\n            \u003ctransport_stream_ID\u003e1\u003c/transport_stream_ID\u003e\n            \u003cversion_number\u003e0\u003c/version_number\u003e\n            \u003cprogram\u003e\n                \u003cprogram_num\u003e1\u003c/program_num\u003e\n                \u003cprogram_pid\u003e0x1000\u003c/program_pid\u003e\n            \u003c/program\u003e\n        \u003c/program_association_table\u003e\n    \u003c/packet\u003e\n    \u003cpacket\u003e\n        \u003cpayload_unit_start/\u003e\n        \u003cpid\u003e0x1000\u003c/pid\u003e\n        \u003cprogram_map_table\u003e\n            \u003csection_length\u003e23\u003c/section_length\u003e\n            \u003cprogram_num\u003e1\u003c/program_num\u003e\n            \u003cversion_number\u003e0\u003c/version_number\u003e\n            \u003cgeneral_timecode_stream_PID\u003e0x100\u003c/general_timecode_stream_PI\n            \u003cstream\u003e\n                \u003cstream_type\u003e0x1b\u003c/stream_type\u003e\n                \u003celementary_pid\u003e0x100\u003c/elementary_pid\u003e\n            \u003c/stream\u003e\n            \u003cstream\u003e\n                \u003cstream_type\u003e0xf\u003c/stream_type\u003e\n                \u003celementary_pid\u003e0x101\u003c/elementary_pid\u003e\n            \u003c/stream\u003e\n        \u003c/program_map_table\u003e\n    \u003c/packet\u003e\n    \u003cpacket\u003e\n        \u003cpayload_unit_start/\u003e\n        \u003cpid\u003e0x100\u003c/pid\u003e\n        \u003cadaptation_field\u003e\n            \u003crandom_access/\u003e\n            \u003cprogram_clock_reference\u003e0.7\u003c/program_clock_reference\u003e\n        \u003c/adaptation_field\u003e\n        \u003celementary_stream_packet\u003e\n            \u003cstream_type\u003empeg_video_0\u003c/stream_type\u003e\n            \u003cpacket_length\u003e6233\u003c/packet_length\u003e\n            \u003cpresentation_timestamp\u003e1.4\u003c/presentation_timestamp\u003e\n            \u003cdata\u003e0000000109f000000001674d400d92420283f6022000000c800002ed\n        \u003c/elementary_stream_packet\u003e\n    \u003c/packet\u003e\n    \u003cpacket\u003e\n        \u003cpid\u003e0x100\u003c/pid\u003e\n        \u003celementary_stream_packet_continue\u003e\n            \u003cdata\u003e63e1537ea562e18bead16ab34ee33af6f2d9ef7a6ef856cd54fb2b8f\n        \u003c/elementary_stream_packet_continue\u003e\n    \u003c/packet\u003e\n\n\nThe primary use cases of the tool are:\n\n* Learning about MpegTS and PES formats\n* Debugging issues with MpegTS\n\nExample invocation (extract raw stream of pid 0x100 to file):\n\n    ./ts2xml.py \u003c q.ts | xml2 | grep 'packet/pid\\|/data=' | grep -A 1 '/pid=0x100' | grep 'data=' | cut -f 2- -d= | tr -d '\\n' | xxd -r -p | pv \u003e q.raw\n\n\nIf you want xml2ts for the reverse conversion, open [an issue](https://github.com/vi/ts2xml/issues/new?title=Please+add+xml2ts) on Github or wait until I need it for myself.\n\n\nFor mkv2xml and xml2mkv see https://github.com/vi/mkvparse\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fts2xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvi%2Fts2xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fts2xml/lists"}