-- 0010_media_probe.sql — record the codec facts a client needs to choose direct -- play. -- -- Vellum does not transcode. The server has no spare CPU, and measured against -- real files, playability turned out to be a property of the CLIENT, not the -- file: Chrome on Linux plays an MKV carrying H.264 perfectly well, yet cannot -- decode an MP4 carrying HEVC at all — it plays the audio track and reports -- videoWidth 0. So the server's job is only to expose what is actually inside -- each file and let every client decide for itself. These columns are that -- exposure; without them a client has nothing to base the decision on. -- -- The values come from ffprobe at scan time. They are empty/zero until the -- scanner probes the file, and stay that way when ffprobe is not installed: -- Vellum still works without it, just with less information. duration_ms -- already exists on media_files from 0001, so it is reused rather than re-added. -- ffprobe codec name, e.g. "h264", "hevc", "vp9", "av1". "" when there is no -- video track (audio, or embedded cover art only). ALTER TABLE media_files ADD COLUMN vcodec TEXT NOT NULL DEFAULT ''; -- ffprobe codec name, e.g. "aac", "opus", "flac", "mp3". "" when there is no -- audio track. ALTER TABLE media_files ADD COLUMN acodec TEXT NOT NULL DEFAULT ''; -- Pixel dimensions of the video track; 0 when there is none. ALTER TABLE media_files ADD COLUMN width INTEGER NOT NULL DEFAULT 0; ALTER TABLE media_files ADD COLUMN height INTEGER NOT NULL DEFAULT 0; -- When the codec facts above were last written, so a rescan can be proven not -- to have re-probed an unchanged file. '' means never probed. ALTER TABLE media_files ADD COLUMN probed_at TEXT NOT NULL DEFAULT '';