@@ -38,48 +38,85 @@ OutputSettingsDialog::OutputSettingsDialog(const OutputSettings &settings,
3838 setWindowTitle (tr (" Output Settings" ));
3939
4040 mSupportedFormats = {
41- FormatCodecs (QList<AVCodecID>() << AV_CODEC_ID_PNG ,
41+ FormatCodecs (QList<AVCodecID>()
42+ << AV_CODEC_ID_PNG
43+ << AV_CODEC_ID_TIFF
44+ << AV_CODEC_ID_MJPEG
45+ << AV_CODEC_ID_EXR ,
46+ QList<AVCodecID>(),
47+ " *.png" ),
48+ FormatCodecs (QList<AVCodecID>()
49+ << AV_CODEC_ID_GIF ,
4250 QList<AVCodecID>(),
43- " *.png" ),
44- FormatCodecs (QList<AVCodecID>() << AV_CODEC_ID_TIFF ,
45- QList<AVCodecID>(),
46- " *.tif" ),
47- FormatCodecs (QList<AVCodecID>() << AV_CODEC_ID_MJPEG << AV_CODEC_ID_LJPEG ,
48- QList<AVCodecID>(),
49- " *.jpg" ),
50- FormatCodecs (QList<AVCodecID>() << AV_CODEC_ID_EXR ,
51- QList<AVCodecID>(),
52- " *.exr" ),
53- FormatCodecs (QList<AVCodecID>() << AV_CODEC_ID_PRORES << AV_CODEC_ID_PNG << AV_CODEC_ID_QTRLE << AV_CODEC_ID_H264 ,
54- QList<AVCodecID>() << AV_CODEC_ID_MP3 << AV_CODEC_ID_AAC << AV_CODEC_ID_AC3 << AV_CODEC_ID_FLAC << AV_CODEC_ID_VORBIS << AV_CODEC_ID_WAVPACK ,
51+ " *.gif" ),
52+ FormatCodecs (QList<AVCodecID>()
53+ << AV_CODEC_ID_PRORES
54+ << AV_CODEC_ID_PNG
55+ << AV_CODEC_ID_H264
56+ << AV_CODEC_ID_HEVC
57+ << AV_CODEC_ID_QTRLE ,
58+ QList<AVCodecID>()
59+ << AV_CODEC_ID_MP3
60+ << AV_CODEC_ID_AAC
61+ << AV_CODEC_ID_PCM_S16LE
62+ << AV_CODEC_ID_PCM_S24LE
63+ << AV_CODEC_ID_PCM_F32LE ,
5564 " *.mov" ),
56- FormatCodecs (QList<AVCodecID>() << AV_CODEC_ID_H264 << AV_CODEC_ID_MPEG4 << AV_CODEC_ID_MPEG2VIDEO << AV_CODEC_ID_HEVC ,
57- QList<AVCodecID>() << AV_CODEC_ID_MP3 << AV_CODEC_ID_AAC << AV_CODEC_ID_AC3 << AV_CODEC_ID_FLAC << AV_CODEC_ID_VORBIS << AV_CODEC_ID_WAVPACK ,
65+ FormatCodecs (QList<AVCodecID>()
66+ << AV_CODEC_ID_H264
67+ << AV_CODEC_ID_HEVC
68+ << AV_CODEC_ID_AV1
69+ << AV_CODEC_ID_MPEG4 ,
70+ QList<AVCodecID>()
71+ << AV_CODEC_ID_AAC
72+ << AV_CODEC_ID_MP3
73+ << AV_CODEC_ID_OPUS
74+ << AV_CODEC_ID_FLAC ,
5875 " *.mp4" ),
59- FormatCodecs (QList<AVCodecID>() << AV_CODEC_ID_H264 << AV_CODEC_ID_MPEG4 << AV_CODEC_ID_MPEG2VIDEO << AV_CODEC_ID_HEVC ,
60- QList<AVCodecID>() << AV_CODEC_ID_MP3 << AV_CODEC_ID_AAC << AV_CODEC_ID_AC3 << AV_CODEC_ID_FLAC << AV_CODEC_ID_VORBIS << AV_CODEC_ID_WAVPACK ,
76+ FormatCodecs (QList<AVCodecID>()
77+ << AV_CODEC_ID_H264
78+ << AV_CODEC_ID_HEVC
79+ << AV_CODEC_ID_AV1
80+ << AV_CODEC_ID_PRORES
81+ << AV_CODEC_ID_PNG ,
82+ QList<AVCodecID>()
83+ << AV_CODEC_ID_AAC
84+ << AV_CODEC_ID_MP3
85+ << AV_CODEC_ID_OPUS
86+ << AV_CODEC_ID_FLAC
87+ << AV_CODEC_ID_VORBIS
88+ << AV_CODEC_ID_PCM_S16LE
89+ << AV_CODEC_ID_PCM_S24LE
90+ << AV_CODEC_ID_PCM_F32LE ,
6191 " *.mkv" ),
62- FormatCodecs (QList<AVCodecID>() << AV_CODEC_ID_H264 << AV_CODEC_ID_MPEG4 << AV_CODEC_ID_MPEG2VIDEO << AV_CODEC_ID_HEVC << AV_CODEC_ID_RAWVIDEO << AV_CODEC_ID_LJPEG ,
63- QList<AVCodecID>() << AV_CODEC_ID_MP3 << AV_CODEC_ID_AAC << AV_CODEC_ID_AC3 << AV_CODEC_ID_FLAC << AV_CODEC_ID_VORBIS << AV_CODEC_ID_WAVPACK ,
64- " *.avi" ),
65- FormatCodecs (QList<AVCodecID>() << AV_CODEC_ID_VP8 << AV_CODEC_ID_VP9 ,
66- QList<AVCodecID>() << AV_CODEC_ID_VORBIS << AV_CODEC_ID_OPUS ,
92+ FormatCodecs (QList<AVCodecID>()
93+ << AV_CODEC_ID_VP9
94+ << AV_CODEC_ID_AV1
95+ << AV_CODEC_ID_VP8 ,
96+ QList<AVCodecID>()
97+ << AV_CODEC_ID_OPUS
98+ << AV_CODEC_ID_VORBIS ,
6799 " *.webm" ),
68100 FormatCodecs (QList<AVCodecID>(),
69- QList<AVCodecID>() << AV_CODEC_ID_MP3 << AV_CODEC_ID_AAC << AV_CODEC_ID_AC3 << AV_CODEC_ID_FLAC << AV_CODEC_ID_VORBIS << AV_CODEC_ID_WAVPACK ,
101+ QList<AVCodecID>()
102+ << AV_CODEC_ID_MP3 ,
70103 " *.mp3" ),
71104 FormatCodecs (QList<AVCodecID>(),
72- QList<AVCodecID>() << AV_CODEC_ID_FLAC ,
105+ QList<AVCodecID>()
106+ << AV_CODEC_ID_FLAC ,
73107 " *.flac" ),
74108 FormatCodecs (QList<AVCodecID>(),
75- QList<AVCodecID>() << AV_CODEC_ID_MP3 << AV_CODEC_ID_AAC << AV_CODEC_ID_AC3 << AV_CODEC_ID_FLAC << AV_CODEC_ID_VORBIS << AV_CODEC_ID_WAVPACK << AV_CODEC_ID_PCM_U8 << AV_CODEC_ID_PCM_S16LE << AV_CODEC_ID_PCM_S24LE << AV_CODEC_ID_PCM_S32LE << AV_CODEC_ID_PCM_S64LE << AV_CODEC_ID_PCM_F32LE << AV_CODEC_ID_PCM_F64LE ,
109+ QList<AVCodecID>()
110+ << AV_CODEC_ID_PCM_S16LE
111+ << AV_CODEC_ID_PCM_S24LE
112+ << AV_CODEC_ID_PCM_F32LE ,
76113 " *.wav" ),
77114 FormatCodecs (QList<AVCodecID>(),
78- QList<AVCodecID>() << AV_CODEC_ID_MP3 << AV_CODEC_ID_AAC << AV_CODEC_ID_AC3 << AV_CODEC_ID_FLAC << AV_CODEC_ID_VORBIS << AV_CODEC_ID_WAVPACK ,
79- " *.ogg " ),
80- FormatCodecs (QList<AVCodecID>(),
81- QList<AVCodecID>() << AV_CODEC_ID_MP3 << AV_CODEC_ID_AAC << AV_CODEC_ID_AC3 << AV_CODEC_ID_FLAC << AV_CODEC_ID_VORBIS << AV_CODEC_ID_WAVPACK ,
82- " *.aiff " )
115+ QList<AVCodecID>()
116+ << AV_CODEC_ID_OPUS
117+ << AV_CODEC_ID_VORBIS
118+ << AV_CODEC_ID_FLAC ,
119+ " *.ogg " )
83120 };
84121
85122 mMainLayout = new QVBoxLayout (this );
@@ -222,9 +259,13 @@ OutputSettings OutputSettingsDialog::getSettings() {
222259
223260 settings.fVideoEnabled = mVideoGroupBox ->isChecked ();
224261 const AVCodec *currentVideoCodec = nullptr ;
225- if (mVideoCodecsComboBox ->count () > 0 ) {
262+ if (mVideoCodecsComboBox ->count () > 0 ) {
226263 int codecId = mVideoCodecsComboBox ->currentIndex ();
227- currentVideoCodec = mVideoCodecsList .at (codecId);
264+ const AVCodec *selectedCodec = mVideoCodecsList .at (codecId);
265+ if (selectedCodec && selectedCodec->id == AV_CODEC_ID_PRORES ) {
266+ currentVideoCodec = avcodec_find_encoder_by_name (" prores_ks" );
267+ }
268+ if (!currentVideoCodec) { currentVideoCodec = selectedCodec; }
228269 }
229270 settings.fVideoCodec = currentVideoCodec;
230271
@@ -306,7 +347,7 @@ void OutputSettingsDialog::addVideoCodec(const AVCodec* const codec,
306347 if (codec->pix_fmts == nullptr ) return ;
307348 if (avformat_query_codec (outputFormat, codec->id , COMPLIANCE ) == 0 ) return ;
308349 mVideoCodecsList << codec;
309- const QString codecName ( codec->long_name );
350+ const QString codecName = AppSupport::filterFormatsName ( QString ( codec->long_name ) );
310351 mVideoCodecsComboBox ->addItem (codecName);
311352 if (codecName == currentCodecName) {
312353 mVideoCodecsComboBox ->setCurrentText (codecName);
@@ -323,7 +364,7 @@ void OutputSettingsDialog::addAudioCodec(const AVCodecID &codecId,
323364 if (currentCodec->sample_fmts == nullptr ) return ;
324365 if (avformat_query_codec (outputFormat, codecId, COMPLIANCE ) == 0 ) return ;
325366 mAudioCodecsList << currentCodec;
326- const QString codecName ( currentCodec->long_name );
367+ const QString codecName = AppSupport::filterFormatsName ( QString ( currentCodec->long_name ) );
327368 mAudioCodecsComboBox ->addItem (codecName);
328369 if (codecName == currentCodecName) {
329370 mAudioCodecsComboBox ->setCurrentText (codecName);
@@ -522,16 +563,15 @@ void OutputSettingsDialog::updateAvailableVideoCodecs() {
522563 }
523564 }
524565 } else {
525- const FormatCodecs currFormatT =
526- mSupportedFormats .at (outputFormatId);
527- for (const AVCodecID &codecId : currFormatT.mVidCodecs ) {
528- const AVCodec* iCodec = avcodec_find_encoder (codecId);
529- if (!iCodec) break ;
530- if (iCodec->type != AVMEDIA_TYPE_VIDEO ) continue ;
531- if (iCodec->capabilities & AV_CODEC_CAP_EXPERIMENTAL ) {
532- continue ;
533- }
534- if (iCodec->pix_fmts == nullptr ) continue ;
566+ const FormatCodecs currFormatT = mSupportedFormats .at (outputFormatId);
567+ for (const AVCodecID &codecId : currFormatT.mVidCodecs ) {
568+ const AVCodec* iCodec = nullptr ;
569+ if (codecId == AV_CODEC_ID_PRORES ) { iCodec = avcodec_find_encoder_by_name (" prores_ks" ); }
570+ if (!iCodec) { iCodec = avcodec_find_encoder (codecId); }
571+ if (!iCodec) { continue ; }
572+ if (iCodec->type != AVMEDIA_TYPE_VIDEO ) { continue ; }
573+ if (iCodec->capabilities & AV_CODEC_CAP_EXPERIMENTAL ) { continue ; }
574+ if (iCodec->pix_fmts == nullptr ) { continue ; }
535575 addVideoCodec (iCodec, outputFormat, currentCodecName);
536576 }
537577 }
0 commit comments