Fix GPU encoding black frames and improve debug logging
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user