How to convert bayer raw10 to H.264 using GStreamer?

I’m trying to create a gstreamer pipeline to transcode bayer raw10 frames to H.264 using appsrc. Here’s what my pipeline looks like:

r#"appsrc name=src is-live=true block=true caps="video/x-bayer,format=bggr10,framerate=10/1,width=1920,height=1080" !
                        bayer2rgb !
                        videoconvert !
                        video/x-raw,format=NV12,width=1920,height=1080 !
                        nvvidconv !
                        video/x-raw(memory:NVMM),format=NV12,width=1920,height=1080 !
                        nvv4l2h264enc insert-sps-pps=true maxperf-enable=1 !
                        h264parse !
                        appsink name=sink emit-signals=true sync=false caps="video/x-h264,stream-format=byte-stream""#

But I keep getting a caps non-negotiated error from GStreamer:

[ERROR farm_ng_stream::video::stream_decoder] Error { structure: Some(GstMessageError { gerror: (GError) ((GError*) 0xffff84022aa0), debug: (gchararray) "gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline1/GstAppSrc:src:nstreaming stopped, reason not-negotiated (-4)", details: Structure(details { flow-return: (gint) -4 }) }), source: Some((Object { inner: TypedObjectRef { inner: 0xffff9823bd90, type: GstAppSrc } }, "src")), error: Error { domain: gst-stream-error-quark, code: 1, message: "Internal data stream error." }, debug: Some("gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline1/GstAppSrc:src:nstreaming stopped, reason not-negotiated (-4)"), details: Some(details { flow-return: (gint) -4 }) }

For context, I’m trying to run this from a NVIDIA Jetson Xavier, using Jetpack 5.1.1
I have a luxonis oak-d camera and this is my depthai pipeline:

void add_to_pipeline_rgb(
    std::shared_ptr<dai::Pipeline> pipeline,
    ColorStreamOptions const &options,
    bool data_campaign) {

  // Disable the watchdog timeout to prevent the device from resetting
  // during extended periods of inactivity. Our application has its own logic
  // for handling device drop and recovery independently, rendering the
  // watchdog timeout redundant and potentially disruptive.
  setenv("DEPTHAI_WATCHDOG", "0", 1); // Disable watchdog timeout)

  auto xout_rgb = pipeline->create<dai::node::XLinkOut>();
  xout_rgb->setStreamName(std::string(options.queue_name));

  auto cam = pipeline->create<dai::node::ColorCamera>();

  cam->setBoardSocket(to_camera_board_socket(options.camera_board_socket));
  cam->setResolution(to_sensor_resolution(options.resolution));
  cam->setFps(options.fps);

  if (data_campaign) {
    cam->setRawOutputPacked(true); // Ensure raw output is packed
    cam->raw.link(xout_rgb->input);
  } else {
      auto encoder = pipeline->create<dai::node::VideoEncoder>();

      encoder->setDefaultProfilePreset(
          30, to_encoder_profile(options.encoder_options.profile));
      encoder->setBitrateKbps(options.encoder_options.cbr_preferred_bitrate_kbps);
      encoder->setRateControlMode(
          to_rate_control_mode(options.encoder_options.rate_control_mode));
      encoder->setQuality(options.encoder_options.vbr_or_mjpeg_quality);
      encoder->setKeyframeFrequency(options.encoder_options.frames_per_keyframe);

      cam->video.link(encoder->input);
      encoder->bitstream.link(xout_rgb->input);

    auto xin_control = pipeline->create<dai::node::XLinkIn>();
    xin_control->setStreamName(std::string(options.queue_name) + "/control");
    xin_control->out.link(cam->inputControl);
  }
}

I am confident I’m outputing bayer raw10 frames. Additionally, if I try to run my pipeline via CLI I get no errors:

GST_DEBUG=3 gst-launch-1.0 -v 
appsrc name=src is-live=true block=true caps="video/x-bayer,format=bggr10,framerate=10/1,width=1920,height=1080" ! 
bayer2rgb ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080 ! 
nvvidconv ! "video/x-raw(memory:NVMM),format=NV12,width=1920,height=1080" ! 
nvv4l2h264enc insert-sps-pps=true maxperf-enable=1 ! 
h264parse ! 
appsink name=sink emit-signals=true caps="video/x-h264,stream-format=byte-stream" sync=false

This is my first time ever using GStreamer, so I’m not too sure if there’s anything obvious I’m missing. Any help is greatly appreciated!

I have tried specifying caps, supressing caps, but had no success.

I expect to be able to output H.264 frames.

New contributor

Guilherme is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật