From f10c6b736d8912d52a718438fed7f63d4c993aac Mon Sep 17 00:00:00 2001 From: jcdr428 <56721609+jcdr428@users.noreply.github.com> Date: Tue, 5 Jul 2022 21:01:36 +0100 Subject: [PATCH] Take sub fps from video even when video is not selected Subtitle fps should be taken from the video stream even if this video stream is not checked. Also, SUP subtitle image should be limited to 1920x1080. --- tsMuxerGUI/tsmuxerwindow.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tsMuxerGUI/tsmuxerwindow.cpp b/tsMuxerGUI/tsmuxerwindow.cpp index 044e821..a95486f 100644 --- a/tsMuxerGUI/tsmuxerwindow.cpp +++ b/tsMuxerGUI/tsmuxerwindow.cpp @@ -1747,19 +1747,16 @@ QString TsMuxerWindow::getSrtParams() for (int i = 0; i < ui->trackLV->rowCount(); ++i) { - if (ui->trackLV->item(i, 0)->checkState() == Qt::Checked) - { - auto codecInfo = getCodecInfo(i); - if (!codecInfo) - continue; + auto codecInfo = getCodecInfo(i); + if (!codecInfo) + continue; - if (isVideoCodec(codecInfo->displayName)) - { - rez += QString(",video-width=") + QString::number(codecInfo->width); - rez += QString(",video-height=") + QString::number(codecInfo->height); - rez += QString(",fps=") + fpsTextToFpsStr(codecInfo->fpsText); - return rez; - } + if (isVideoCodec(codecInfo->displayName)) + { + rez += QString(",video-width=") + QString::number(std::min(codecInfo->width, 1920)); + rez += QString(",video-height=") + QString::number(std::min(codecInfo->height, 1080)); + rez += QString(",fps=") + fpsTextToFpsStr(codecInfo->fpsText); + return rez; } } rez += ",video-width=1920,video-height=1080,fps=23.976";