I am new to Gstreamer and have trouble feeding a custom appsrc via H264 to RTP. My pipeline:
<pre>appsrc name=mysrc ! videorate ! ffmpegcolorspace ! videoscale method=1
! video/x-raw-yuv,width=320,height=240,format=(fourcc)UYVY,framerate=\(fraction\)15/1
! TIVidenc1 codecName=h264enc engineName=codecServer ! rtph264pay pt=96
! udpsink host=192.168.1.112 port=5000</pre>
The appsrc read_data function contains this:
<pre>
static gboolean white = FALSE;
gdouble ms = g_timer_elapsed(app->timer, NULL);
if (ms > 1.0/15.0) {
GstBuffer* buffer = gst_buffer_new();
GST_INFO("Pushing new data into pipe, elapsed seconds=%f.", ms);
memset(GST_BUFFER_DATA(buffer), white ? 0xff : 0x0, GST_BUFFER_SIZE(buffer));
GST_BUFFER_SIZE(buffer) = 320 * 240 * 3 * sizeof(guchar);
white = !white;
g_signal_emit_by_name(app->appsrc, "push-buffer", buffer, &ret);
gst_buffer_unref(buffer);
}
</pre>
The pipeline runs for a few frames and then stops with:
<pre>rtsptest: Framecopy.c:108: _execute: Assertion `Buffer_getUserPtr(hSrcBuf)' failed.</pre>
When increasing debuglevel, I can see the following relevant lines:
<pre>
default main.c:38:read_data: Pushing new data into pipe, elapsed seconds=0.066681.
appsrc gstappsrc.c:1456:gst_app_src_push_buffer_full:<mysrc> queue filled (230400 >= 200000)
default main.c:71:stop_feed: Entering stop_feed(pipeline=0xec0c0, app=0x11f9c).
</pre>
Seems the trouble is in the appsrc buffering configuration, I just don't know what to set and where. Same pipeline using videotestsrc instead of appsrc works, encodes and streams perfectly.
<br /><br />
Full current code is available at <a href="http://pastebin.com/3V7wEKCs" target="_top" rel="nofollow" link="external">pastebin</a>.
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Problem-feeding-appsrc-to-H264-tp4656095.html">Problem feeding appsrc to H264</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>