OrbiSubs: live WebVTT subtitles for an HLS channel (whisper.cpp HTTP or faster-whisper)
Video -c:v copy, audio AAC re-encode, VTT por segmento alineado por PTS, video sostenido hasta tener subtítulo. Prueba tarea 076 en pve7 CT 176.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# /etc/orbisubs/<canal>.env
|
||||
INPUT=srt://192.168.10.40:10013?mode=caller&latency=200000
|
||||
# Motor: http = whisper.cpp server remoto (gpu02); local = faster-whisper en esta máquina.
|
||||
ENGINE=http
|
||||
URL=http://192.168.2.10:8004
|
||||
MODEL=small
|
||||
DEVICE=cuda
|
||||
COMPUTE=int8
|
||||
THREADS=4
|
||||
BEAM=1
|
||||
@@ -0,0 +1,13 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
root /var/www;
|
||||
location /hls/ {
|
||||
add_header Access-Control-Allow-Origin * always;
|
||||
add_header Cache-Control "no-cache" always;
|
||||
types { application/vnd.apple.mpegurl m3u8; video/mp2t ts; text/vtt vtt; }
|
||||
}
|
||||
# Las listas internas de ffmpeg no se publican: el player tiene que ir por
|
||||
# video.m3u8, que va sostenido hasta tener subtítulo.
|
||||
location ~ ^/hls/[^/]+/src/index\.m3u8$ { return 404; }
|
||||
location = / { return 302 /player.html; }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=OrbiSubs transcripción %i (faster-whisper → WebVTT)
|
||||
After=orbisubs-ingest@%i.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/orbisubs/%i.env
|
||||
ExecStart=/opt/orbisubs/venv/bin/python /opt/orbisubs/orbisubs.py --dir /var/www/hls/%i \
|
||||
--engine ${ENGINE} --url ${URL} --model ${MODEL} --device ${DEVICE} --compute ${COMPUTE} --threads ${THREADS} --beam ${BEAM} \
|
||||
--metrics /var/log/orbisubs/%i.jsonl
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
# Arranque limpio: el .vtt de segmentos viejos no sirve (otro buffer).
|
||||
ExecStartPre=/bin/sh -c 'rm -f /var/www/hls/%i/subs/*.vtt; mkdir -p /var/log/orbisubs'
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=OrbiSubs ingesta %i (ffmpeg -c copy a HLS)
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/orbisubs/%i.env
|
||||
ExecStart=/opt/orbisubs/ingest.sh %i ${INPUT}
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user