Please help! I am stumped and confused by the terminology. I am using GStreamer 0.10.(not sure). I am trying to capture from V4l2 and feed into an H264 encoder (hardly novel). I want to specify the capture size and format (I420). So I setup a caps filter. Here is a snipit of my code.<br>
<br> g_object_set (G_OBJECT (source_), "device", inputOptions_.ParameterDetails.adapter.cDevice,<br> "always-copy", FALSE, NULL);<br> GstCaps *pSrcCaps = gst_caps_new_simple("video/x-raw-yuv",<br>
"format", G_TYPE_STRING, "I420", "width", G_TYPE_INT, 720, "height", G_TYPE_INT, 480,<br> "framerate", GST_TYPE_FRACTION, 30, 1, NULL);<br><br> // Initialize the encoder.<br>
g_object_set (G_OBJECT (encoder_), "tune", (guint)4, // zerolatency<br> "byte-stream", (gboolean)TRUE,<br> "bitrate", (guint)inputOptions_.ParameterDetails.adapter.iTransmitBitrate, NULL);<br>
...<br><br> // Add the elements to the pipeline.<br> gst_bin_add_many(GST_BIN(mainPipeline_), source_, encoder_, muxer_, sink_, NULL);<br> // Link the pipeline together.<br> bRet = gst_element_link_filtered(source_, encoder_, pSrcCaps);<br>
gst_caps_unref(pSrcCaps);<br> if (!bRet)<br> {<br> GST_DEBUG("Failed to link filtered elements in pipeline.");<br> return bRet;<br> }<br><br>It is complaining that it can't link the video source to the encoder with my caps filter.<br>
<br>Here is a snipit of the log.<br><br>gstutils.c:1585:gst_element_link_pads:[00m trying to link element VideoSrc:(any) to element capsfilter0:sink<br>Nov 1 17:08:39 0:00:00.064704777 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;37;41m GST_ELEMENT_PADS gstelement.c:944:gst_element_get_static_pad:[00m found pad capsfilter0:sink<br>
Nov 1 17:08:39 0:00:00.064792569 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;31;41m GST_PADS gstutils.c:1493:prepare_link_maybe_ghosting:[00m VideoSrc and capsfilter0 in same bin, no need for ghost pads<br>
Nov 1 17:08:39 0:00:00.064950133 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;31;41m GST_PADS gstpad.c:1886:gst_pad_link_prepare:[00m trying to link VideoSrc:src and capsfilter0:sink<br>Nov 1 17:08:39 0:00:00.069477022 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;31;41m GST_PADS gstpad.c:2059:gst_pad_link:[00m linked VideoSrc:src and capsfilter0:sink, successful<br>
Nov 1 17:08:39 0:00:00.069674954 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;37;41m GST_ELEMENT_PADS gstutils.c:1585:gst_element_link_pads:[00m trying to link element capsfilter0:src to element VideoEncoder:(any)<br>
Nov 1 17:08:39 0:00:00.069755204 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;37;41m GST_ELEMENT_PADS gstelement.c:944:gst_element_get_static_pad:[00m found pad capsfilter0:src<br>Nov 1 17:08:39 0:00:00.069826303 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;31;41m GST_PADS gstutils.c:1046:gst_pad_check_link:[00m trying to link capsfilter0:src and VideoEncoder:src<br>
Nov 1 17:08:39 0:00:00.069883154 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;31;41m GST_PADS gstutils.c:1066:gst_pad_check_link:[00m Sink pad VideoEncoder:src is not sink pad, failed<br>Nov 1 17:08:39 0:00:00.069939587 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;31;41m GST_PADS gstutils.c:1046:gst_pad_check_link:[00m trying to link capsfilter0:src and VideoEncoder:sink<br>
Nov 1 17:08:39 0:00:00.084800392 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;01;37;41m GST_ELEMENT_PADS gstutils.c:1209:gst_element_get_compatible_pad:<VideoEncoder>[00m Could not find a compatible pad to link to capsfilter0:src<br>
Nov 1 17:08:39 0:00:00.084907739 [335m22354[00m 0x88462d8 [32;01mINFO [00m [00;04m default gstutils.c:1873:gst_element_link_pads_filtered:[00m Could not link elements<br><br><br>Can anyone see my (probably silly/simple) mistake and point me in the right direction?<br>
<br>Thank you very much!<br>