This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GLSDK gstreamer Ducati Plugin - Multiple Streams

Hello, 

I’m trying to receive and display more than one mjpeg encoded stream to the DRA7xx. With one stream, this is working fine, using the ducatijpegdec and following pipeline:

gst-launch-1.0 -e tcpclientsrc host=192.168.1.220 port=5001 do-timestamp=true ! jpegparse ! ducatijpegdec ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)720, height=(int)480' ! kmssink scale=false

 But I would like to receive more than one stream, at least two would be nice, displayed next to each other. Therefore I was experimenting with videomixer plugin, but didn’t succeed with it when using the ducatijpegdec, due to missing timestamp information. So I switched to compositor plugin, which is working when using the software jpeg decoder.

 Pipeline that is working, but slow:

gst-launch-1.0 \

  videotestsrc pattern=0 ! \

  video/x-raw,format=AYUV,framerate=\(fraction\)20/1,width=1920,height=1080 ! \

  compositor name=comp sink_0::alpha=0.5 sink_1::alpha=1 ! \

  videoconvert ! vpe ! kmssink scale=false \

  tcpclientsrc host=192.168.1.220 port=5001 ! jpegparse ! jpegdec ! videoconvert ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)720, height=(int)480' ! \

  comp.

 

Not working with ducatijpegdec:

gst-launch-1.0 \

  videotestsrc pattern=0 ! \

  video/x-raw,format=AYUV,framerate=\(fraction\)20/1,width=1920,height=1080 ! \

  compositor name=comp sink_0::alpha=0.5 sink_1::alpha=1 ! \

  videoconvert ! vpe ! kmssink scale=false \

  tcpclientsrc host=192.168.1.220 port=5001 ! jpegparse ! ducatijpegdec ! videoconvert ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)720, height=(int)480' ! \

  comp.

 

This one is crashing with following output:

Pipeline is PREROLLING ...

ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.

Additional debug info:

gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:

streaming task paused, reason error (-5)

ERROR: pipeline doesn't want to preroll.

Setting pipeline to NULL ...

Caught SIGSEGV

 

Do you have any suggestions how to display two streams? Is this even possible using the hardware decoder or can it be instantiated only once? Can the output of the hardware decoder be routed to videomixer or compositor somehow?

 

Thank you very much.

 

Best regards,

Steffen

  • Hello,

    I am not aware with GLSDK but I would recommend you to add --gst-debug=3 for more debug prints.

    BR
    Margarita
  • Okay that might be helpful for debugging, here is the output:

    Setting pipeline to PAUSED ...
    0:00:00.152446971 3051 0x180e00 FIXME default gstutils.c:3643:gst_pad_create_stream_id_internal:<videotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
    Pipeline is PREROLLING ...
    0:00:00.157568693 3051 0x1595b0 FIXME default gstutils.c:3643:gst_pad_create_stream_id_internal:<tcpclientsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
    0:00:00.208189096 3051 0x1595b0 WARN vpe gstvpebufferpool.c:545:gst_vpe_buffer_pool_get: Allocating a new input buffer index: 0/128, 0
    0:00:00.227428496 3051 0x1595b0 WARN ducati gstducatividdec.c:555:codec_process:<ducatijpegdec0> changing max-ref-frames in caps to 1
    0:00:00.234878466 3051 0x159580 WARN bufferpool gstbufferpool.c:302:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:00.245224880 3051 0x159580 WARN bufferpool gstbufferpool.c:302:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:00.245975261 3051 0x159550 WARN videoaggregator gstvideoaggregator.c:1229:gst_videoaggregator_aggregate:<comp> Error collecting buffers
    0:00:00.246152893 3051 0x159550 WARN videoaggregator gstvideoaggregator.c:1229:gst_videoaggregator_aggregate:<comp> Error collecting buffers
    0:00:00.246254722 3051 0x180e00 WARN basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
    0:00:00.246324506 3051 0x180e00 WARN basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason error (-5)
    0:00:00.246584285 3051 0x159550 WARN videoaggregator gstvideoaggregator.c:1229:gst_videoaggregator_aggregate:<comp> Error collecting buffers
    ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
    Additional debug info:
    gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
    streaming task paused, reason error (-5)
    ERROR: pipeline doesn't want to preroll.
    Setting pipeline to NULL ...
    Caught SIGSEGV
    exec gdb failed: No such file or directory
    Spinning. Please run 'gdb gst-launch-1.0 3051' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
  • Hi,

       I don't think you require videoconvert between ducati plugin and vpe (! ducatijpegdec ! videoconvert ! vpe !).

    Also for dual decode and display test cases I recommend using waylandsink.  There is no decoder limitation on number of instances. However dual decode scenarios are tested with waylandsink. We cannot run 2 instance of kmssink.

     For the query on compositor plugin, i'm not sure if the plugin can work out of dmabufs. Even if it does, the expected metadata will not be set. 

    The receiving side would look like(src protocol and stream formats can be different ):

    gst-launch-1.0 udpsrc port=8000 ! tsdemux ! h264parse ! ducatih264dec max-reorder-frames=1 ! queue ! waylandsink sync=false

     gst-launch-1.0 udpsrc port=8004 ! tsdemux ! h264parse ! ducatih264dec max-reorder-frames=1 ! queue ! waylandsink sync=false

    Regards,
    Pooja Prajod
  • Hi,

    I tested the previous commands without videoconvert between ducatijpeg and vpe:

    gst-launch-1.0  --gst-debug=3 \
      videotestsrc pattern=0 ! \
      video/x-raw,format=AYUV,framerate=\(fraction\)20/1,width=1920,height=1080 ! \
      compositor name=comp sink_0::alpha=0.5 sink_1::alpha=1 ! \
      videoconvert ! vpe ! kmssink scale=false \
      tcpclientsrc host=192.168.1.220 port=5001 ! jpegparse ! ducatijpegdec ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)720, height=(int)480' ! \
      comp.

    It doesn't show a picture, but gives an error:

    Setting pipeline to PAUSED ...[ 2394.249530] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    
    0:00:00.149851949  2913   0x17d6c0 FIXME                default gstutils.c:3643:gst_pad_create_stream_id_internal:<videotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
    Pipeline is PREROLLING ...
    0:00:00.154295189  2913   0x17d600 FIXME                default gstutils.c:3643:gst_pad_create_stream_id_internal:<tcpclientsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
    0:00:00.178312434  2913   0x17d600 WARN                     vpe gstvpebufferpool.c:545:gst_vpe_buffer_pool_get: Allocating a new input buffer index: 0/128, 0
    0:00:00.197754517  2913   0x17d600 WARN                  ducati gstducatividdec.c:555:codec_process:<ducatijpegdec0> changing max-ref-frames in caps to 1
    0:00:00.204315352  2913   0x17d660 WARN              bufferpool gstbufferpool.c:302:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:00.213438024  2913   0x17d600 WARN                     vpe gstvpebufferpool.c:545:gst_vpe_buffer_pool_get: Allocating a new input buffer index: 1/128, 1
    0:00:00.218192770  2913   0x17d660 WARN              bufferpool gstbufferpool.c:302:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:00.218901834  2913   0x1595b0 WARN         videoaggregator gstvideoaggregator.c:1229:gst_videoaggregator_aggregate:<comp> Error collecting buffers
    0:00:00.219054741  2913   0x1595b0 WARN         videoaggregator gstvideoaggregator.c:1229:gst_videoaggregator_aggregate:<comp> Error collecting buffers
    0:00:00.219140466  2913   0x17d6c0 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
    0:00:00.219194634  2913   0x17d6c0 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason error (-5)
    0:00:00.219454901  2913   0x1595b0 WARN         videoaggregator gstvideoaggregator.c:1229:gst_videoaggregator_aggregate:<comp> Error collecting buffers
    ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
    Additional debug info:
    gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
    streaming task paused, reason error (-5)
    ERROR: pipeline doesn't want to preroll.
    Setting pipeline to NULL ...
    0:00:00.228411978  2913   0x17d660 WARN              bufferpool gstbufferpool.c:302:do_alloc_buffer:<vpebufferpool1> alloc function failed
    0:00:00.239367415  2913   0x181240 WARN              bufferpool gstbufferpool.c:539:gst_buffer_pool_set_active:<vpebufferpool0> stop failed
    0:00:00.248701391  2913   0x17d600 WARN                  ducati gstducatividdec.c:1380:gst_ducati_viddec_chain:<ducatijpegdec0> acquire buffer from externalpool failed flushing
    0:00:00.249458442  2913   0x181240 WARN              bufferpool gstbufferpool.c:539:gst_buffer_pool_set_active:<vpebufferpool0> stop failed
    0:00:00.249558157  2913   0x181240 WARN              bufferpool gstbufferpool.c:539:gst_buffer_pool_set_active:<vpebufferpool1> stop failed
    
    (gst-launch-1.0:2913): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed
    0:00:00.251920239  2913   0x181240 WARN              bufferpool gstbufferpool.c:539:gst_buffer_pool_set_active:<vpebufferpool1> stop failed
    0:00:00.265487290  2913   0x17d600 WARN                  ducati gstducatividdec.c:715:codec_process:<ducatijpegdec0> push failed flushing
    0:00:00.265618887  2913   0x17d600 WARN                  ducati gstducatividdec.c:1462:gst_ducati_viddec_chain:<ducatijpegdec0> push from codec_process failed flushing
    0:00:00.266766338  2913   0x181240 WARN                  ducati gstducatividdec.c:535:codec_process:<ducatijpegdec0> err=-1, extendedError=00000000
    

    Using waylankdsink seems to be a good solution. 

    At least two streams are working fine. Is there a way to rearrange the position on the screen automatically? By default all streams are displayed one over another.

  • Hello,

    Here is an example:
    .... videomixer name=mix sink_1::xpos=520 sink_1::ypos=960 sink_1::alpha=0.3 sink_1::zorder=3 sink_2::xpos=400 sink_2::ypos=100 sink_2::zorder=2 ! ....


    BR
    Margarita
  • Thanks, but videomixer isn't helpful here, since it is not working with ducatijpegdec, at least in my configuration it isn't.
  • Hi,

       No, we do not support window positioning on waylandsink. For more details refer: e2e.ti.com/.../1930637