Commit 2c7084d9 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix nvidia's proxy profile

parent 14134a11
......@@ -8,7 +8,7 @@ MPEG=qscale=4 ab=192k vcodec=mpeg2video acodec=mp2 threads=%threads;mpg
# proxy settings should be FFmpeg type parameters, like: -vcodec libx264
x264=-vf scale=640:-2 -vcodec libx264 -g 1 -bf 0 -vb 0 -crf 20 -preset veryfast -acodec aac -ab 128k;mov
x264-vaapi=-init_hw_device vaapi=vaapi0:,connection_type=x11 -filter_hw_device vaapi0 -vf format=nv12,hwupload -codec:v h264_vaapi -g 1 -bf 0 -qp 26 -acodec ac3 -ab 128k;mov
x264-nvenc=-hwaccel cuvid -c:v %nvcodec -i -vf scale_npp=640:-2 -vcodec h264_nvenc -g 1 -bf 0 -vb 0 -preset fast -acodec copy;mov
x264-nvenc=-vsync 0 -c:v %nvcodec -resize %frameSize -i -vcodec h264_nvenc -g 1 -bf 0 -acodec copy;mov
MPEG2=-vf scale=640:-2 -g 1 -bf 0 -vb 0 -qscale 6 -ab 128k -vcodec mpeg2video -acodec ac3;mpg
MJPEG=-vf yadif,scale=640:-2 -qscale 3 -vcodec mjpeg -acodec pcm_s16le;mkv
MJPEG-vaapi=-init_hw_device vaapi=vaapi0:,connection_type=x11 -filter_hw_device vaapi0 -vf format=nv12,hwupload -codec:v mjpeg_vaapi -codec:a copy;mkv
......
......@@ -100,6 +100,7 @@ bool ProxyJob::startJob()
parameter.prepend(QStringLiteral("-pix_fmt yuv420p"));
}
}
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList params = parameter.split(QLatin1Char('-'), QString::SkipEmptyParts);
#else
......@@ -253,7 +254,25 @@ bool ProxyJob::startJob()
QStringList supportedPixFmts{QStringLiteral("yuv420p"), QStringLiteral("yuyv422"), QStringLiteral("rgb24"),
QStringLiteral("bgr24"), QStringLiteral("yuv422p"), QStringLiteral("yuv444p"),
QStringLiteral("rgb32"), QStringLiteral("yuv410p"), QStringLiteral("yuv411p")};
bool supported = KdenliveSettings::nvScalingEnabled() && supportedCodecs.contains(codec) && supportedPixFmts.contains(pix_fmt);
// Check if the transcoded file uses a cuda supported codec (we don't check for specific cards so not 100% exact)
bool supported = supportedCodecs.contains(codec) && supportedPixFmts.contains(pix_fmt);
if (proxyParams.contains(QStringLiteral("scale_npp")) && !KdenliveSettings::nvScalingEnabled()) {
  • Note for packaging: for scale_npp to work ffmpeg needs to be compiled with "--enable-libnpp", "--enable-cuda-nvcc" and "--enable-nonfree" flags.

    Edited by Farid Abdelnour
Please register or sign in to reply
supported = false;
}
if (proxyParams.contains(QStringLiteral("%frameSize"))) {
int w = 640;
int h = 0;
int oW = binClip->getProducerProperty(QStringLiteral("meta.media.width")).toInt();
int oH = binClip->getProducerProperty(QStringLiteral("meta.media.height")).toInt();
if (oH > 0) {
h = w * oH / oW;
} else {
h = int(w / pCore->getCurrentDar());
}
h += h%2;
proxyParams.replace(QStringLiteral("%frameSize"), QString("%1x%2").arg(w).arg(h));
}
if (supported) {
// Full hardware decoding supported
codec.append(QStringLiteral("_cuvid"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment