I modified my application to use the intervideosink and intervediosrc
<br/>but I am getting a crash when the playbin pipeline is started. I
<br/>reproduced the problem in the included test application. With
<br/>debugging at level 4, the diagnostic output indicated the assertion
<br/>below.
<br/><br/>Any suggestions on what I am doing wrong or where the problem is? I
<br/>am using release 1.8.0.
<br/><br/>0:00:00.232899237 14216 00000000041C1140 INFO GST_STATES
<br/>gstelement.c:2277:_priv_gst_element_state_changed:<playbin0> notifying
<br/>about state-changed PAUSED to PLAYING (VOID_PENDING pending)
<br/>0:00:00.232934304 14216 0000000002B04000 INFO GST_BUS
<br/>gstbus.c:565:gst_bus_timed_pop_filtered:<bus1> we got woken up,
<br/>recheck for message
<br/>0:00:00.247985542 14216 00000000033EE440 INFO GST_EVENT
<br/>gstevent.c:679:gst_event_new_caps: creating caps event video/x-raw,
<br/>format=(string)I420, width=(int)1442, height=(int)1011,
<br/>interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
<br/>chroma-site=(string)mpeg2, colorimetry=(string)bt709,
<br/>framerate=(fraction)25/1
<br/>0:00:00.248142062 14216 00000000033EE440 INFO basetransform
<br/>gstbasetransform.c:1367:gst_base_transform_setcaps:<capsfilter0> reuse
<br/>caps
<br/>0:00:00.248173709 14216 00000000033EE440 INFO GST_EVENT
<br/>gstevent.c:679:gst_event_new_caps: creating caps event video/x-raw,
<br/>format=(string)I420, width=(int)1442, height=(int)1011,
<br/>interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
<br/>chroma-site=(string)mpeg2, colorimetry=(string)bt709,
<br/>framerate=(fraction)25/1
<br/>0:00:00.248360165 14216 00000000033EE440 INFO basetransform
<br/>gstbasetransform.c:1367:gst_base_transform_setcaps:<videoconvert0>
<br/>reuse caps
<br/>0:00:00.248417043 14216 00000000033EE440 INFO GST_EVENT
<br/>gstevent.c:679:gst_event_new_caps: creating caps event video/x-raw,
<br/>format=(string)I420, width=(int)1442, height=(int)1011,
<br/>interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1,
<br/>chroma-site=(string)mpeg2, colorimetry=(string)bt709,
<br/>framerate=(fraction)25/1
<br/>0:00:00.249147902 14216 00000000033EE440 INFO libav
<br/>:0:: Assertion v>0 && v<=(1 ? 32 : 16) failed at libavutil/mem.c:233
<br/><br/>This application has requested the Runtime to terminate it in an unusual way.
<br/>Please contact the application's support team for more information.
<br/><br/><br/><br/>#include <gst/gst.h>
<br/><br/>GstElement* buildPipeline(char* pipelineDescription)
<br/>{
<br/> GError* error=NULL;
<br/> GstElement* pipeline = gst_parse_launch(pipelineDescription, &error);
<br/><br/> if(error != NULL)
<br/> {
<br/> g_printerr("Error: %s\n", error->message);
<br/> return NULL;
<br/> }
<br/><br/> if(pipeline == NULL)
<br/> {
<br/> g_printerr("Error creating pipeline\n");
<br/> return NULL;
<br/> }
<br/><br/> return pipeline;
<br/>}
<br/><br/><br/>gint main (gint argc, gchar *argv[])
<br/>{
<br/> GstStateChangeReturn retSink;
<br/> GstStateChangeReturn retSrc;
<br/><br/> // init GStreamer
<br/> gst_init (&argc, &argv);
<br/><br/> char* sinkPipelineDescription = "playbin
<br/>uri=file:///C:/gstreamer/1.0/x86_64/bin/captureMakLand.mpeg";
<br/> char* srcPipelineDescription ="intervideosrc channel=V1 !
<br/>video/x-raw,framerate=25/1 ! videoconvert ! avenc_mpeg2video !
<br/>mpegtsmux ! udpsink host=127.0.0.255 port=5000";
<br/><br/> // setup pipeline
<br/> GstElement* mySinkPipeline = buildPipeline(sinkPipelineDescription);
<br/> GstElement* mySrcPipeline = buildPipeline(srcPipelineDescription);
<br/><br/><br/> if (mySinkPipeline && mySrcPipeline)
<br/> {
<br/> GstElement* interVideoSink =
<br/>gst_element_factory_make("intervideosink", "interVideoSink");
<br/><br/> g_object_set (GST_OBJECT (interVideoSink), "channel", "V1", NULL);
<br/> g_object_set (GST_OBJECT (mySinkPipeline), "video-sink",
<br/>interVideoSink, NULL);
<br/><br/> retSrc = gst_element_set_state (mySrcPipeline, GST_STATE_PLAYING);
<br/> retSink = gst_element_set_state (mySinkPipeline, GST_STATE_PLAYING);
<br/> if (retSink != GST_STATE_CHANGE_FAILURE && retSrc !=
<br/>GST_STATE_CHANGE_FAILURE)
<br/> {
<br/> /* Wait until error or EOS */
<br/> GstBus *bus = gst_element_get_bus (mySinkPipeline);
<br/> GstMessage *msg = gst_bus_timed_pop_filtered (bus,
<br/>GST_CLOCK_TIME_NONE, GstMessageType(GST_MESSAGE_ERROR |
<br/>GST_MESSAGE_EOS));
<br/><br/> /* Parse message */
<br/> if (msg != NULL)
<br/> {
<br/> GError *err;
<br/> gchar *debug_info;
<br/><br/> switch (GST_MESSAGE_TYPE (msg))
<br/> {
<br/> case GST_MESSAGE_ERROR:
<br/> gst_message_parse_error (msg, &err, &debug_info);
<br/> g_printerr ("Error received from element %s: %s\n",
<br/>GST_OBJECT_NAME (msg->src), err->message);
<br/> g_printerr ("Debugging information: %s\n", debug_info ?
<br/>debug_info : "none");
<br/> g_clear_error (&err);
<br/> g_free (debug_info);
<br/> break;
<br/> case GST_MESSAGE_EOS:
<br/> g_print ("End-Of-Stream reached.\n");
<br/> break;
<br/> default:
<br/> /* We should not reach here because we only asked for
<br/>ERRORs and EOS */
<br/> g_printerr ("Unexpected message received.\n");
<br/> break;
<br/> }
<br/> }
<br/> }
<br/> }
<br/><br/> // clean up
<br/> gst_element_set_state (mySinkPipeline, GST_STATE_NULL);
<br/> gst_object_unref (GST_OBJECT (mySinkPipeline));
<br/> //g_main_loop_unref (loop);
<br/><br/> return 0;
<br/>}
<br/><br/><br/>On Wed, Sep 28, 2016 at 10:38 AM, Doug Wood <<a href="/user/SendEmail.jtp?type=node&node=4679895&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> wrote:
<div class='shrinkable-quote'><br/>> Tim,
<br/>>
<br/>> Your alternative suggestion looks like it might nicely fit my needs. I
<br/>> am already supporting playback to a local window in conjunction with
<br/>> the udpSink just in 2 independent pipelines. I assume that if I want
<br/>> to modify my existing pipeline that plays to a local window to also
<br/>> support the intervideosink then I will have to tee the pipleline.
<br/>>
<br/>> I will give this coupling approach a try.
<br/>>
<br/>> Thanks a lot,
<br/>> Doug
<br/>>
<br/>> On Tue, Sep 27, 2016 at 5:37 PM, Tim Müller [via GStreamer-devel]
<br/>> <<a href="/user/SendEmail.jtp?type=node&node=4679895&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>> wrote:
<br/>>> On Tue, 2016-09-27 at 12:54 -0700, doubledw wrote:
<br/>>>
<br/>>> Hi,
<br/>>>
<br/>>> At first glance it looks like the encoder not handling seeks / flushing
<br/>>> properly.
<br/>>>
<br/>>> I have something else for you to try which might work better for you:
<br/>>>
<br/>>> Create two separate pipelines in the same application - one that
<br/>>> encodes/streams and one that decodes/seeks/etc.
<br/>>>
<br/>>> In the playback pipeline you use intervideosink as video sink, and in
<br/>>> the encoding pipeline you use intervideosrc as source element.
<br/>>>
<br/>>> The video data from the intervideosink will be sent to the
<br/>>> intervideosrc, but both are decoupled, so if you pause the playback
<br/>>> pipeline, the streaming pipeline will just keep repeating and streaming
<br/>>> the last frame (or go black after a while, depending what you set the
<br/>>> timeout to). If you seek on the playback pipeline the streaming part
<br/>>> will repeat the last frame until the seek is complete and then output
<br/>>> frames from the new position (but with monotonically increasing
<br/>>> timestamps, so the encoder will never know there was a discontinuity).
<br/>>> If you play back at half speed or double speed, the streaming part will
<br/>>> encode that at the playback speed and stream it out normally.
<br/>>>
<br/>>> For the decoding pipeline you can just use a playbin element and set
<br/>>> the "video-sink" property to an intervideosink (GstElement *).
<br/>>>
<br/>>> On the streaming pipeline you want something like:
<br/>>>
<br/>>> intervideosrc ! video/x-raw,framerate=25/1 ! videoconvert
<br/>>> ! avenc_mpeg2video ! mpegtsmux ! udpsink
<br/>>>
<br/>>> If you want audio as well, there's also interaudiosink/src which work
<br/>>> the same way.
<br/>>>
<br/>>> Good luck!
<br/>>>
<br/>>> Cheers
<br/>>> -Tim
<br/>>>
<br/>>> --
<br/>>> Tim Müller, Centricular Ltd - <a href="http://www.centricular.com" target="_top" rel="nofollow" link="external">http://www.centricular.com</a><br/>>>
<br/>>> Join us at the GStreamer Conference!
<br/>>> 10-11 October 2016 in Berlin,
<br/>>> Germany
<br/>>> <a href="http://gstreamer.freedesktop.org/conference/" target="_top" rel="nofollow" link="external">http://gstreamer.freedesktop.org/conference/</a><br/>>>
<br/>>> _______________________________________________
<br/>>> gstreamer-devel mailing list
<br/>>> [hidden email]
<br/>>> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_top" rel="nofollow" link="external">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br/>>>
<br/>>>
<br/>>> ________________________________
<br/>>> If you reply to this email, your message will be added to the discussion
<br/>>> below:
<br/>>> <a href="http://gstreamer-devel.966125.n4.nabble.com/Seeking-when-streaming-to-udpSink-tp4678702p4679823.html" target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/Seeking-when-streaming-to-udpSink-tp4678702p4679823.html</a><br/>>> To unsubscribe from Seeking when streaming to udpSink, click here.
<br/>>> NAML
<br/>>
<br/>>
<br/>>
<br/>> --
<br/>> Doug Wood | Principal Software Engineer
<br/>> VT MÄK | 150 Cambridge Park Drive, Third Floor, Cambridge, MA 02140
<br/>> T: +1.407.359.2725 / +1.617.876.8085
<br/>> <a href="/user/SendEmail.jtp?type=node&node=4679895&i=2" target="_top" rel="nofollow" link="external">[hidden email]</a> | www.mak.com
</div><br/><br/><br/>--
<br/>Doug Wood | Principal Software Engineer
<br/>VT MÄK | 150 Cambridge Park Drive, Third Floor, Cambridge, MA 02140
<br/>T: +1.407.359.2725 / +1.617.876.8085
<br/><a href="/user/SendEmail.jtp?type=node&node=4679895&i=3" target="_top" rel="nofollow" link="external">[hidden email]</a> | www.mak.com
<br/>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Seeking-when-streaming-to-udpSink-tp4678702p4679895.html">Re: Seeking when streaming to udpSink</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>