video/x-raw(memory:NVMM) from gst::Caps::new_simple error
I am trying to create a plugin (called frameselect
) that will pass a video frame from a nvv4ldecoder
element to a nvv4lh264enc
based on the value of a custom metadata on the buffer. The transform method simply returns Ok(gst_base::BASE_TRANSFORM_FLOW_DROPPED)
if the metadata specifies (by a bool field) that the buffer should not be passed to the encoder.
Given that the src
caps of nvv4ldecoder
are
SRC template: 'src'
Availability: Always
Capabilities:
video/x-raw(memory:NVMM)
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
framerate: [ 0/1, 2147483647/1 ]
And the caps I specify in my plugin through gst::Caps::new_simple
are
let caps = gst::Caps::new_simple(
"video/x-raw(memory:NVMM)",
&[
("width", &gst::IntRange::<i32>::new(0, i32::MAX)),
("height", &gst::IntRange::<i32>::new(0, i32::MAX)),
(
"framerate",
&gst::FractionRange::new(
gst::Fraction::new(0, 1),
gst::Fraction::new(i32::MAX, 1),
),
),
],
);
I get this error
0:00:00.468243547 7033 0x55d5222ee600 DEBUG GST_PLUGIN_LOADING gstpluginfeature.c:116:gst_plugin_feature_load: loaded plugin frameselect
0:00:00.468256890 7033 0x55d5222ee600 INFO GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "frameselect" named "frameselect"
0:00:00.468271715 7033 0x55d5222ee600 DEBUG GST_ELEMENT_PADS gstelement.c:302:gst_element_base_class_init: type GstBaseTransform : factory (nil)
0:00:00.468284816 7033 0x55d5222ee600 DEBUG basetransform gstbasetransform.c:322:gst_base_transform_class_init: gst_base_transform_class_init
0:00:00.468301529 7033 0x55d5222ee600 DEBUG GST_ELEMENT_PADS gstelement.c:302:gst_element_base_class_init: type FrameSelect : factory 0x55d5225214e0
0:00:00.468318759 7033 0x55d5222ee600 WARN structure gststructure.c:197:gst_structure_validate_name: Invalid character '(' at offset 11 in structure name: video/x-raw(memory:NVMM)
I have tried setting the sink
caps to video/x-raw
, but the pads will fail to link due to intersection failure.
On nvidia forums, some have suggested using gst_caps_from_string
instead of gst_caps_new_simple
. This seems to be an issue on nvidia's end, but I would appreciate some advice on getting this to work in gstreamer-rs.