Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bmf::builder::BMFGraph::update接口 #140

Open
x850044053wwt opened this issue Nov 4, 2024 · 5 comments
Open

bmf::builder::BMFGraph::update接口 #140

x850044053wwt opened this issue Nov 4, 2024 · 5 comments
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers

Comments

@x850044053wwt
Copy link

请教一下,现在c++的builder中BMFGraph有一个update接口int Graph::update(GraphConfig update_config),其中的实现考虑了将add的node中的Input_streams和outpit_streams分别connect。但是没有处理整个graph的output_streams,在generator模式下,缺少了可以generate的output_stream。

@JackLau1222
Copy link
Collaborator

这个接口是在engine中的Graph实现中,请问可以提供下测试的demo吗,我这边也帮忙看看

@x850044053wwt
Copy link
Author

x850044053wwt commented Nov 4, 2024

这个接口是在engine中的Graph实现中,请问可以提供下测试的demo吗,我这边也帮忙看看

std::string input_file = "D:/work/bmf_example_files/big_bunny_10s_30fps.mp4";
std::string output_file = "D:/dynamic_add.mp4";
std::string dyn_config_file = "D:/work/bmf_example_files/dynamic_add.json";

bmf::builder::Graph main_graph(bmf::builder::GeneratorMode);

nlohmann::json decode_para = { {"input_path", input_file} };
nlohmann::json encode_para = { {"output_path", output_file} };

auto video = main_graph.Decode(bmf_sdk::JsonParam(decode_para))[0];
video.EncodeAsVideo(bmf_sdk::JsonParam(encode_para));
video.Start();

while (true) {
auto pkt = main_graph.Generate(video.GetName());
if (pkt.timestamp() == BMF_EOF) break;
}

main_graph.Instance().update(dyn_config_file, true);

类似于这样的用法,Generator模式下获取decoder的帧,动态更新的graph,也需要获取decoder的帧。

问题出在video.Start()之后,video会有down_stream
main_graph.Instance().update(dyn_config_file, true);之后,decoder模块的video流没有down_stream

@x850044053wwt
Copy link
Author

Problem Source Location:
1、The output_streams of the graph were not updated in the update interface.
2、The callback_bindings of the node were not updated.
Temporary Solutions:
1、Add an output_stream interface to the graph and increase the output_stream of the graph by name.
2、Call the singleton of the connector's mapping in the graph to obtain the added callback bindings and update them.

@JackLau1222 JackLau1222 added good first issue Good for newcomers enhancement New feature or request labels Nov 28, 2024
@JackLau1222
Copy link
Collaborator

Problem Source Location: 1、The output_streams of the graph were not updated in the update interface. 2、The callback_bindings of the node were not updated. Temporary Solutions: 1、Add an output_stream interface to the graph and increase the output_stream of the graph by name. 2、Call the singleton of the connector's mapping in the graph to obtain the added callback bindings and update them.

May you submit a PR for this solution?

@JackLau1222 JackLau1222 added the bug Something isn't working label Dec 12, 2024
@x850044053wwt
Copy link
Author

Problem Source Location: 1、The output_streams of the graph were not updated in the update interface. 2、The callback_bindings of the node were not updated. Temporary Solutions: 1、Add an output_stream interface to the graph and increase the output_stream of the graph by name. 2、Call the singleton of the connector's mapping in the graph to obtain the added callback bindings and update them.

May you submit a PR for this solution?

Will be completed later time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants