{"id":30859065,"url":"https://github.com/videolan/multicat","last_synced_at":"2025-09-07T14:56:42.461Z","repository":{"id":47422413,"uuid":"114354435","full_name":"videolan/multicat","owner":"videolan","description":"Please send patches as pull requests.","archived":false,"fork":false,"pushed_at":"2024-07-10T11:59:50.000Z","size":137,"stargazers_count":67,"open_issues_count":0,"forks_count":27,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-07-10T14:05:36.382Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.videolan.org/projects/multicat.html","language":"C","has_issues":false,"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/videolan.png","metadata":{"files":{"readme":"README","changelog":"Changelog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-15T09:45:40.000Z","updated_at":"2024-07-10T11:59:54.000Z","dependencies_parsed_at":"2024-02-07T14:40:21.747Z","dependency_job_id":"6b34f35e-8e83-4541-abde-ea299f1b6b22","html_url":"https://github.com/videolan/multicat","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/videolan/multicat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videolan%2Fmulticat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videolan%2Fmulticat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videolan%2Fmulticat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videolan%2Fmulticat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/videolan","download_url":"https://codeload.github.com/videolan/multicat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videolan%2Fmulticat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274052000,"owners_count":25214030,"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-09-07T02:00:09.463Z","response_time":67,"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":[],"created_at":"2025-09-07T14:56:35.380Z","updated_at":"2025-09-07T14:56:42.449Z","avatar_url":"https://github.com/videolan.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Welcome to Multicat!\n====================\n\nThe multicat package contains a set of tools designed to easily and\nefficiently manipulate multicast streams in general, and MPEG-2\nTransport Streams (ISO/IEC 13818-1) in particular.\n\nThe multicat tool itself is a 1 input/1 output application. Inputs and\noutputs can be network streams (unicast and multicast, IPv4 and IPv6), files,\ndirectories, character devices or FIFOs. Typical applications are recording\nlive transport streams, or playing out TS files without modification.\n\nMulticat tries to rebuild the internal clock of the input stream; but\nit wants to remain agnostic of what is transported, so in case of files\nor directories, the said clock is stored to an auxiliary file (example.aux\naccompanies example.ts) while recording. Other inputs are considered \"live\",\nand the input clock is simply derived from the reception time of the\npackets.\n\nIngesTS is a companion application designed to manipulate TS files. It\nreads the PCR values of the file, and builds the auxiliary file that is\nnecessary for multicat.\n\nOffseTS is another companion application to manipulate auxiliary files.\nGiven an offset in time from the beginning of the file, it returns the offset\nof the position in number of packets. It is currently deprecated in favour of\nusing the -k and -d options of multicat.\n\nLasTS is also a companion application which gives the total duration of an\nauxiliary file.\n\nFinally aggregaRTP and reordeRTP can be used to carry a high-bitrate\nsignal over one or several contribution links, and support retransmission\nof lost packets via an additional UDP or TCP connection. ReordeRTP can also\nsmooth up the reception of a stream from a link that is known to reorder\nand add jitter to packets.\n\nTo minimize jitter and please IAT analysers, you can also use smooThS.\nSmooThS reads the RTP timestamp and actively waits for the proper time\nto send the packet.\n\nThe multicat suite of applications is very lightweight and designed to\noperate in tight environments. Memory and CPU usages are kept to a minimum,\nand they feature only one thread of execution.\n\n\nThe socket description format\n=============================\n\nFor conveniency all tools use the same way of describing a socket in a\nprogram argument:\n\n\u003cconnect address\u003e:\u003cconnect port\u003e@\u003cbind address\u003e:\u003cbind port\u003e/\u003coptions\u003e\n\nAll parts are optional; default port (1234) or wildcard address will then\nbe used.\n\nSome examples:\n\nReading all streams coming to port 5004:\n    @:5004\nReading from a multicast stream on port 5004:\n    @239.255.0.1:5004\nThe same, with source-specific multicast:\n    192.168.0.1@239.255.0.1:5004\nWriting to a multicast stream on port 5004:\n    239.255.0.1:5004\nThe same, but binding to a specific interface:\n    239.255.0.1:5004@192.168.0.2\n\nOptions include:\n /ifindex=X (binds to a specific network interface, by link number)\n /ifaddr=XXX.XXX.XXX.XXX (binds to a specific network interface, by address)\n /ttl=XX (time-to-live of the UDP packet)\n /tos=XX (sets the IPv4 Type Of Service option)\n /tcp (binds a TCP socket instead of UDP)\n /srcaddr=XXX.XXX.XXX.XXX (source address for raw packets)\n /srcportr=XX (source port for raw packets)\n\nExample:\n    239.255.0.1:5004/ttl=64\n\nAlso, multicat supports IPv6 addresses.\n\n\nBasic uses\n==========\n\nRecording a multicast address to a file:\n\nmulticat @239.255.0.1:5004 /tmp/myfile.ts\n\nRecording a udp multicast address to a file:\n\nmulticat -u @239.255.0.1:5004 /tmp/myfile.ts\n\nThese recordings will also create a file /tmp/myfile.aux. Playing back the file:\n\nmulticat -p 68 /tmp/myfile.ts 239.255.0.2:5004\n\nAdding an RTP header to an existing multicast stream:\n\nmulticat -p 68 -u @239.255.0.1:5004 239.255.0.2:5004\n\nThe PCR PID is here supposed to be 68. If you don't specify it, the timestamps\nwill not be RFC-compliant (but will work in most cases). You can use the\nmpeg_print_pcr example from biTStream to determine it. Otherwise, if you are\nsure the stream contains a single program, and only one PID carries a PCR, you\ncan pass \"-p 8192\" the disable the PID check. This isn't on by default because\nit can produce awful things with multi-program transport streams, and the\nworld would be a better place if people had to knowingly turn it on.\n\nStarting at a given position for a given duration:\n\nmulticat -p 68 -k 270000000 -d 2700000000 /tmp/myfile.ts 239.255.0.2:5004\n\nIn this case multicat discards the first 10 seconds, and only plays the file\nfor 100 seconds. Internally multicat uses a 27 MHz monotonic clock, and all\noffsets (starting from 0) and durations are expressed in this unit.\n\nMaking an extract of a recorded file to a plain TS file:\n\nmulticat -f -k 270000000 -d 2700000000 /tmp/myfile.ts /tmp/extract.ts\n\nThe option -f allows outputting the extract as fast as the output item can\nwrite it, without reproducing the same pace as the original stream (and thus,\nwaiting 100 seconds).\n\n\nUsing IngesTS\n=============\n\ningests -p 68 /tmp/afile.ts\n\nThis will create file /tmp/afile.aux. 68 is supposed to be the PCR PID.\nThe same note as above applies to ingesTS.\n\nPlaying the file:\n\nmulticat -p 68 /tmp/afile.ts 239.255.0.2:5004\n\n\nWorking with directories\n========================\n\nStarting with version 2.0, multicat can write or read a continuous stream to\ndiscontinuous buffers, while still retaining the original properties. For\ninstance:\n\nmkdir mydir\nmulticat @239.255.255.1:5004 mydir\n\ncreates file XXXXXX.ts and XXXXXX.aux in mydir. Every hour, multicat closes\nboth files, and creates (XXXXXX+1).ts and (XXXXXX+1).aux. And so one. The\nstream can then be identically replayed with a 100 seconds delay with:\n\nmulticat -p 68 -k -2700000000 mydir 239.255.255.2:5004\n\nA negative value to -k implies \"from the end\", in this case from the present\ntime. To make an extract of the stream:\n\nmulticat -f -k 35383033980000000 -d 27000000000 mydir extract.ts\n\nWith the directory input/output, timestamps represent the number of ticks of\na 27 MHz real-time clock since the 1st of January 1970 (UNIX Epoch). It is\ntherefore possible to pass absolute (positive) dates to -k.\n\nThere is no built-in expiration of files in multicat; to avoid filling up the\npartition, it is necessary to run multicat_expire.sh every hour.\n\nThe duration of the segments may be specified with -r. It is also advised to\nadd an offset with -O (typically a per-stream random number of up to the\nsegment duration minus one) to avoid having all multicat processes rotate\nfiles exactly at the same time, resulting in a surge in CPU usage and disk I/O.\n\n\nUsing OffseTS\n=============\n\nWe want to take the first 60 minutes of a TS file. We must scale it in a\n27 MHz clock:\n60 * 60 (seconds) * 27000000 (MHz) = 97200000000\n\nFind the offset in 1316-blocks:\n\noffsets /tmp/myfile.aux 97200000000\n\nIt returns for instance \"556896\". Then cut the file using dd:\n\ndd if=/tmp/myfile.ts of=/tmp/mynewfile.ts bs=1316 count=556896\n\nAlternatively, if we want to *remove* the first hour:\n\ndd if=/tmp/myfile.ts of=/tmp/mynewfile.ts bs=1316 skip=556896\n\nIt can also be done with multicat using the -s and -n options.\n\nOffseTS is currently deprecated in favour of using the -k and -d options of\nthe multicat program. OffseTS is still distributed for compatibility, but\ndoesn't support the new directory input.\n\n\nUsing AggregaRTP and ReordeRTP\n==============================\n\nSplitting an RTP stream to two streams with different routing policies:\n\naggregartp @239.255.0.1:5004 239.1.0.1:5004@192.168.0.1 239.2.0.1:5004@172.16.0.1\n\nAt the other end, reassembling the two streams into one usable stream:\n\nreordertp 192.168.0.1@239.1.0.1:5004 172.16.0.1@239.2.0.1:5004 239.254.0.1:5004\n\nTransmit a signal over a lossy link:\n\naggregartp @239.255.0.1:5004 239.1.0.1:5004 -X @:5006\nreordertp @239.1.0.1:5004 239.254.0.1:5004 -X 192.168.0.1:5006\n\nThe same, but using inverted TCP for retransmission (for NAT traversal for\ninstance):\nreordertp @239.1.0.1:5004 239.254.0.1:5004 -X @:5006/tcp\naggregartp @239.255.0.1:5004 239.1.0.1:5004 -X 192.168.0.2:5006/tcp\n\n(with TCP the listener must be started before the other)\n\n\nUsing multilive\n===============\n\nRunning a master at priority 1000 on multicast address 239.255.255.255:1025:\n\nmultilive -y 1000 @239.255.255.255:1025 239.255.255.255:1025\n\nRunning another master on a different machine at a higher priority (who will\npreempt the other master):\n\nmultilive -y 1001 @239.255.255.255:1025 239.255.255.255:1025\n\nRunning multilive with a configuration file on multiple interfaces:\n\nThe configuration file is a list of input and output peers defined by a custom\noptional name and a socket description, for instance:\n\n$ cat multilive.conf\ninput1  @239.255.255.1:5004/ifaddr=192.168.1.1\noutput1 239.255.255.1:5004@192.168.1.1\ninput2  @239.255.255.2:5004/ifaddr=192.168.2.1\noutput2 239.255.255.2:5004@192.168.2.1\n\nThen use:\n$ multilive -y 1000 -c multilive.conf\n\nUsing smooThS\n=============\n\nSmooThS command line is close to multicat's:\n\nsmooths -c /etc/smooths.conf @239.255.255.255:5004\n\nwhere smooths.conf contains a list of destinations such as:\n\n239.255.255.254:5004\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvideolan%2Fmulticat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvideolan%2Fmulticat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvideolan%2Fmulticat/lists"}