Krita Source Code Documentation
Loading...
Searching...
No Matches
KisVideoExportOptionsDialog Class Reference

#include <VideoExportOptionsDialog.h>

+ Inheritance diagram for KisVideoExportOptionsDialog:

Classes

struct  Private
 

Public Types

enum  CodecPageIndex {
  CODEC_OPENH264 , CODEC_H264 , CODEC_H265 , CODEC_THEORA ,
  CODEC_VP9 , CODEC_GIF , CODEC_APNG , CODEC_WEBP ,
  CODEC_PRORES
}
 
enum  ContainerType {
  DEFAULT = 0 , MP4 = 0 , MKV , WEBM ,
  GIF , APNG , WEBP , OGV ,
  MOV , NUM_CONTAINER_TYPE
}
 

Public Member Functions

KisPropertiesConfigurationSP configuration () const override
 
QStringList customUserOptions () const
 
QString customUserOptionsString () const
 
 KisVideoExportOptionsDialog (ContainerType containerType, const QStringList &validEncoders, KisHDRMetadataOptions hdrOptions, QWidget *parent=0)
 
void setConfiguration (const KisPropertiesConfigurationSP config) override
 
void setHDRConfiguration (bool value)
 
void setSupportsHDR (bool value)
 
bool videoConfiguredForHDR () const
 
 ~KisVideoExportOptionsDialog () override
 
- Public Member Functions inherited from KisConfigWidget
virtual KoCanvasResourcesInterfaceSP canvasResourcesInterface () const
 
virtual void setCanvasResourcesInterface (KoCanvasResourcesInterfaceSP canvasResourcesInterface)
 
virtual void setView (KisViewManager *view)
 
 ~KisConfigWidget () override
 

Static Public Member Functions

static QVector< KoID > encoderIdentifiers (ContainerType type)
 
static ContainerType mimeToContainer (const QString &mimeType)
 

Private Slots

void slotBayerFilterSelected (int index)
 
void slotCodecSelected (int index)
 
void slotCustomLineToggled (bool value)
 
void slotH265ProfileChanged (int index)
 
void slotResetCustomLine ()
 
void slotSaveCustomLine ()
 

Private Member Functions

QString currentCodecId () const
 
QStringList generateCustomLine () const
 

Private Attributes

const QScopedPointer< Private > m_d
 
Ui::VideoExportOptionsDialog * ui
 

Additional Inherited Members

- Signals inherited from KisConfigWidget
void sigConfigurationItemChanged ()
 
void sigConfigurationUpdated ()
 
void sigDropLockedConfig (KisPropertiesConfigurationSP p)
 
void sigSaveLockedConfig (KisPropertiesConfigurationSP p)
 
- Protected Member Functions inherited from KisConfigWidget
 KisConfigWidget (QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags(), int delay=200)
 

Detailed Description

Definition at line 22 of file VideoExportOptionsDialog.h.

Member Enumeration Documentation

◆ CodecPageIndex

◆ ContainerType

Constructor & Destructor Documentation

◆ KisVideoExportOptionsDialog()

KisVideoExportOptionsDialog::KisVideoExportOptionsDialog ( ContainerType containerType,
const QStringList & validEncoders,
KisHDRMetadataOptions hdrOptions,
QWidget * parent = 0 )
explicit

Definition at line 139 of file VideoExportOptionsDialog.cpp.

140 : KisConfigWidget(parent),
141 ui(new Ui::VideoExportOptionsDialog),
142 m_d(new Private(containerType, validEncoders))
143{
144 ui->setupUi(this);
145
146 ui->intOpenH264bitrate->setRange(100, 10000);
147 ui->intOpenH264bitrate->setValue(5000);
148 ui->intOpenH264bitrate->setSuffix(i18nc("kilo-bits-per-second, video bitrate suffix", "kbps"));
149
150 ui->intCRFH264->setRange(0, 51);
151 ui->intCRFH264->setValue(28);
152
153 ui->intCRFH265->setRange(0, 51);
154 ui->intCRFH265->setValue(28);
155
156 populateComboWithKoIds(ui->cmbPresetH264, m_d->presetsXH264, 5);
157 populateComboWithKoIds(ui->cmbPresetH265, m_d->presetsXH264, 5);
158
159 populateComboWithKoIds(ui->cmbProfileH264, m_d->profilesXH264, 0);
160 populateComboWithKoIds(ui->cmbProfileH265, m_d->profilesXH265, 0);
161
162 populateComboWithKoIds(ui->cmbTuneH264, m_d->tuningXH264, 0);
163 populateComboWithKoIds(ui->cmbTuneH265, m_d->tuningXH265, 0);
164
165 ui->intBitrate->setRange(10, 50000);
166 ui->intBitrate->setValue(5000);
167 ui->intBitrate->setSuffix(i18nc("kilo-bits-per-second, video bitrate suffix", "kbps"));
168
169 // Alpha is stored in WebM/Matroska block additions, not in the VP9 stream
170 // itself. MP4 cannot carry this transparency data.
171 ui->vp9PreserveTransparency->setEnabled(containerType == WEBM || containerType == MKV);
172
173 ui->gifReserveTransparent->setChecked(true);
174 ui->gifLoop->setChecked(true);
175 ui->gifTransDiff->setChecked(true);
176
177 populateComboWithKoIds(ui->cmbPalettegenStatsModeGIF, m_d->paletteGenModeGIF, 0);
178 populateComboWithKoIds(ui->cmbPaletteuseDitherGIF, m_d->paletteDitherGIF, 5);
179 populateComboWithKoIds(ui->cmbPaletteuseDiffModeGIF, m_d->paletteDiffModeGIF, 0);
180
181 ui->intPaletteuseBayerScaleGIF->setRange(0, 5);
182 ui->intPaletteuseBayerScaleGIF->setValue(2);
183
184 ui->apngLoop->setChecked(true);
185
186 populateComboWithKoIds(ui->cmbPredAPNG, m_d->predAPNG, 0);
187
188 ui->intCompressWEBP->setRange(0, 6);
189 ui->intCompressWEBP->setValue(4);
190
191 ui->intQscaleWEBP->setRange(0, 100);
192 ui->intQscaleWEBP->setValue(75);
193
194 populateComboWithKoIds(ui->cmbPresetWEBP, m_d->presetsWEBP, 0);
195
196 ui->webpLoop->setChecked(true);
197
198 populateComboWithKoIds(ui->cmbCodec, m_d->encoders, 0);
199 connect(ui->cmbCodec, SIGNAL(currentIndexChanged(int)), SLOT(slotCodecSelected(int)));
201
202 // TODO: temporarily hidden! Some combinations of 'tune' and
203 // 'profile' options make ffmpeg generate empty file.
204 // We should not let the user shoot into his own foot!
205 ui->cmbTuneH264->setVisible(false);
206 ui->lblTuneH264->setVisible(false);
207
208 ui->cmbTuneH265->setVisible(false);
209 ui->lblTuneH265->setVisible(false);
210
212 connect(ui->chkCustomLine, SIGNAL(toggled(bool)), SLOT(slotCustomLineToggled(bool)));
213 connect(ui->txtCustomLine, SIGNAL(editingFinished()), SLOT(slotSaveCustomLine()));
214 connect(ui->btnResetCustomLine, SIGNAL(clicked()), SLOT(slotResetCustomLine()));
215
216 connect(ui->cmbProfileH265,
217 SIGNAL(currentIndexChanged(int)),
218 SLOT(slotH265ProfileChanged(int)));
219 slotH265ProfileChanged(ui->cmbProfileH265->currentIndex());
220
221
222 connect(ui->cmbPaletteuseDitherGIF,
223 SIGNAL(currentIndexChanged(int)),
224 SLOT(slotBayerFilterSelected(int)));
225
226 slotBayerFilterSelected(ui->cmbPaletteuseDitherGIF->currentIndex());
227
228 setSupportsHDR(false);
229 m_d->hdrMetadataOptions = hdrOptions;
230}
void populateComboWithKoIds(QComboBox *combo, const QVector< KoID > &ids, int defaultIndex)
KisConfigWidget(QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags(), int delay=200)
const QScopedPointer< Private > m_d
Ui::VideoExportOptionsDialog * ui

References m_d, MKV, populateComboWithKoIds(), setSupportsHDR(), slotBayerFilterSelected(), slotCodecSelected(), slotCustomLineToggled(), slotH265ProfileChanged(), slotResetCustomLine(), slotSaveCustomLine(), ui, and WEBM.

◆ ~KisVideoExportOptionsDialog()

KisVideoExportOptionsDialog::~KisVideoExportOptionsDialog ( )
override

Definition at line 232 of file VideoExportOptionsDialog.cpp.

233{
234 delete ui;
235}

References ui.

Member Function Documentation

◆ configuration()

KisPropertiesConfigurationSP KisVideoExportOptionsDialog::configuration ( ) const
overridevirtual
Returns
the configuration

Implements KisConfigWidget.

Definition at line 243 of file VideoExportOptionsDialog.cpp.

244{
246
247 cfg->setProperty("CodecId", currentCodecId());
248
249 cfg->setProperty("Openh264Bitrate", ui->intOpenH264bitrate->value());
250
251 cfg->setProperty("h264PresetIndex", ui->cmbPresetH264->currentIndex());
252 cfg->setProperty("h264ConstantRateFactor", ui->intCRFH264->value());
253 cfg->setProperty("h264ProfileIndex", ui->cmbProfileH264->currentIndex());
254 cfg->setProperty("h264TuneIndex", ui->cmbTuneH264->currentIndex());
255
256 cfg->setProperty("h265PresetIndex", ui->cmbPresetH265->currentIndex());
257 cfg->setProperty("h265ConstantRateFactor", ui->intCRFH265->value());
258 cfg->setProperty("h265ProfileIndex", ui->cmbProfileH265->currentIndex());
259 cfg->setProperty("h265TuneIndex", ui->cmbTuneH265->currentIndex());
260 cfg->setProperty("h265UseHDRMetadata", ui->chkUseHDRMetadata->isChecked());
261
262 cfg->setProperty("TheoraBitrate", ui->intBitrate->value());
263 cfg->setProperty("vp9PreserveTransparency", ui->vp9PreserveTransparency->isChecked());
264 cfg->setProperty("vp9Lossless", ui->vp9Lossless->isChecked());
265 cfg->setProperty("vp9Mbits", ui->vp9Mbits->value());
266 cfg->setProperty("CustomLineValue", ui->txtCustomLine->text());
267 cfg->setProperty("customUserOptions", customUserOptions().join(' '));
268
269 cfg->setPrefixedProperties("hdrMetadata/", m_d->hdrMetadataOptions.toProperties());
270
271 return cfg;
272}

References currentCodecId(), customUserOptions(), m_d, and ui.

◆ currentCodecId()

QString KisVideoExportOptionsDialog::currentCodecId ( ) const
private

Definition at line 581 of file VideoExportOptionsDialog.cpp.

582{
583 return m_d->encoders[ui->cmbCodec->currentIndex()].id();
584}

References m_d, and ui.

◆ customUserOptions()

QStringList KisVideoExportOptionsDialog::customUserOptions ( ) const

Definition at line 391 of file VideoExportOptionsDialog.cpp.

392{
393 return ui->chkCustomLine->isChecked() ?
394 ui->txtCustomLine->text().split(" ", Qt::SkipEmptyParts) :
396}

References generateCustomLine(), and ui.

◆ customUserOptionsString()

QString KisVideoExportOptionsDialog::customUserOptionsString ( ) const

Definition at line 398 of file VideoExportOptionsDialog.cpp.

399{
400 return customUserOptions().join(' ');
401}

References customUserOptions().

◆ encoderIdentifiers()

QVector< KoID > KisVideoExportOptionsDialog::encoderIdentifiers ( ContainerType type)
static

Definition at line 295 of file VideoExportOptionsDialog.cpp.

296{
297 KIS_ASSERT(type < ContainerType::NUM_CONTAINER_TYPE && type >= ContainerType::DEFAULT);
298 QVector<KoID> encoders;
299 QVector<KoID> h264Encoders = {
300 KoID("libopenh264", i18nc("openh264 codec name", "OpenH264")),
301 KoID("libx264", i18nc("h264 codec name, check simplescreenrecorder for standard translations", "H.264, MPEG-4 Part 10")),
302 KoID("libx265", i18nc("h265 codec name, check simplescreenrecorder for standard translations", "H.265, MPEG-H Part 2 (HEVC)"))
303 };
304
305 KoID vp9Encoder = KoID("libvpx-vp9", i18nc("VP9 codec name", "VP9"));
306
307
308 switch (type) {
310 encoders << KoID("prores_ks", i18nc("ProRes codec name", "ProRes 4444 (with transparency)"));
311 break;
313 encoders << KoID("libtheora", i18nc("theora codec name, check simplescreenrecorder for standard translations", "Theora"));
314 break;
316 encoders << KoID("libwebp", i18nc("WEBP codec name", "WEBP"));
317 break;
319 encoders << KoID("apng", i18nc("APNG codec name", "APNG"));
320 break;
322 encoders << KoID("gif", i18nc("GIF codec name", "GIF"));
323 break;
325 encoders << vp9Encoder;
326 break;
329 default:
330 encoders << h264Encoders;
331 encoders << vp9Encoder;
332 break;
333 }
334
335 return encoders;
336}
Definition KoID.h:30
#define KIS_ASSERT(cond)
Definition kis_assert.h:33

References APNG, DEFAULT, GIF, KIS_ASSERT, MKV, MOV, MP4, OGV, WEBM, and WEBP.

◆ generateCustomLine()

QStringList KisVideoExportOptionsDialog::generateCustomLine ( ) const
private

Definition at line 468 of file VideoExportOptionsDialog.cpp.

469{
470 QStringList options;
471
472 if (currentCodecId() == "libopenh264") {
473 options << "-c:v" << "libopenh264";
474 options << "-b:v" << QString::number(ui->intOpenH264bitrate->value()) + "k";
475 } else if (currentCodecId() == "libx264") {
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 // Disabled! see the comment in c-tor!
493 //const int tuneIndex = ui->cmbTune->currentIndex();
494 //options << "-tune" << m_d->tunes[tuneIndex].id();
495
496 } else if (currentCodecId() == "libx265") {
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 {
521 KIS_SAFE_ASSERT_RECOVER_NOOP(0 && "Unknown profile selected for h265 encoder");
522 }
523
524 if (enableHDR) {
525 const QString metadataLine = m_d->hdrMetadataOptions.generateFFMpegOptions();
526 options << metadataLine.split(" ");
527 }
528
529 } else if (currentCodecId() == "libtheora") {
530 options << "-b" << QString::number(ui->intBitrate->value()) + "k";
531 } else if (currentCodecId() == "prores_ks") {
532 options << "-c:v" << "prores_ks"
533 << "-profile:v" << "4"
534 << "-pix_fmt" << "yuva444p10le";
535 } else if (currentCodecId() == "libvpx-vp9") {
536 options << "-c:v" << currentCodecId();
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 }
545 } else if (currentCodecId() == "gif") {
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
559 } else if (currentCodecId() == "apng") {
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
566 } else if (currentCodecId() == "libwebp") {
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)
Definition kis_assert.h:130

References currentCodecId(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, MKV, ui, and WEBM.

◆ mimeToContainer()

KisVideoExportOptionsDialog::ContainerType KisVideoExportOptionsDialog::mimeToContainer ( const QString & mimeType)
static

Definition at line 274 of file VideoExportOptionsDialog.cpp.

275{
276 if (mimeType == "video/webm") {
277 return ContainerType::WEBM;
278 } else if (mimeType == "video/x-matroska") {
279 return ContainerType::MKV;
280 } else if (mimeType == "video/quicktime") {
281 return ContainerType::MOV;
282 } else if (mimeType == "video/ogg") {
283 return ContainerType::OGV;
284 } else if (mimeType == "image/gif") {
285 return ContainerType::GIF;
286 } else if (mimeType == "image/apng") {
287 return ContainerType::APNG;
288 } else if (mimeType == "image/webp") {
289 return ContainerType::WEBP;
290 }
291
293}

References APNG, DEFAULT, GIF, MKV, MOV, OGV, WEBM, and WEBP.

◆ setConfiguration()

void KisVideoExportOptionsDialog::setConfiguration ( const KisPropertiesConfigurationSP config)
overridevirtual
Parameters
configthe configuration for this configuration widget.

Implements KisConfigWidget.

Definition at line 435 of file VideoExportOptionsDialog.cpp.

436{
437 ui->intOpenH264bitrate->setValue(cfg->getInt("Openh264Bitrate", 5000));
438
439 ui->cmbPresetH264->setCurrentIndex(cfg->getInt("h264PresetIndex", 5));
440 ui->intCRFH264->setValue(cfg->getInt("h264ConstantRateFactor", 23));
441 ui->cmbProfileH264->setCurrentIndex(cfg->getInt("h264ProfileIndex", 0));
442 ui->cmbTuneH264->setCurrentIndex(cfg->getInt("h264TuneIndex", 1));
443
444 ui->cmbPresetH265->setCurrentIndex(cfg->getInt("h265PresetIndex", 5));
445 ui->intCRFH265->setValue(cfg->getInt("h265ConstantRateFactor", 23));
446 ui->cmbProfileH265->setCurrentIndex(cfg->getInt("h265ProfileIndex", 0));
447 ui->cmbTuneH265->setCurrentIndex(cfg->getInt("h265TuneIndex", 1));
448 ui->chkUseHDRMetadata->setChecked(cfg->getBool("h265UseHDRMetadata", false));
449
450 ui->intBitrate->setValue(cfg->getInt("TheoraBitrate", 5000));
451 ui->vp9PreserveTransparency->setChecked(cfg->getBool("vp9PreserveTransparency", false));
452 ui->vp9Lossless->setChecked(cfg->getBool("vp9Lossless", false));
453 ui->vp9Mbits->setValue(cfg->getInt("vp9Mbits", 2));
454
455 m_d->currentCustomLine = cfg->getString("CustomLineValue", QString());
456 ui->chkCustomLine->setChecked(!m_d->currentCustomLine.isEmpty());
457 slotCustomLineToggled(ui->chkCustomLine->isChecked());
458
459 const QString codecId = cfg->getString("CodecId", "");
460
461 const int index = qMax(0, findIndexById(codecId, m_d->encoders));
462 ui->cmbCodec->setCurrentIndex(index);
463 slotCodecSelected(index);
464
465 slotH265ProfileChanged(ui->cmbProfileH265->currentIndex());
466}
int findIndexById(const QString &id, const QVector< KoID > &ids)

References findIndexById(), m_d, slotCodecSelected(), slotCustomLineToggled(), slotH265ProfileChanged(), and ui.

◆ setHDRConfiguration()

void KisVideoExportOptionsDialog::setHDRConfiguration ( bool value)

Definition at line 410 of file VideoExportOptionsDialog.cpp.

410 {
411 if (value && currentCodecId() != "libx265") {
412 ui->cmbCodec->setCurrentIndex(m_d->encoders.indexOf(KoID("libx265")));
413 ui->chkUseHDRMetadata->setEnabled(true);
414 }
415
416 //If HDR is enabled && the codec id is correct, we need to use main10.
417 if (value && currentCodecId() == "libx265") {
418 ui->cmbProfileH265->setCurrentIndex(m_d->profilesXH265.indexOf(KoID("main10")));
419 }
420
421 ui->chkUseHDRMetadata->setChecked(value);
422}

References currentCodecId(), m_d, ui, and value().

◆ setSupportsHDR()

void KisVideoExportOptionsDialog::setSupportsHDR ( bool value)

Definition at line 237 of file VideoExportOptionsDialog.cpp.

238{
239 m_d->supportsHDR = value;
240 slotH265ProfileChanged(ui->cmbProfileH265->currentIndex());
241}

References m_d, slotH265ProfileChanged(), ui, and value().

◆ slotBayerFilterSelected

void KisVideoExportOptionsDialog::slotBayerFilterSelected ( int index)
privateslot

Definition at line 606 of file VideoExportOptionsDialog.cpp.

607{
608 const bool enableBayer = m_d->paletteDitherGIF[ index ].id() == "bayer";
609 ui->lblPaletteuseBayerScaleGIF->setEnabled( enableBayer );
610 ui->intPaletteuseBayerScaleGIF->setEnabled( enableBayer );
611}

References m_d, and ui.

◆ slotCodecSelected

void KisVideoExportOptionsDialog::slotCodecSelected ( int index)
privateslot

Definition at line 362 of file VideoExportOptionsDialog.cpp.

363{
364 const QString codec = m_d->encoders[index].id();
365 if (codec == "libopenh264") {
366 ui->stackedWidget->setCurrentIndex(CODEC_OPENH264);
367 } else if (codec == "libx264") {
368 ui->stackedWidget->setCurrentIndex(CODEC_H264);
369 } else if (codec == "libx265") {
370 ui->stackedWidget->setCurrentIndex(CODEC_H265);
371 } else if (codec == "libtheora") {
372 ui->stackedWidget->setCurrentIndex(CODEC_THEORA);
373 } else if (codec == "libvpx-vp9") {
374 ui->stackedWidget->setCurrentIndex(CODEC_VP9);
375 } else if (codec == "gif") {
376 ui->stackedWidget->setCurrentIndex(CODEC_GIF);
377 } else if (codec == "apng") {
378 ui->stackedWidget->setCurrentIndex(CODEC_APNG);
379 } else if (codec == "libwebp") {
380 ui->stackedWidget->setCurrentIndex(CODEC_WEBP);
381 } else if (codec == "prores_ks") {
382 ui->stackedWidget->setCurrentIndex(CODEC_PRORES);
383 }
384}

References CODEC_APNG, CODEC_GIF, CODEC_H264, CODEC_H265, CODEC_OPENH264, CODEC_PRORES, CODEC_THEORA, CODEC_VP9, CODEC_WEBP, m_d, and ui.

◆ slotCustomLineToggled

void KisVideoExportOptionsDialog::slotCustomLineToggled ( bool value)
privateslot

Definition at line 338 of file VideoExportOptionsDialog.cpp.

339{
340 QString customLine = m_d->currentCustomLine;
341
342 if (m_d->currentCustomLine.isEmpty() && value) {
343 customLine = generateCustomLine().join(" ");
344 } else if (!value) {
345 customLine = QString();
346 m_d->currentCustomLine = QString();
347 }
348
349 ui->txtCustomLine->setText(customLine);
350
351 ui->stackedWidget->setEnabled(!value);
352 ui->txtCustomLine->setEnabled(value);
353 ui->btnResetCustomLine->setEnabled(value);
354}

References generateCustomLine(), m_d, ui, and value().

◆ slotH265ProfileChanged

void KisVideoExportOptionsDialog::slotH265ProfileChanged ( int index)
privateslot

Definition at line 586 of file VideoExportOptionsDialog.cpp.

587{
588 const bool enableHDR =
589 m_d->supportsHDR &&
590 index >= 0 &&
591 m_d->profilesXH265[index].id() == "main10";
592
593 ui->chkUseHDRMetadata->setEnabled(enableHDR);
594
595 QString hdrToolTip;
596
597 if (!m_d->supportsHDR) {
598 hdrToolTip = i18nc("@info:tooltip", "Exported animation format does not support HDR");
599 } else if (!enableHDR) {
600 hdrToolTip = i18nc("@info:tooltip", "HDR metadata available only with \"main10\" profile");
601 }
602
603 ui->chkUseHDRMetadata->setToolTip(hdrToolTip);
604}

References m_d, and ui.

◆ slotResetCustomLine

void KisVideoExportOptionsDialog::slotResetCustomLine ( )
privateslot

Definition at line 356 of file VideoExportOptionsDialog.cpp.

357{
358 ui->txtCustomLine->setText(generateCustomLine().join(" "));
360}

References generateCustomLine(), slotSaveCustomLine(), and ui.

◆ slotSaveCustomLine

void KisVideoExportOptionsDialog::slotSaveCustomLine ( )
privateslot

Definition at line 386 of file VideoExportOptionsDialog.cpp.

387{
388 m_d->currentCustomLine = ui->txtCustomLine->text();
389}

References m_d, and ui.

◆ videoConfiguredForHDR()

bool KisVideoExportOptionsDialog::videoConfiguredForHDR ( ) const

Definition at line 403 of file VideoExportOptionsDialog.cpp.

404{
405 return currentCodecId() == "libx265" &&
406 ui->chkUseHDRMetadata->isEnabled() &&
407 ui->chkUseHDRMetadata->isChecked();
408}

References currentCodecId(), and ui.

Member Data Documentation

◆ m_d

const QScopedPointer<Private> KisVideoExportOptionsDialog::m_d
private

Definition at line 89 of file VideoExportOptionsDialog.h.

◆ ui

Ui::VideoExportOptionsDialog* KisVideoExportOptionsDialog::ui
private

Definition at line 80 of file VideoExportOptionsDialog.h.


The documentation for this class was generated from the following files: