mcast-tools ← efespain.com
ES EN

Multicast UDP · dos CLIsMulticast UDP · two CLIs

Duplica y emite vídeo multicastDuplicate and emit multicast video

Dos herramientas de línea de órdenes para operar multicast UDP en redes de vídeo. mcast-dup recibe un grupo y lo reenvía tal cual a otros — reescribiendo el grupo de destino, sin recodificar. mcast-send emite un fichero, una orden, stdin o un patrón, al ritmo que marca el PCR del propio flujo. Binarios estáticos, N canales por proceso, recarga en caliente. Two command-line tools for multicast UDP in video networks. mcast-dup receives a group and forwards it as-is to others — rewriting the destination group, without re-encoding. mcast-send emits a file, a command, stdin or a pattern, paced by the stream's own PCR. Static binaries, N channels per process, hot reload.

Go · binario estáticostatic binary MIT Linux · Windows en desarrollowork in progress
mcast-tools: un flujo multicast de entrada duplicado a varias salidas
mcast-dup
$ mcast-dup -config /etc/mcast-dup.json
modo daemondaemon mode · config /etc/mcast-dup.json
[tv-uno] arrancandostarting   239.0.10.1:5000 -> 239.255.0.1:1234,239.255.1.1:1234  (iface=10.30.0.5 ttl=8)
[tv-dos] arrancandostarting   239.0.10.2:5000 -> 239.255.0.2:1234  (iface=10.30.0.5 ttl=8)
[10:42:07] tv-uno            950 pkt/s · rx  10.02 Mbps · tx  20.04 Mbps · 0 err · 0 drop
[10:42:07] tv-dos            948 pkt/s · rx   9.99 Mbps · tx   9.99 Mbps · 0 err · 0 drop
[10:42:17] SIGHUP: recargando configuración…SIGHUP: reloading configuration…
[10:42:17] tv-uno            951 pkt/s · rx  10.03 Mbps · tx  20.06 Mbps · 0 err · 0 drop

Un canal con dos destinos: la tx es ~2× la rx — eso es la duplicación ocupando el enlace. El SIGHUP recarga la config sin cortar los canales que no cambian.One channel, two destinations: tx is ~2× the rx — that's the duplication filling the link. SIGHUP reloads the config without cutting the channels that didn't change.

Dos herramientas, una capa comúnTwo tools, one shared core

Comparten configuración, sockets, orquestación de canales y estadísticas. Se instalan y ejecutan por separado.They share configuration, sockets, channel orchestration and stats. Installed and run separately.

mcast-dup

Duplica. Recibe un grupo y reenvía cada datagrama tal cual a uno o varios grupos distintos — reescribiendo el destino, sin tocar el payload. Para reencaminar entre planes de direccionamiento (`239.0.10.x` → `239.255.x.x`), llevar un canal a dos destinos, o exponerlo en un rango que sí cruce cierto router. IPTV, SDI-over-IP, distribución interna.Duplicates. Receives a group and forwards each datagram as-is to one or more different groups — rewriting the destination, never touching the payload. To re-route between addressing plans (`239.0.10.x` → `239.255.x.x`), carry a channel to two destinations, or expose it on a range that crosses a given router. IPTV, SDI-over-IP, internal distribution.

mcast-send

Emite. Manda un fichero, la salida de una orden externa, la entrada estándar o un patrón generado, con RTP opcional y al ritmo que marca el PCR del propio flujo — no a velocidad de cable, sino como debe verse. Para inyectar señal, hacer pruebas o reponer un canal caído.Emits. Sends a file, the output of an external command, standard input, or a generated pattern, with optional RTP and paced by the stream's own PCR — not at line rate, but as it should play. To inject signal, run tests, or stand in for a dropped channel.

Pensadas para operar, no para una demoBuilt to operate, not to demo

Reescribe el grupoRewrites the group

Lo que ninguna herramienta de relay hace: cambiar el grupo de destino, no solo repetir el mismo en otra interfaz.What no relay tool does: change the destination group, not just repeat the same one on another interface.

N canales por procesoN channels per process

Muchos canales a la vez desde un JSON, cada uno con sus destinos, interfaz y TTL.Many channels at once from one JSON, each with its own destinations, interface and TTL.

Recarga con SIGHUPHot reload with SIGHUP

Cambia la config y recarga sin cortar los canales que no han cambiado. Nada de parar el servicio.Change the config and reload without cutting the channels that didn't change. No service restart.

Al ritmo del PCRPaced by the PCR

mcast-send emite MPEG-TS al reloj del propio flujo, no a velocidad de cable: así un decodificador lo lee.mcast-send emits MPEG-TS at the stream's own clock, not at line rate — so a decoder can read it.

Se protege solaIt guards itself

Rechaza destinos duplicados y cualquier canal que cree un bucle de realimentación (un destino que vuelva al origen).It rejects duplicate destinations and any channel that would create a feedback loop (a destination that returns to the source).

Binario estáticoStatic binary

Sin dependencias en tiempo de ejecución, sin cgo. Un fichero, un systemd, listo.No runtime dependencies, no cgo. One file, one systemd unit, done.

CompilarBuild

Libre y de código abierto (MIT). Compila estático para Linux o Windows.Free and open source (MIT). Builds static for Linux or Windows.

Linux (amd64 · arm64) Windows Go · CGO_ENABLED=0
En desarrollo. Funciona y hace su trabajo, pero la interfaz de línea de órdenes y el formato de la config pueden cambiar entre versiones. Para IPTV/SDI-over-IP y distribución interna de señal — no es un router multicast (PIM/IGMP) ni un servidor HTTP; para eso, otras herramientas (smcroute, udpxy…). mcast-tools hace lo que ninguna: reescribir el grupo y llevar muchos canales con recarga en caliente.Work in progress. It works and does the job, but the command line and config format may change between versions. For IPTV/SDI-over-IP and internal signal distribution — it's not a multicast router (PIM/IGMP) or an HTTP server; for that, other tools (smcroute, udpxy…). mcast-tools does what none of them do: rewrite the group and carry many channels with hot reload.