Force GPU transcoding (h264_nvenc) for Live TV when GPU toggle is enabled

This commit is contained in:
Michael committed 2026-01-01 23:19:48 +01:00
1 parent 363fa14453
commit a00d5ae4da
1 file changed
+10 -3
+10 -3
View File
@@ -194,15 +194,22 @@ Handler createLiveStreamHandler(
// Output encoding options
if (useNvidiaGpu) {
// With GPU: Use NVENC for any re-encoding needed
// With GPU: Transcode using NVIDIA NVENC for hardware acceleration
print('[Live] Transcoding video with h264_nvenc (GPU)');
ffmpegArgs.addAll([
'-c:v', 'copy', // Still copy video (no transcode needed for live)
'-c:v', 'h264_nvenc', // Use NVIDIA NVENC encoder
'-preset', 'p4', // Good quality/speed balance (p1=fastest, p7=best)
'-tune', 'll', // Low latency tuning for live streams
'-rc', 'vbr', // Variable bitrate
'-cq', '23', // Quality level (similar to CRF)
'-maxrate', '6000k', // Max bitrate for live
'-bufsize', '12000k', // Buffer size
'-c:a', 'aac', // Audio to AAC (browser compatible)
'-b:a', '192k',
'-ac', '2',
]);
} else {
// Without GPU: Standard CPU processing
// Without GPU: Standard CPU processing (copy video)
ffmpegArgs.addAll([
'-c:v', 'copy', // Video: Direct copy (Very low CPU)
'-c:a', 'aac', // Audio: Transcode to AAC