From 1ede9ef865d196af5d728840996d16037e869e20 Mon Sep 17 00:00:00 2001 From: rigaya Date: Sun, 4 Aug 2024 09:39:55 +0900 Subject: [PATCH] =?UTF-8?q?ivf=E5=BD=A2=E5=BC=8F=E3=81=A7=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=81=99=E3=82=8B=E9=9A=9B=E3=81=AF=E3=80=81timebase?= =?UTF-8?q?=E3=82=92fps=E3=81=AE=E9=80=86=E6=95=B0=E3=81=AB=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=80=82?= =?UTF-8?q?(=20#607=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NVEncCore/rgy_output_avcodec.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NVEncCore/rgy_output_avcodec.cpp b/NVEncCore/rgy_output_avcodec.cpp index 6a021ffa..3973fc94 100644 --- a/NVEncCore/rgy_output_avcodec.cpp +++ b/NVEncCore/rgy_output_avcodec.cpp @@ -78,6 +78,9 @@ static bool format_is_flv(const AVFormatContext *formatCtx) { static bool format_is_latm(const AVFormatContext *formatCtx) { return _stricmp(formatCtx->oformat->name, "latm") == 0; } +static bool format_is_ivf(const AVFormatContext *formatCtx) { + return _stricmp(formatCtx->oformat->name, "ivf") == 0; +} #if ENABLE_AVSW_READER #if USE_CUSTOM_IO @@ -861,6 +864,8 @@ RGY_ERR RGYOutputAvcodec::InitVideo(const VideoInfo *videoOutputInfo, const Avco m_Mux.video.streamOut->time_base = (av_isvalid_q(prm->bitstreamTimebase)) ? prm->bitstreamTimebase : av_inv_q(m_Mux.video.outputFps); if (m_Mux.format.isMatroska) { m_Mux.video.streamOut->time_base = av_make_q(1, 1000); + } else if (format_is_ivf(m_Mux.format.formatCtx)) { // ivf形式の時は、time_baseをfpsの逆数にしないといけない + m_Mux.video.streamOut->time_base = av_make_q(videoOutputInfo->fpsD, videoOutputInfo->fpsN); } m_Mux.video.streamOut->sample_aspect_ratio.num = videoOutputInfo->sar[0]; //mkvではこちらの指定も必要 m_Mux.video.streamOut->sample_aspect_ratio.den = videoOutputInfo->sar[1];