Fix GPU encoding black frames and improve debug logging
Some checks are pending
GPU Worker CI/CD / test (push) Waiting to run
GPU Worker CI/CD / deploy (push) Blocked by required conditions

- Add CUDA sync before encoding to ensure RGB->NV12 kernel completes
- Add debug logging for frame data validation (sum check)
- Handle GPUFrame objects in GPUHLSOutput.write()
- Fix cv2.resize for CuPy arrays (use cupyx.scipy.ndimage.zoom)
- Fix fused pipeline parameter ordering (geometric first, color second)
- Add raindrop-style ripple with random position/freq/decay/amp
- Generate final VOD playlist with #EXT-X-ENDLIST

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-04 16:33:12 +00:00
parent b15e381f81
commit 9a8a701492
8 changed files with 471 additions and 37 deletions

View File

@@ -1028,7 +1028,24 @@ class StreamInterpreter:
if result is not None:
import cv2
if result.shape[:2] != (h, w):
result = cv2.resize(result, (w, h))
# Handle CuPy arrays - cv2 can't resize them directly
if hasattr(result, '__cuda_array_interface__'):
# Use GPU resize via cupyx.scipy
try:
import cupy as cp
from cupyx.scipy import ndimage as cpndimage
curr_h, curr_w = result.shape[:2]
zoom_y = h / curr_h
zoom_x = w / curr_w
if result.ndim == 3:
result = cpndimage.zoom(result, (zoom_y, zoom_x, 1), order=1)
else:
result = cpndimage.zoom(result, (zoom_y, zoom_x), order=1)
except ImportError:
# Fallback to CPU resize
result = cv2.resize(cp.asnumpy(result), (w, h))
else:
result = cv2.resize(result, (w, h))
out.write(result, self.ctx.t)
# Progress