Skip to content

Commit 4a23774

Browse files
committed
Fix 10-bit H.264 hardware encode fails
I do not know any hardware encoder that supports 10-bit or if so extremely rare. So, make that combination ignore the hardware encoder option and use x264. https://forum.shotcut.org/t/error-exporting-with-h264-amf-codec/51576
1 parent ef00b2b commit 4a23774

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/docks/encodedock.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ void EncodeDock::loadPresetFromProperties(Mlt::Properties &preset)
211211
ui->metaLanguageLineEdit->clear();
212212

213213
if (ui->hwencodeCheckBox->isChecked()) {
214-
foreach (const QString &hw, Settings.encodeHardware()) {
215-
if ((vcodec == "libx264" && hw.startsWith("h264"))
214+
const bool is10bit = QString::fromLatin1(preset.get("pix_fmt")).contains("p10le");
215+
for (const QString &hw : Settings.encodeHardware()) {
216+
if ((vcodec == "libx264" && hw.startsWith("h264") && !is10bit)
216217
|| (vcodec == "libx265" && hw.startsWith("hevc"))
217218
|| (vcodec == "libvpx-vp9" && hw.startsWith("vp9"))
218219
|| (vcodec == "libsvtav1" && hw.startsWith("av1"))) {

0 commit comments

Comments
 (0)