Souphttpsrc error with remote jpeg stream

Hi! I’m trying to create a small api around gstreamer to easily stream video data (similar to opencv videocapture) in rust under the kornia-rs project.

I have created a simple StreamCapture that ideally receives any pipeline string and links to an appsink component in order to have access to the image frame for further imgproc and deep learning pruposes.

I have tested this against a webcam camera and all good.

My next step is to process imagery coming from a remote camera. I created a simple setup with an ESP32 jpeg streaming over the network following an online tutorial and runing the following command:

GST_DEBUG=3 gst-launch-1.0 souphttpsrc location=http://192.168.1.139:81/stream ! jpegparse ! jpegdec ! videoconvert ! autovideosink

However, when I try to use that string with my StreamCapture API I get an internal gstreamer error.

Usage:

 let mut capture = StreamCapture::new(
  "souphttpsrc location=http://192.168.1.139:81/stream ! jpegparse ! jpegdec ! videoconvert ! appsink name=sink",
)?;

Error:

Error from Some("/GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0"): Internal data stream error. (Some("gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0:\nstreaming stopped, reason error (-5)"))

Any pointers or help will be very much appreciated. I’m also totally open for feedback and collaborations with the gstreamer team as I’m learning gstreamer-rs (and loving it) while I’m evolving the kornia project to create a robust foundational tool for the computer vision community.

Bit unexpected, it looks like some element downstream returned a flow error but didn’t actually post a proper error message on the bus with details.

Does it work if you use autovideosink instead of appsink? (appsink should accept anything if you don’t set caps on it, so not sure why that would break anything, but it seems to be the only difference to your gst-launch pipeline?)

You can also run your application with GST_DEBUG=*:INFO for starters or GST_DEBUG=*:6 and then later grep for things like ‘error’ in the output.

@tpm thanks for the answer.

When i use gst-launch with autovideosink, yes, I’m able to visualize the images coming from the camera in the popup window. When trying with debug flags I get the following:

GST_DEBUG=*:INFO

0:00:00.000047480 115748 0x55c31303a800 INFO                GST_INIT gst.c:586:init_pre: Initializing GStreamer Core Library version 1.16.3
0:00:00.000068923 115748 0x55c31303a800 INFO                GST_INIT gst.c:587:init_pre: Using library installed in /usr/lib/x86_64-linux-gnu
0:00:00.000077688 115748 0x55c31303a800 INFO                GST_INIT gst.c:605:init_pre: Linux farmng-TensorBook-late-2021 5.15.0-117-generic #127~20.04.1-Ubuntu SMP Thu Jul 11 15:36:12 UTC 2024 x86_64
0:00:00.000222512 115748 0x55c31303a800 INFO                GST_INIT gstmessage.c:128:_priv_gst_message_initialize: init messages
0:00:00.000426371 115748 0x55c31303a800 INFO                GST_INIT gstcontext.c:84:_priv_gst_context_initialize: init contexts
0:00:00.000528717 115748 0x55c31303a800 INFO      GST_PLUGIN_LOADING gstplugin.c:318:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.000565688 115748 0x55c31303a800 INFO      GST_PLUGIN_LOADING gstplugin.c:226:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00.000569581 115748 0x55c31303a800 INFO      GST_PLUGIN_LOADING gstplugin.c:228:gst_plugin_register_static: added static plugin "staticelements", result: 1
0:00:00.000577633 115748 0x55c31303a800 INFO            GST_REGISTRY gstregistry.c:1733:ensure_current_registry: reading registry cache: /home/edgar/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.009487512 115748 0x55c31303a800 INFO            GST_REGISTRY gstregistrybinary.c:621:priv_gst_registry_binary_read_cache: loaded /home/edgar/.cache/gstreamer-1.0/registry.x86_64.bin in 0.008893 seconds
0:00:00.009532780 115748 0x55c31303a800 INFO            GST_REGISTRY gstregistry.c:1592:scan_and_update_registry: Validating plugins from registry cache: /home/edgar/.cache/gstreamer-1.0/registry.x86_64.bin
0:00:00.010351538 115748 0x55c31303a800 INFO            GST_REGISTRY gstregistry.c:1691:scan_and_update_registry: Registry cache has not changed
0:00:00.010360393 115748 0x55c31303a800 INFO            GST_REGISTRY gstregistry.c:1768:ensure_current_registry: registry reading and updating done, result = 1
0:00:00.010364270 115748 0x55c31303a800 INFO                GST_INIT gst.c:806:init_post: GLib runtime version: 2.64.6
0:00:00.010369043 115748 0x55c31303a800 INFO                GST_INIT gst.c:808:init_post: GLib headers version: 2.64.6
0:00:00.010371259 115748 0x55c31303a800 INFO                GST_INIT gst.c:810:init_post: initialized GStreamer successfully
0:00:00.010385658 115748 0x55c31303a800 INFO            GST_PIPELINE gstparse.c:336:gst_parse_launch_full: parsing pipeline description 'souphttpsrc location=http://192.168.1.139:81/stream ! jpegparse ! jpegdec ! videoconvert ! appsink name=sink'
0:00:00.014175996 115748 0x55c31303a800 INFO      GST_PLUGIN_LOADING gstplugin.c:902:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstsoup.so" loaded
0:00:00.014190392 115748 0x55c31303a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:363:gst_element_factory_create: creating element "souphttpsrc"
0:00:00.014313158 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstelement.c:671:gst_element_add_pad:<GstBaseSrc@0x55c31305ec60> adding pad 'src'
0:00:00.014492409 115748 0x55c31303a800 INFO      GST_PLUGIN_LOADING gstplugin.c:902:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstjpegformat.so" loaded
0:00:00.014498501 115748 0x55c31303a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:363:gst_element_factory_create: creating element "jpegparse"
0:00:00.014541974 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstelement.c:671:gst_element_add_pad:<GstBaseParse@0x55c313298dc0> adding pad 'sink'
0:00:00.014551095 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstelement.c:671:gst_element_add_pad:<GstBaseParse@0x55c313298dc0> adding pad 'src'
0:00:00.014990801 115748 0x55c31303a800 INFO      GST_PLUGIN_LOADING gstplugin.c:902:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstjpeg.so" loaded
0:00:00.014998901 115748 0x55c31303a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:363:gst_element_factory_create: creating element "jpegdec"
0:00:00.015042789 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstelement.c:671:gst_element_add_pad:<GstVideoDecoder@0x55c31329e660> adding pad 'sink'
0:00:00.015050763 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstelement.c:671:gst_element_add_pad:<GstVideoDecoder@0x55c31329e660> adding pad 'src'
0:00:00.015165339 115748 0x55c31303a800 INFO      GST_PLUGIN_LOADING gstplugin.c:902:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvideoconvert.so" loaded
0:00:00.015170558 115748 0x55c31303a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:363:gst_element_factory_create: creating element "videoconvert"
0:00:00.015317734 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstelement.c:671:gst_element_add_pad:<GstBaseTransform@0x55c3132aa260> adding pad 'sink'
0:00:00.015325421 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstelement.c:671:gst_element_add_pad:<GstBaseTransform@0x55c3132aa260> adding pad 'src'
0:00:00.015402991 115748 0x55c31303a800 INFO      GST_PLUGIN_LOADING gstplugin.c:902:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstapp.so" loaded
0:00:00.015408355 115748 0x55c31303a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:363:gst_element_factory_create: creating element "appsink"
0:00:00.015466545 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstelement.c:671:gst_element_add_pad:<GstBaseSink@0x55c3132adc50> adding pad 'sink'
0:00:00.015481673 115748 0x55c31303a800 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:363:gst_element_factory_create: creating element "pipeline"
0:00:00.015545111 115748 0x55c31303a800 INFO            GST_PIPELINE grammar.y:648:gst_parse_perform_link: linking some pad of GstSoupHTTPSrc named souphttpsrc0 to some pad of GstJpegParse named jpegparse0 (0/0) with caps "(NULL)"
0:00:00.015553192 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstutils.c:1771:gst_element_link_pads_full: trying to link element souphttpsrc0:(any) to element jpegparse0:(any)
0:00:00.015560732 115748 0x55c31303a800 INFO                GST_PADS gstutils.c:1034:gst_pad_check_link: trying to link souphttpsrc0:src and jpegparse0:sink
0:00:00.015576077 115748 0x55c31303a800 INFO                GST_PADS gstutils.c:1587:prepare_link_maybe_ghosting: souphttpsrc0 and jpegparse0 in same bin, no need for ghost pads
0:00:00.015585494 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:2377:gst_pad_link_prepare: trying to link souphttpsrc0:src and jpegparse0:sink
0:00:00.015594002 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:2585:gst_pad_link_full: linked souphttpsrc0:src and jpegparse0:sink, successful
0:00:00.015597995 115748 0x55c31303a800 INFO               GST_EVENT gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:00.015602886 115748 0x55c31303a800 INFO               GST_EVENT gstpad.c:5812:gst_pad_send_event_unchecked:<souphttpsrc0:src> Received event on flushing pad. Discarding
0:00:00.015614768 115748 0x55c31303a800 INFO            GST_PIPELINE grammar.y:648:gst_parse_perform_link: linking some pad of GstJpegParse named jpegparse0 to some pad of GstJpegDec named jpegdec0 (0/0) with caps "(NULL)"
0:00:00.015621172 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstutils.c:1771:gst_element_link_pads_full: trying to link element jpegparse0:(any) to element jpegdec0:(any)
0:00:00.015626397 115748 0x55c31303a800 INFO                GST_PADS gstutils.c:1034:gst_pad_check_link: trying to link jpegparse0:src and jpegdec0:sink
0:00:00.015634011 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:4237:gst_pad_peer_query:<jpegdec0:src> pad has no peer
0:00:00.015651516 115748 0x55c31303a800 INFO                GST_PADS gstutils.c:1587:prepare_link_maybe_ghosting: jpegparse0 and jpegdec0 in same bin, no need for ghost pads
0:00:00.015657599 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:2377:gst_pad_link_prepare: trying to link jpegparse0:src and jpegdec0:sink
0:00:00.015663778 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:4237:gst_pad_peer_query:<jpegdec0:src> pad has no peer
0:00:00.015673491 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:2585:gst_pad_link_full: linked jpegparse0:src and jpegdec0:sink, successful
0:00:00.015677146 115748 0x55c31303a800 INFO               GST_EVENT gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:00.015680952 115748 0x55c31303a800 INFO               GST_EVENT gstpad.c:5812:gst_pad_send_event_unchecked:<jpegparse0:src> Received event on flushing pad. Discarding
0:00:00.015689955 115748 0x55c31303a800 INFO            GST_PIPELINE grammar.y:648:gst_parse_perform_link: linking some pad of GstJpegDec named jpegdec0 to some pad of GstVideoConvert named videoconvert0 (0/0) with caps "(NULL)"
0:00:00.015695365 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstutils.c:1771:gst_element_link_pads_full: trying to link element jpegdec0:(any) to element videoconvert0:(any)
0:00:00.015700565 115748 0x55c31303a800 INFO                GST_PADS gstutils.c:1034:gst_pad_check_link: trying to link jpegdec0:src and videoconvert0:sink
0:00:00.015708338 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:4237:gst_pad_peer_query:<videoconvert0:src> pad has no peer
0:00:00.016349746 115748 0x55c31303a800 INFO                GST_PADS gstutils.c:1587:prepare_link_maybe_ghosting: jpegdec0 and videoconvert0 in same bin, no need for ghost pads
0:00:00.016357053 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:2377:gst_pad_link_prepare: trying to link jpegdec0:src and videoconvert0:sink
0:00:00.016365180 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:4237:gst_pad_peer_query:<videoconvert0:src> pad has no peer
0:00:00.016984381 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:2585:gst_pad_link_full: linked jpegdec0:src and videoconvert0:sink, successful
0:00:00.016988676 115748 0x55c31303a800 INFO               GST_EVENT gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:00.016992407 115748 0x55c31303a800 INFO               GST_EVENT gstpad.c:5812:gst_pad_send_event_unchecked:<jpegdec0:src> Received event on flushing pad. Discarding
0:00:00.017004363 115748 0x55c31303a800 INFO            GST_PIPELINE grammar.y:648:gst_parse_perform_link: linking some pad of GstVideoConvert named videoconvert0 to some pad of GstAppSink named sink (0/0) with caps "(NULL)"
0:00:00.017010402 115748 0x55c31303a800 INFO        GST_ELEMENT_PADS gstutils.c:1771:gst_element_link_pads_full: trying to link element videoconvert0:(any) to element sink:(any)
0:00:00.017017054 115748 0x55c31303a800 INFO                GST_PADS gstutils.c:1034:gst_pad_check_link: trying to link videoconvert0:src and sink:sink
0:00:00.017135378 115748 0x55c31303a800 INFO                GST_PADS gstutils.c:1587:prepare_link_maybe_ghosting: videoconvert0 and sink in same bin, no need for ghost pads
0:00:00.017141586 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:2377:gst_pad_link_prepare: trying to link videoconvert0:src and sink:sink
0:00:00.017258307 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:2585:gst_pad_link_full: linked videoconvert0:src and sink:sink, successful
0:00:00.017261957 115748 0x55c31303a800 INFO               GST_EVENT gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:00.017265874 115748 0x55c31303a800 INFO               GST_EVENT gstpad.c:5812:gst_pad_send_event_unchecked:<videoconvert0:src> Received event on flushing pad. Discarding
0:00:00.017275731 115748 0x55c31303a800 INFO           GST_PARENTAGE gstbin.c:4478:gst_bin_get_by_name: [pipeline0]: looking up child element sink
0:00:00.017359463 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<sink> current NULL pending VOID_PENDING, desired next READY
0:00:00.017370220 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<sink> completed state change to READY
0:00:00.017375601 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<sink> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.017388084 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'sink' changed state to 2(READY) successfully
0:00:00.017394098 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<videoconvert0> current NULL pending VOID_PENDING, desired next READY
0:00:00.017398847 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<videoconvert0> completed state change to READY
0:00:00.017403500 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<videoconvert0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.017409940 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'videoconvert0' changed state to 2(READY) successfully
0:00:00.017415350 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<jpegdec0> current NULL pending VOID_PENDING, desired next READY
0:00:00.017420437 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<jpegdec0> completed state change to READY
0:00:00.017425108 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<jpegdec0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.017431212 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'jpegdec0' changed state to 2(READY) successfully
0:00:00.017436383 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<jpegparse0> current NULL pending VOID_PENDING, desired next READY
0:00:00.017441070 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<jpegparse0> completed state change to READY
0:00:00.017445579 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<jpegparse0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.017452638 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'jpegparse0' changed state to 2(READY) successfully
0:00:00.017457690 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<souphttpsrc0> current NULL pending VOID_PENDING, desired next READY
0:00:00.017462382 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<souphttpsrc0> completed state change to READY
0:00:00.017467122 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<souphttpsrc0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.017472885 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'souphttpsrc0' changed state to 2(READY) successfully
0:00:00.017480496 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2660:gst_element_continue_state:<pipeline0> committing state from NULL to READY, pending PLAYING, next PAUSED
0:00:00.017485667 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<pipeline0> notifying about state-changed NULL to READY (PLAYING pending)
0:00:00.017491357 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2668:gst_element_continue_state:<pipeline0> continue state change READY to PAUSED, final PLAYING
0:00:00.017499363 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<sink> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.017510818 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2959:gst_bin_change_state_func:<pipeline0> child 'sink' is changing state asynchronously to PAUSED
0:00:00.017516590 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<videoconvert0> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.017524079 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<videoconvert0> completed state change to PAUSED
0:00:00.017528891 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<videoconvert0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.017534721 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'videoconvert0' changed state to 3(PAUSED) successfully
0:00:00.017540162 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<jpegdec0> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.017546995 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<jpegdec0> completed state change to PAUSED
0:00:00.017551515 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<jpegdec0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.017557197 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'jpegdec0' changed state to 3(PAUSED) successfully
0:00:00.017562584 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<jpegparse0> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.017616452 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<jpegparse0> completed state change to PAUSED
0:00:00.017621561 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<jpegparse0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.017627523 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'jpegparse0' changed state to 3(PAUSED) successfully
0:00:00.017632840 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<souphttpsrc0> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.017786235 115748 0x55c31303a800 INFO               souputils gstsouputils.c:84:gst_soup_util_log_setup:<souphttpsrc0> Not setting up HTTP session logger. Need at least GST_LEVEL_TRACE
0:00:00.017829193 115748 0x55c31303a800 INFO                 basesrc gstbasesrc.c:1373:gst_base_src_do_seek:<souphttpsrc0> seeking: bytes segment start=0, offset=0, stop=-1, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0, base=0, position 0, duration -1
0:00:00.017846910 115748 0x55c31303a800 INFO                    task gsttask.c:460:gst_task_set_lock: setting stream lock 0x55c313296250 on task 0x55c31329a4d0
0:00:00.017852041 115748 0x55c31303a800 INFO                GST_PADS gstpad.c:6159:gst_pad_start_task:<souphttpsrc0:src> created task 0x55c31329a4d0
0:00:00.017888651 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<souphttpsrc0> completed state change to PAUSED
0:00:00.017893979 115748 0x55c31303a800 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<souphttpsrc0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.017900108 115748 0x55c31303a800 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'souphttpsrc0' changed state to 3(PAUSED) successfully
0:00:00.017931502 115748 0x55c3130500c0 INFO        GST_ELEMENT_PADS gstelement.c:925:gst_element_get_static_pad: no such pad 'sink' in element "souphttpsrc0"
0:00:00.017962461 115748 0x55c3130500c0 FIXME           videodecoder gstvideodecoder.c:946:gst_video_decoder_drain_out:<jpegdec0> Sub-class should implement drain()
0:00:00.393206353 115748 0x55c3130500c0 INFO             souphttpsrc gstsouphttpsrc.c:1129:gst_soup_http_src_got_headers:<souphttpsrc0> got headers
0:00:00.393329660 115748 0x55c3130500c0 INFO               GST_EVENT gstevent.c:900:gst_event_new_segment: creating segment event bytes segment start=0, offset=0, stop=-1, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0, base=0, position 0, duration -1
0:00:00.393346117 115748 0x55c3130500c0 INFO               GST_EVENT gstevent.c:900:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, offset=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:00.393353591 115748 0x55c3130500c0 INFO                 basesrc gstbasesrc.c:2962:gst_base_src_loop:<souphttpsrc0> marking pending DISCONT
0:00:00.424886965 115748 0x55c3130500c0 INFO               GST_EVENT gstevent.c:820:gst_event_new_caps: creating caps event image/jpeg, parsed=(boolean)true, format=(string)UYVY, width=(int)320, height=(int)240, framerate=(fraction)1/1
0:00:00.425034707 115748 0x55c3130500c0 INFO               GST_EVENT gstevent.c:820:gst_event_new_caps: creating caps event video/x-raw, format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)1/1
0:00:00.425632983 115748 0x55c3130500c0 INFO           basetransform gstbasetransform.c:1317:gst_base_transform_setcaps:<videoconvert0> reuse caps
0:00:00.425666153 115748 0x55c3130500c0 INFO               GST_EVENT gstevent.c:820:gst_event_new_caps: creating caps event video/x-raw, format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)1/1
0:00:00.425676681 115748 0x55c3130500c0 INFO               GST_EVENT gstevent.c:820:gst_event_new_caps: creating caps event video/x-raw, format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)1:4:0:0, framerate=(fraction)1/1
0:00:00.425883498 115748 0x55c3130500c0 INFO            videodecoder gstvideodecoder.c:3184:gst_video_decoder_clip_and_push_buf:<jpegdec0> First buffer since flush took 0:00:00.408336107 to produce
0:00:00.425909912 115748 0x55c3130500c0 INFO              GST_STATES gstbin.c:3421:bin_handle_async_done:<pipeline0> committing state from READY to PAUSED, old pending PLAYING
0:00:00.425913507 115748 0x55c3130500c0 INFO              GST_STATES gstbin.c:3452:bin_handle_async_done:<pipeline0> continue state change, pending PLAYING
0:00:00.425917534 115748 0x55c3130500c0 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<pipeline0> notifying about state-changed READY to PAUSED (PLAYING pending)
0:00:00.426076204 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:3248:gst_bin_continue_func:<pipeline0> continue state change PAUSED to PLAYING, final PLAYING
0:00:00.426152280 115748 0x7f8304017a40 INFO               GST_EVENT gstevent.c:1449:gst_event_new_latency: creating latency event 0:00:00.000000000
0:00:00.426167719 115748 0x7f8304017a40 INFO                     bin gstbin.c:2783:gst_bin_do_latency_func:<pipeline0> configured latency of 0:00:00.000000000
0:00:00.426180483 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<sink> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.426186380 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<sink> completed state change to PLAYING
0:00:00.426192021 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<sink> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.426200891 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'sink' changed state to 4(PLAYING) successfully
0:00:00.426207219 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<videoconvert0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.426212796 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<videoconvert0> completed state change to PLAYING
0:00:00.426215509 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<videoconvert0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.426220862 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'videoconvert0' changed state to 4(PLAYING) successfully
0:00:00.426224951 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<jpegdec0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.426228306 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<jpegdec0> completed state change to PLAYING
0:00:00.426231777 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<jpegdec0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.426236963 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'jpegdec0' changed state to 4(PLAYING) successfully
0:00:00.426240782 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<jpegparse0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.426243453 115748 0x55c3130500c0 INFO                 basesrc gstbasesrc.c:2981:gst_base_src_loop:<souphttpsrc0> pausing after gst_pad_push() = error
0:00:00.426244178 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<jpegparse0> completed state change to PLAYING
0:00:00.426252511 115748 0x55c3130500c0 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<souphttpsrc0> error: Internal data stream error.
0:00:00.426256555 115748 0x55c3130500c0 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<souphttpsrc0> error: streaming stopped, reason error (-5)
0:00:00.426252719 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<jpegparse0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.426266284 115748 0x55c3130500c0 INFO        GST_ERROR_SYSTEM gstelement.c:2153:gst_element_message_full_with_details:<souphttpsrc0> posting message: Internal data stream error.
0:00:00.426267032 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'jpegparse0' changed state to 4(PLAYING) successfully
0:00:00.426274393 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2503:gst_bin_element_set_state:<souphttpsrc0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:00.426279368 115748 0x55c3130500c0 INFO        GST_ERROR_SYSTEM gstelement.c:2180:gst_element_message_full_with_details:<souphttpsrc0> posted error message: Internal data stream error.
0:00:00.426284702 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<souphttpsrc0> completed state change to PLAYING
0:00:00.426288650 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<souphttpsrc0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:00.426293163 115748 0x7f8304017a40 INFO              GST_STATES gstbin.c:2952:gst_bin_change_state_func:<pipeline0> child 'souphttpsrc0' changed state to 4(PLAYING) successfully
0:00:00.426296598 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2688:gst_element_continue_state:<pipeline0> completed state change to PLAYING
Error from Some0:00:00.426299839 115748 0x7f8304017a40 INFO              GST_STATES gstelement.c:2588:_priv_gst_element_state_changed:<pipeline0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
("/GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0"): Internal data stream error. (Some("gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0:\nstreaming stopped, reason error (-5)"))
0:00:01.427248884 115748 0x55c3130500c0 INFO                    task gsttask.c:312:gst_task_func:<souphttpsrc0:src> Task going to paused

Unfortunately that log didn’t contain the error details, might need one with a higher log level GST_DEBUG=*:6 or so (can compress with xz -9 foo.dbg before attaching it).

here you have the link to the file

I can see in the following block part of the error, related when creating the connection that might take some time to stablish thus crashing the gst pipeline ?

My best guess is that it’s actually your new_sample callback function that returns a FlowError here and basesink just relays that back to the upstream elements.

I found the solution – I was missing to explicitly add in the pipeline the RGB conversion. Now it looks like:

pub fn rtsp_camera_pipeline_description(url: &str, latency: u32) -> String {
    format!(
        "rtspsrc location={} latency={} ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=RGB ! appsink name=sink",
        url, latency,
    )
}

You can see a full working example here: kornia-rs/examples/rtspcam/src/main.rs at main · kornia/kornia-rs · GitHub