Added some keyframes
This commit is contained in:
parent
0828cc3f83
commit
4daaa1f089
2 changed files with 10 additions and 4 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit d1684ddea51a9baee94fcef806686de6017e982b
|
Subproject commit 5c1e48af98de9ee415e5c102861eb8115a457204
|
||||||
|
|
@ -321,9 +321,11 @@ static encoder_t amdvce {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{ "quality"s, &config::video.amd.quality },
|
{ "quality"s, &config::video.amd.quality },
|
||||||
{ "rc"s, &config::video.amd.rc }
|
{ "rc"s, "1"s },
|
||||||
|
{"log_to_dbg"s,"1"s},
|
||||||
|
{"gops_per_idr","1"s}
|
||||||
},
|
},
|
||||||
std::nullopt, std::make_optional<encoder_t::option_t>({"qp"s, &config::video.qp}),
|
std::nullopt, std::nullopt,
|
||||||
"h264_amf"s
|
"h264_amf"s
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
|
|
@ -769,7 +771,7 @@ void encode_run(
|
||||||
|
|
||||||
if(idr_events->peek()) {
|
if(idr_events->peek()) {
|
||||||
session->frame->pict_type = AV_PICTURE_TYPE_I;
|
session->frame->pict_type = AV_PICTURE_TYPE_I;
|
||||||
|
session->frame->key_frame = 1;
|
||||||
auto event = idr_events->pop();
|
auto event = idr_events->pop();
|
||||||
if(!event) {
|
if(!event) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -781,6 +783,7 @@ void encode_run(
|
||||||
}
|
}
|
||||||
else if(frame_nr == key_frame_nr) {
|
else if(frame_nr == key_frame_nr) {
|
||||||
session->frame->pict_type = AV_PICTURE_TYPE_I;
|
session->frame->pict_type = AV_PICTURE_TYPE_I;
|
||||||
|
session->frame->key_frame = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::this_thread::sleep_until(next_frame);
|
std::this_thread::sleep_until(next_frame);
|
||||||
|
|
@ -919,6 +922,7 @@ encode_e encode_run_sync(std::vector<std::unique_ptr<sync_session_ctx_t>> &synce
|
||||||
|
|
||||||
if(ctx->idr_events->peek()) {
|
if(ctx->idr_events->peek()) {
|
||||||
pos->session.frame->pict_type = AV_PICTURE_TYPE_I;
|
pos->session.frame->pict_type = AV_PICTURE_TYPE_I;
|
||||||
|
pos->session.frame->key_frame = 1;
|
||||||
|
|
||||||
auto event = ctx->idr_events->pop();
|
auto event = ctx->idr_events->pop();
|
||||||
auto end = event->second;
|
auto end = event->second;
|
||||||
|
|
@ -928,6 +932,7 @@ encode_e encode_run_sync(std::vector<std::unique_ptr<sync_session_ctx_t>> &synce
|
||||||
}
|
}
|
||||||
else if(ctx->frame_nr == ctx->key_frame_nr) {
|
else if(ctx->frame_nr == ctx->key_frame_nr) {
|
||||||
pos->session.frame->pict_type = AV_PICTURE_TYPE_I;
|
pos->session.frame->pict_type = AV_PICTURE_TYPE_I;
|
||||||
|
pos->session.frame->key_frame = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(img_tmp) {
|
if(img_tmp) {
|
||||||
|
|
@ -1120,6 +1125,7 @@ bool validate_config(std::shared_ptr<platf::display_t> &disp, const encoder_t &e
|
||||||
encoder.img_to_frame(*hwdevice->img, session->frame);
|
encoder.img_to_frame(*hwdevice->img, session->frame);
|
||||||
|
|
||||||
session->frame->pict_type = AV_PICTURE_TYPE_I;
|
session->frame->pict_type = AV_PICTURE_TYPE_I;
|
||||||
|
session->frame->key_frame = 1;
|
||||||
|
|
||||||
auto packets = std::make_shared<packet_queue_t::element_type>(30);
|
auto packets = std::make_shared<packet_queue_t::element_type>(30);
|
||||||
if(encode(1, session->ctx, session->frame, packets, nullptr)) {
|
if(encode(1, session->ctx, session->frame, packets, nullptr)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue