From 0cda408d3c152aa3dc14bd49bac633bff2c6e493 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 4 Apr 2020 12:36:09 -0700 Subject: [PATCH] Warn when streaming above 4K with H.264 or 8K with HEVC --- src/Connection.c | 12 +++++++++++- src/RtspConnection.c | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Connection.c b/src/Connection.c index 72dec5e..41f2fbd 100644 --- a/src/Connection.c +++ b/src/Connection.c @@ -211,11 +211,21 @@ int LiStartConnection(PSERVER_INFORMATION serverInfo, PSTREAM_CONFIGURATION stre // Height must not be odd or NVENC will fail to initialize if (StreamConfig.height & 0x1) { - Limelog("Encoder height must not be odd. Rounding %d to %d", + Limelog("Encoder height must not be odd. Rounding %d to %d\n", StreamConfig.height, StreamConfig.height & ~0x1); StreamConfig.height = StreamConfig.height & ~0x1; } + + // Dimensions over 4096 are only supported with HEVC on NVENC + if (!StreamConfig.supportsHevc && + (StreamConfig.width > 4096 || StreamConfig.height > 4096)) { + Limelog("WARNING: Streaming at resolutions above 4K using H.264 will likely fail! Trying anyway!\n"); + } + // Dimensions over 8192 aren't supported at all (even on Turing) + else if (StreamConfig.width > 8192 || StreamConfig.height > 8192) { + Limelog("WARNING: Streaming at resolutions above 8K will likely fail! Trying anyway!\n"); + } // Extract the appversion from the supplied string if (extractVersionQuadFromString(serverInfo->serverInfoAppVersion, diff --git a/src/RtspConnection.c b/src/RtspConnection.c index 7dd7199..ed2faf6 100644 --- a/src/RtspConnection.c +++ b/src/RtspConnection.c @@ -718,6 +718,11 @@ int performRtspHandshake(void) { } else { NegotiatedVideoFormat = VIDEO_FORMAT_H264; + + // Dimensions over 4096 are only supported with HEVC on NVENC + if (StreamConfig.width > 4096 || StreamConfig.height > 4096) { + Limelog("WARNING: Host PC doesn't support HEVC. Streaming at resolutions above 4K using H.264 will likely fail!\n"); + } } // Parse the Opus surround parameters out of the RTSP DESCRIBE response.