joaquin 57c8f6fb64 feat: A/V health monitor, buffer bar and stream health dashboard
Backend (restream.py):
- Add _health_check_loop task: checks data flow every 5 s, updates
  av_health (ok/warning/error), auto-corrects stuck ffmpeg via SIGTERM
- Health thresholds: warning >12 s, error >25 s — normal reconnects
  (1-4 s) no longer trigger false warnings
- Count ffmpeg stderr A/V-warning events (av_desync_count) as metric
- Expose buffer_pct (server-side queue fill of slowest client),
  corrections (health-triggered ffmpeg restarts), av_health in stats()
- Revert wallclock timestamp flag: -use_wallclock_as_timestamps 1 was
  generating hundreds of spurious demuxer warnings per session, causing
  ffmpeg to stall and producing continuous video freezes
- Simplify ffmpeg cmd to minimal safe set: -reconnect 1
  -reconnect_streamed 1 -reconnect_delay_max 2

Dashboard (Dashboard.tsx):
- Add 6th StatCard "Salud A/V" with dynamic color and correction count
- Add "Salud A/V" column per stream: badge ok/aviso/error,
  corrections counter (violet), desync event count (grey)
- Add BufferBar: thin progress bar showing server queue fill %
  (green <40 %, yellow 40-70 %, red >70 %)
- Alert banner in header when any stream is in error av_health state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 01:14:37 +02:00

KiraTV

Sistema de proxy y gestión IPTV con soporte multiusuario y fan-out de streams.

Stack

  • Backend: Python 3.13 + FastAPI + asyncio
  • Base de datos: PostgreSQL 17 + SQLAlchemy 2 + Alembic
  • Cache / estado: Redis 8
  • Frontend: React 18 + Vite + TailwindCSS
  • Proxy inverso: Nginx

Características

  • Compatible con API Xtream Codes (TiviMate, Smarters, IPTV Pro…)
  • Fan-out de streams: N usuarios ven el mismo canal → 1 solo slot del proveedor
  • Soporte multi-cuenta del mismo proveedor con balanceo de slots
  • Catálogos personalizados por usuario (live, VOD, series)
  • Integración Jellyfin: biblioteca local como categorías KiraTV
  • EPG XMLTV con merge por tvg-id
  • Dashboard en tiempo real (WebSocket): qué usuario ve qué canal y qué slot usa
  • Reconexión automática con detección de stall y A/V sync garantizado

Instalación

cp .env.example /opt/kirastream/.env
# Editar .env con tus valores reales

cd /opt/kirastream/frontend
npm install && npm run build

cd /opt/kirastream
python3 -m venv venv
venv/bin/pip install -r backend/requirements.txt
venv/bin/python -m alembic upgrade head

Configuración

Ver .env.example para todas las variables disponibles.

La configuración de Nginx está en nginx/kirastream.conf.
El servicio systemd está en kirastream.service.

S
Description
No description provided
Readme 2.9 MiB
Languages
Python 55.2%
TypeScript 44.1%
Shell 0.3%
HTML 0.2%
JavaScript 0.1%