From 9fe19197ddf44a2f4817bb1a9e25de8577b96c21 Mon Sep 17 00:00:00 2001 From: Bart Date: Thu, 6 Aug 2026 10:27:15 +0200 Subject: [PATCH] Raise RTMP max_message so 4K keyframes are not dropped nginx-rtmp's default max_message is 1 MB, sized for typical broadcast bitrates and GOPs, not 4K H.264 keyframes, which can exceed it. When that happens the relay drops the publish outright with "too big message" before the exec'd ffmpeg ever receives a frame, which looks like an ffmpeg/config problem but is actually the relay refusing the input. Raised to 10 MB, comfortably above a realistic 4K keyframe at typical streaming bitrates, on the same listen block in both transcoder configs. Verified against a 4K H.264 publish that reliably hit "too big message" at the 1 MB default and transcodes cleanly at 10 MB. --- nginx-transcoder/nginx-no-ssl.conf | 4 ++++ nginx-transcoder/nginx.conf | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/nginx-transcoder/nginx-no-ssl.conf b/nginx-transcoder/nginx-no-ssl.conf index 04cf802..9e67443 100644 --- a/nginx-transcoder/nginx-no-ssl.conf +++ b/nginx-transcoder/nginx-no-ssl.conf @@ -13,6 +13,10 @@ rtmp { listen ${RTMP_PORT}; chunk_size 4000; notify_method get; + # 4K (and larger) H.264 keyframes can exceed nginx-rtmp's 1 MB default + # max_message, which drops the publish with "too big message" before + # ffmpeg ever sees a frame. Raise it well above a realistic keyframe size. + max_message 10M; application live { live on; diff --git a/nginx-transcoder/nginx.conf b/nginx-transcoder/nginx.conf index 95116a4..45eea1f 100644 --- a/nginx-transcoder/nginx.conf +++ b/nginx-transcoder/nginx.conf @@ -13,6 +13,10 @@ rtmp { listen ${RTMP_PORT}; chunk_size 4000; notify_method get; + # 4K (and larger) H.264 keyframes can exceed nginx-rtmp's 1 MB default + # max_message, which drops the publish with "too big message" before + # ffmpeg ever sees a frame. Raise it well above a realistic keyframe size. + max_message 10M; application live { live on;