<div dir="ltr"><div>Your caps might have different format so it cannot negotiate properly.<br><br></div><div>According to source codes of openh264, it accepts only I420 format as an input, but you used RGB here.<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 30, 2015 at 6:01 AM, dtmoodie <span dir="ltr"><<a href="mailto:dtmoodie@gmail.com" target="_blank">dtmoodie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm trying to stream images from opencv to a gstreamer pipeline.<br>
<br>
My caps are as follows:<br>
GstCaps* caps = gst_caps_new_simple("video/x-raw",<br>
        "format", G_TYPE_STRING, "RGB24",<br>
        "width", G_TYPE_INT, imgSize.width,<br>
        "height", G_TYPE_INT, imgSize.height,<br>
        "framerate", GST_TYPE_FRACTION, 15, 1,<br>
        "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,<br>
        NULL);<br>
<br>
I've also tried with format = RGB.<br>
red_mask     = 0x00ff0000<br>
blue_mask   = 0x000000ff<br>
green_mask = 0x0000ff00<br>
endianness<br>
<br>
Some examples I'm going off of:<br>
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-caps-api.html" rel="noreferrer" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-caps-api.html</a><br>
<a href="http://www.imgportal.net/home/wp-content/uploads/maris-script1.cpp" rel="noreferrer" target="_blank">http://www.imgportal.net/home/wp-content/uploads/maris-script1.cpp</a><br>
<br>
My desired pipeline:<br>
appsrc name=mysource ! openh264enc ! rtph264pay config-interval=1 pt=96 !<br>
udpsink host=127.0.0.1 port=8004<br>
<br>
Pushing data onto the appsrc:<br>
<br>
cv::Mat frameimage(user_data->imgSize, CV_8UC3);<br>
static GstClockTime timestamp = 0;<br>
GstBuffer *buffer;<br>
guint buffersize;<br>
GstFlowReturn ret;<br>
GstMapInfo info;<br>
buffersize = frameimage.cols * frameimage.rows * frameimage.channels();<br>
buffer = gst_buffer_new_and_alloc(buffersize);<br>
if (gst_buffer_map(buffer, &info, (GstMapFlags)GST_MAP_WRITE)) {<br>
        memcpy(info.data, frameimage.data, buffersize);<br>
        gst_buffer_unmap(buffer, &info);<br>
}<br>
else<br>
{<br>
        BOOST_LOG_TRIVIAL(error) << "Unable to map image data to buffer";<br>
}<br>
ret = gst_app_src_push_buffer((GstAppSrc*)user_data->source_OpenCV, buffer);<br>
if (ret != GST_FLOW_OK) {<br>
        BOOST_LOG_TRIVIAL(error) << "something wrong in cb_need_data";<br>
        g_main_loop_quit(user_data->glib_MainLoop);<br>
}<br>
<br>
Full source can be found here:<br>
<a href="https://github.com/dtmoodie/EagleEye/blob/Dev/Plugins/GStreamer/src/gstreamer.cpp" rel="noreferrer" target="_blank">https://github.com/dtmoodie/EagleEye/blob/Dev/Plugins/GStreamer/src/gstreamer.cpp</a><br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Appsrc-internal-dataflow-error-tp4673397.html" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Appsrc-internal-dataflow-error-tp4673397.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>