Skip to content

Commit

Permalink
Update videoencoder.cpp
Browse files Browse the repository at this point in the history
Support format options.
  • Loading branch information
rodlie committed Sep 6, 2024
1 parent 2912ba2 commit d422bd1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/core/videoencoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,27 @@ static void addVideoStream(OutputStream * const ost,
c->profile = outSettings.fVideoProfile;
}

for (const auto &opt : outSettings.fVideoOptions.fValues) {
switch (opt.fType) {
case FormatType::fTypeCodec:
av_opt_set(c->priv_data,
opt.fKey.toStdString().c_str(),
opt.fValue.toStdString().c_str(), 0);
break;
case FormatType::fTypeFormat:
av_opt_set(oc->priv_data,
opt.fKey.toStdString().c_str(),
opt.fValue.toStdString().c_str(), 0);
break;
case FormatType::fTypeMeta:
av_dict_set(&oc->metadata,
opt.fKey.toStdString().c_str(),
opt.fValue.toStdString().c_str(), 0);
break;
default:;
}
}

c->gop_size = 12; /* emit one intra frame every twelve frames at most */
c->pix_fmt = outSettings.fVideoPixelFormat;//RGBA;
if(c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
Expand Down

0 comments on commit d422bd1

Please sign in to comment.