首页 新闻 赞助 找找看

[gstreamer][C++]找不到videoconvert

0
悬赏园豆:20 [已关闭问题] 关闭于 2023-03-06 23:48

C++调用gstreamer进行视频转码,但是找不到videoconvert。

auto pipeline = gst_parse_launch(("filesrc location=" + input_file + " ! decodebin ! videoconvert ! x264enc ! mp4mux ! filesink location=" + output_file).c_str(), nullptr);

auto videoconvert = gst_bin_get_by_name(GST_BIN(pipeline), "videoconvert");
if (videoconvert == nullptr) {
  std::cerr << "videoconvert not found" << std::endl;
  return 1;
}

运行的时候走到了if语句里,因为找不到videoconvert,但是执行命令gst-inspect-1.0 videoconvert却可以看到有videoconvert,到底是哪里出问题了呢?
和CMakeLists.txt里的环境变量${GST_LIBRARIES} ${TORCH_LIBRARIES}有关吗?

芽衣的主页 芽衣 | 菜鸟二级 | 园豆:384
提问于:2023-03-03 09:42
< >
分享
所有回答(1)
0

改成auto videoconvert = gst_bin_get_by_name(GST_BIN(pipeline), "videoconvert0");
之后就找到了。

芽衣 | 园豆:384 (菜鸟二级) | 2023-03-06 23:48
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册