added thread count selection in export settings

This commit is contained in:
itsmattkc
2019-02-26 10:02:36 -08:00
parent 39d62fe394
commit 19618fb8e9
9 changed files with 365 additions and 306 deletions
+8 -1
View File
@@ -151,6 +151,8 @@ bool ExportThread::setupVideo() {
}
switch (vcodec_ctx->codec_id) {
/// H.264 specific settings
case AV_CODEC_ID_H264:
switch (params.video_compression_type) {
case COMPRESSION_TYPE_CFR:
@@ -158,10 +160,15 @@ bool ExportThread::setupVideo() {
break;
}
break;
}
AVDictionary* opts = nullptr;
av_dict_set(&opts, "threads", "auto", 0);
if (vcodec_params.threads == 0) {
av_dict_set(&opts, "threads", "auto", 0);
} else {
av_dict_set(&opts, "threads", QString::number(vcodec_params.threads).toUtf8(), 0);
}
ret = avcodec_open2(vcodec_ctx, vcodec, &opts);
if (ret < 0) {