Skip to main content

LOKLOK TV — the branded video channel

Since 2026-08-09 the station also broadcasts a full-branded 1080p30 video program derived from the master audio. Everything is generated live on the production node — no human operator, no pre-rendered video files beyond a few static assets.

Components — /home/sms/radio/video_feed/

FileRole
video_bridge.shThe ffmpeg renderer (read-only daemon). Pulls http://localhost:8005/main, composites bg + logo + spectrum + lower-third + LIVE badge + ticker, pushes RTMP to MediaMTX path loklokvideo. Writes its own PID to .ffmpeg.pid.
video_ticker.jsZero-dep Node daemon. Polls the engine (/api/status, /api/content/status, /api/social/status) and the :19353 listener proxy, renders Cairo time via Africa/Cairo, and atomically writes the reload=1 text files. Editable headlines in news.txt (one per line).
watch_video.shWatchdog — restarts either daemon on death. Logs to watch_video.log. Launched by @reboot sleep 45 && setsid nohup bash /home/sms/radio/video_feed/watch_video.sh.
setup_video_assets.shOne-time asset generator (bg + logo + fonts).
bg.mp4Pre-rendered animated dark-purple gradient loop with film grain.
logo.pngTransparent LOKLOK logo composited over the background.
fonts/Arabic-capable fonts (segoeuib.ttf, tahomabd.ttf) for the ticker/artists.
artwork/Album-art frames fetched for the lower-third art slot.
title.txt / artist.txt / listeners.txt / ticker.txtreload=1 drawtext inputs — ffmpeg re-reads them every frame.
news.txtEditable news headlines (1 per line) shown on the ticker.

Endpoints

TypeURL
HLShttp://files.mediahubnetwork.net:19351/loklokvideo/index.m3u8
RTSPrtsp://files.mediahubnetwork.net:19354/loklokvideo (cookie-free, works in mpv)
WebRTC:19355 (via MediaMTX WHEP)
# RTSP is the easiest to test (no cookie jar needed):
mpv rtsp://files.mediahubnetwork.net:19354/loklokvideo

The transcode farm + freetube ABR auto-discover the new RTSP path, so multi-bitrate HLS ladders are generated automatically under /home/sms/transcode-farm/outputs/live-hls/loklokvideo/ and /home/sms/my_folder/freetube/abr/data/abr/loklokvideo/, plus WebRTC/WHEP encoders.

On-screen design

  • 1920×1080 @ 30 fps, AAC 48 kHz audio (from the master OGG).
  • Animated gradient background + grain, transparent logo top-left.
  • Gold NOW-PLAYING / white title / cyan artist lower-third.
  • Bright animated showfreqs visualizer band.
  • Red blinking LIVE listener badge (count from the :19353 proxy).
  • Scrolling ticker with news headlines + Cairo clock.

Operational notes

  • The video feed dies with the master: it ingests Icecast localhost:8005/main, so if the OGG master is down the video program is too.

  • Editing headlines: echo "…" >> /home/sms/radio/video_feed/news.txt — the ticker re-reads it on the next poll cycle; no restart needed.

  • Restart the feed cleanly:

    cd /home/sms/radio/video_feed
    pkill -f video_bridge.sh; pkill -f video_ticker.js # or pkill -9 + let watch_video.sh relaunch

Gotchas (hard-learned)

  1. Remote scripts must stay pure ASCII — the write-tool→scp path mangles non-ASCII + backticks and writes CRLF. Always sed -i 's/\r$//' after upload and node --check / bash -n.
  2. ffmpeg filtergraph: a labeled stream can only be consumed once — use asplit=3 to feed two showfreqs. scale=w:h,format=X needs the comma; there is no overlap option on showfreqs (that's showspectrum); \, escapes a literal comma in drawtext expressions.
  3. setsid nohup bash x.sh < /dev/null & so the ssh channel can close — an open stdin fd hangs the session.

See also