469{
471
473 options << "-c:v" << "libopenh264";
474 options <<
"-b:v" << QString::number(
ui->intOpenH264bitrate->value()) +
"k";
476 options <<
"-crf" << QString::number(
ui->intCRFH264->value());
477
478 const int presetIndex =
ui->cmbPresetH264->currentIndex();
479 options <<
"-preset" <<
m_d->presetsXH264[presetIndex].id();
480
481 const int profileIndex =
ui->cmbProfileH264->currentIndex();
482 options <<
"-profile:v" <<
m_d->profilesXH264[profileIndex].id();
483
484 if (
m_d->profilesXH264[profileIndex].id() ==
"high422") {
485 options << "-pix_fmt" << "yuv422p";
486 }
else if (
m_d->profilesXH264[profileIndex].id() ==
"high444") {
487 options << "-pix_fmt" << "yuv444p";
488 } else {
489 options << "-pix_fmt" << "yuv420p";
490 }
491
492
493
494
495
497 const bool enableHDR =
498 ui->chkUseHDRMetadata->isEnabled() &&
499 ui->chkUseHDRMetadata->isChecked();
500
501 if (enableHDR) {
502 options << "-colorspace" << "bt2020nc"
503 << "-color_trc" << "smpte2084"
504 << "-color_primaries" << "bt2020";
505 }
506
507 options << "-c:v" << "libx265";
508 options <<
"-crf" << QString::number(
ui->intCRFH265->value());
509
510 const int presetIndex =
ui->cmbPresetH265->currentIndex();
511 options <<
"-preset" <<
m_d->presetsXH264[presetIndex].id();
512
513 const int profileIndex =
ui->cmbProfileH265->currentIndex();
514 options <<
"-profile:v" <<
m_d->profilesXH265[profileIndex].id();
515
516 if (
m_d->profilesXH265[profileIndex].id() ==
"main") {
517 options << "-pix_fmt" << "yuv420p";
518 }
else if (
m_d->profilesXH265[profileIndex].id() ==
"main10") {
519 options << "-pix_fmt" << "yuv420p10le";
520 } else {
522 }
523
524 if (enableHDR) {
525 const QString metadataLine =
m_d->hdrMetadataOptions.generateFFMpegOptions();
526 options << metadataLine.split(" ");
527 }
528
530 options <<
"-b" << QString::number(
ui->intBitrate->value()) +
"k";
532 options << "-c:v" << "prores_ks"
533 << "-profile:v" << "4"
534 << "-pix_fmt" << "yuva444p10le";
537 const bool preserveTransparency = (
m_d->containerType ==
WEBM ||
m_d->containerType ==
MKV)
538 &&
ui->vp9PreserveTransparency->isChecked();
539 options << "-pix_fmt" << (preserveTransparency ? "yuva420p" : "yuv420p");
540 if (
ui->vp9Lossless->isChecked()) {
541 options << "-lossless" << "1";
542 } else {
543 options <<
"-b:v" << QString::number(
ui->vp9Mbits->value()) +
"M";
544 }
546 const QString ditherFilterString =
m_d->paletteDitherGIF[
ui->cmbPaletteuseDitherGIF->currentIndex() ].id();
547
548 options << "-f" << "gif"
549 <<
"-loop" << (
ui->gifLoop->isChecked() ?
"0":
"-1" )
550 <<
"-gifflags" << (
ui->gifTransDiff->isChecked() ?
"+transdiff":
"-transdiff" )
551 << "-palettegen" << QString("palettegen=stats_mode=%1%2")
552 .arg(
m_d->paletteGenModeGIF[
ui->cmbPalettegenStatsModeGIF->currentIndex() ].id())
553 .arg(
":reserve_transparent=" + QString(
ui->gifReserveTransparent->isChecked() ?
"1":
"0"))
554 << "-lavfi" << QString("[0:v][1:v]paletteuse=dither=%1%2%3")
555 .arg(ditherFilterString)
556 .arg(ditherFilterString ==
"bayer" ? (QString(
":bayer_scale=%1").arg(
ui->intPaletteuseBayerScaleGIF->
value()) ):
"" )
557 .arg(
":diff_mode=" +
m_d->paletteDiffModeGIF[
ui->cmbPaletteuseDiffModeGIF->currentIndex() ].id() );
558
560 const int predIndex =
ui->cmbPredAPNG->currentIndex();
561
562 options << "-f" << "apng"
563 <<
"-pred" <<
m_d->predAPNG[predIndex].id()
564 <<
"-plays" << (
ui->apngLoop->isChecked() ?
"0":
"1" );
565
567 const int presetIndex =
ui->cmbPresetWEBP->currentIndex();
568
569 options << "-f" << "webp"
570 <<
"-lossless" << (
ui->webpLossless->isChecked() ?
"1":
"0" )
571 <<
"-compression_level" << QString::number(
ui->intCompressWEBP->value())
572 <<
"-q:v" << QString::number(
ui->intQscaleWEBP->value())
573 <<
"-preset" <<
m_d->presetsWEBP[presetIndex].id()
574 <<
"-loop" << (
ui->webpLoop->isChecked() ?
"0":
"1" );
575
576 }
577
578 return options;
579}
float value(const T *src, size_t ch)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)