34 lines
1.3 KiB
Python
34 lines
1.3 KiB
Python
import os
|
|
from pathlib import Path
|
|
|
|
APP_ID = "com.cht.StreamAgent"
|
|
APP_NAME = "CHT"
|
|
|
|
# Default session data location — in project dir for easy clearing
|
|
PROJECT_DIR = Path(__file__).resolve().parent.parent
|
|
DATA_DIR = PROJECT_DIR / "data"
|
|
SESSIONS_DIR = Path(os.environ.get("CHT_SESSIONS_DIR", DATA_DIR / "sessions"))
|
|
|
|
# Stream defaults
|
|
STREAM_HOST = "0.0.0.0"
|
|
STREAM_PORT = 4444
|
|
RELAY_PORT = 4445 # UDP loopback relay for live display
|
|
|
|
# Frame extraction — scene-only, no interval fallback
|
|
SCENE_THRESHOLD = 0.10 # 0-1, lower = more sensitive; 0.1 catches slide/window changes
|
|
SCENE_FLUSH_FRAMES = 2 # extra frames after scene change to flush encoder/muxer buffer (0 to disable)
|
|
|
|
# Segment recording
|
|
SEGMENT_DURATION = 60 # seconds per .ts segment
|
|
|
|
# Audio extraction
|
|
AUDIO_EXTRACT_INTERVAL = 3 # seconds between extraction cycles
|
|
AUDIO_SAFETY_MARGIN = 2 # seconds safety margin (matches scene detector)
|
|
WAVEFORM_BUCKET_MS = 50 # milliseconds per waveform peak bucket
|
|
|
|
# Transcription
|
|
WHISPER_MODEL = "medium" # "small" for speed, "medium" for accuracy
|
|
WHISPER_DEVICE = "cuda" # "cuda" or "cpu"
|
|
TRANSCRIBE_MIN_CHUNK_S = 5 # minimum seconds of audio before transcribing
|
|
TRANSCRIBE_LINES_PER_GROUP = 3 # whisper segments grouped per transcript ID (1-5)
|