HLS/previews: rerun on the CPU when the GPU can't be used right now #216

Merged
cameron merged 1 commits from fix/hls-gpu-fallback into master 2026-11-02 21:22:33 +00:00
1 Commits
Author SHA1 Message Date
Cameron CordesandClaude Opus 5.5 8e6de37345 HLS/previews: rerun on the CPU when the GPU can't be used right now
A busy GPU (llama-swap holding the 3090) made ffmpeg's CUDA setup fail
with CUDA_ERROR_OUT_OF_MEMORY, exit 187. The playlist generator took
that for a bad file and wrote playlist.unsupported, so the video never
played; preview clips were marked failed the same way.

is_gpu_init_failure() recognises CUDA/NVENC setup errors in ffmpeg's
stderr. When an NVENC run fails that way, the playlist and the preview
clip rerun once on libx264. A file that also fails on the CPU still gets
the sentinel. The HLS command and the timed run are pulled out of the
handler (hls_command, run_ffmpeg) so both attempts share them.

Fixes #215

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 15:25:19 -05:00