From da7a74d54365370428cdfcda04c033dd43c4be2b Mon Sep 17 00:00:00 2001 From: rigaya Date: Fri, 22 Nov 2024 11:32:29 +0900 Subject: [PATCH] =?UTF-8?q?y4m=E5=87=BA=E5=8A=9B=E6=99=82=E3=81=AE?= =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=81=AE=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NVEncCore/rgy_output.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NVEncCore/rgy_output.cpp b/NVEncCore/rgy_output.cpp index e72a7976..20bc33e0 100644 --- a/NVEncCore/rgy_output.cpp +++ b/NVEncCore/rgy_output.cpp @@ -921,7 +921,13 @@ RGY_ERR RGYOutFrame::WriteNextFrame(RGYFrame *pSurface) { if (m_bY4m) { if (!m_y4mHeaderWritten) { - WriteY4MHeader(m_fDest.get(), &m_VideoOutputInfo, pSurface->csp()); + auto csp = pSurface->csp(); + if (csp == RGY_CSP_NV12) { + csp = RGY_CSP_YV12; + } else if (csp == RGY_CSP_P010) { + csp = RGY_CSP_YV12_16; + } + WriteY4MHeader(m_fDest.get(), &m_VideoOutputInfo, csp); m_y4mHeaderWritten = true; } WRITE_CHECK(fwrite("FRAME\n", 1, strlen("FRAME\n"), m_fDest.get()), strlen("FRAME\n"));