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.

AM5728: GStreamer not working with videomixer

Part Number: AM5728

Hi,

I have run below pipeline in x86 architecture and it works fine.

gst-launch-1.0 videotestsrc pattern=1 ! video/x-raw,format=AYUV,framerate=10/1,width=100,height=100 ! videobox border-alpha=0 top=-70 bottom=-70 right=-220 ! videomixer name=mix sink_0::alpha=0.7 sink_1::alpha=0.5 !videoconvert ! xvimagesink videotestsrc ! video/x-raw,format=AYUV,framerate=\(fraction\)5/1,width=320,height=240 ! mix.

For AM5728 i have modified pipeline according to necessity like below.

gst-launch-1.0 videotestsrc pattern=1 ! video/x-raw,format=AYUV,framerate=10/1,width=100,height=100 ! videobox border-alpha=0 top=-70 bottom=-70 right=-220 ! videomixer name=mix sink_0::alpha=0.7 sink_1::alpha=0.5 ! autovideoconvert ! ducatih264enc ! eirtspserver ! fakesink videotestsrc ! video/x-raw,format=AYUV,framerate=\(fraction\)5/1,width=320,height=240 ! mix.

while running pipeline it gives error like below

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
WARNING: from element /GstPipeline:pipeline0/GstAutoVideoConvert:autovideoconvert0/GstAutoConvert:autoconvertchild/GstVideoConvert:videoconvert0: Internal GStreamer error: code not implemented.  Please file a bug at bugzilla.gnome.org/enter_bug.cgi
Additional debug info:
../../../../gst-plugins-base-1.6.3/gst-libs/gst/video/gstvideofilter.c(292): gst_video_filter_transform (): /GstPipeline:pipeline0/GstAutoVideoConvert:autovideoconvert0/GstAutoConvert:autoconvertchild/GstVideoConvert:videoconvert0:
invalid video buffer received
MmRpc_call: Error: write failed
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
Additional debug info:
../../../../gstreamer-1.6.3/libs/gst/base/gstbasesrc.c(2943): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason error (-5)
ERROR: pipeline doesn't want to preroll.
../git/libdce.c:965:    process    ERROR: Failed eError == DCE_EOK error val -5Setting pipeline to NULL ...
Freeing pipeline ...

autovideoconvert works fine for other pipeline in AM5728.

Any solution for this error.

Regards,

Prerak

 

  • Hello,

    Please check these pipelines.
    This is working on my side with videomixer and compositor elements:

    1. With compositor element:
    gst-launch-1.0 compositor name=mixer ! videoconvert ! waylandsink videotestsrc pattern=18 ! "video/x-raw,format=AYUV,width=800,height=600,framerate=(fraction)30/1" ! queue ! mixer. videotestsrc pattern=13 ! "video/x-raw,format=AYUV,width=320,height=240,framerate=(fraction)10/1" ! queue ! mixer.

    gst-launch-1.0 compositor name=mixer ! videoconvert ! waylandsink videotestsrc pattern=snow ! "video/x-raw,format=AYUV,width=800,height=600,framerate=(fraction)30/1" ! queue ! mixer. videotestsrc pattern=13 ! "video/x-raw,format=AYUV,width=320,height=240,framerate=(fraction)10/1" ! queue ! mixer.

    2.With videomixer element:
    gst-launch-1.0 videomixer name=mixer ! videoconvert ! waylandsink videotestsrc pattern=snow ! "video/x-raw,format=AYUV,width=800,height=600,framerate=(fraction)30/1" ! queue ! mixer. videotestsrc pattern=13 ! "video/x-raw,format=AYUV,width=320,height=240,framerate=(fraction)10/1" ! queue ! mixer.

    gst-launch-1.0 videomixer name=mixer ! videoconvert ! waylandsink videotestsrc pattern=18 ! "video/x-raw,format=AYUV,width=800,height=600,framerate=(fraction)30/1" ! queue ! mixer. videotestsrc pattern=13 ! "video/x-raw,format=AYUV,width=320,height=240,framerate=(fraction)10/1" ! queue ! mixer.


    Hope this helps.

    BR
    Margarita

  • Hi Margarita,

    Videomixer is now working. Thanks for your support.

    I have another issue regarding CPU usage of "videomixer" element . It takes 160% cpu.
    Any solution to reduce cpu usage?

    Regards,
    Prerak
  • Hello,

    Did you try with compositor element instead of videomixer?
    The videomixer element is not a TI element. If you have videoconvert element also it will add additional CPU load if it does scs.

    BR
    Margarita
  • Hi ,

    yes i have tried. it reduces CPU usage to 125% which is still very high.

    Any TI element who works exatly as the videomixer or compositor?

    I have not use any videoconvert element.

    Regards,
    Prerak
  • Hello,

    No.

    Could you post the pipeline that you are using?

    BR
    Margarita
  • Hi,

    gst-launch-1.0 -e videomixer name=mix sink_0::xpos=0 sink_0::ypos=912 sink_1::xpos=0 sink_1::ypos=0 sink_2::ypos=0 sink_2::xpos=912 sink_3::xpos=912 sink_3::ypos=912  ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)1824, height=(int)1824, framerate=15/1' ! queue min-threshold-buffers=2 ! ducatih264enc rate-preset=1 ! rtspserver ! fakesink v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=15/1' ! ducatijpegdec ! tee name=t ! queue ! videocrop left = 0 right=2736 ! videoflip method=3 ! mix. t. ! queue ! videocrop left = 912 right=1824 ! videoflip method=3 ! mix. t. ! queue ! videocrop left = 1824 right=912 ! videoflip method=1 ! mix. t. ! queue ! videocrop left = 2736 right=0 ! videoflip method=1 ! mix.

    Regards,

    Prerak

  • Hello,

    It seems normal the CPU load to be very high. All the elements are running on A15 except ducatih264enc and ducatijpegdec.
    You could try to increase queue's property max-size-buffers > 200 and use compositor element.

    BR
    Margarita
  • Hi,

    I have tried as per your suggestion.

    modified pipeline:
    gst-launch-1.0 -e compositor name=mix sink_0::xpos=0 sink_0::ypos=912 sink_1::xpos=0 sink_1::ypos=0 sink_2::ypos=0 sink_2::xpos=912 sink_3::xpos=912 sink_3::ypos=912 ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)1824, height=(int)1824, framerate=15/1' ! queue min-threshold-buffers=2 ! ducatih264enc rate-preset=1 ! eirtspserver ! fakesink v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=15/1' ! ducatijpegdec ! tee name=t ! queue max-size-buffers=250 ! videocrop left = 0 right=2736 ! videoflip method=3 ! mix. t. ! queue max-size-buffers=250 ! videocrop left = 912 right=1824 ! videoflip method=3 ! mix. t. ! queue max-size-buffers=250 ! videocrop left = 1824 right=912 ! videoflip method=1 ! mix. t. ! queue max-size-buffers=250 ! videocrop left = 2736 right=0 ! videoflip method=1 ! mix.

    Still CPU goes up to 135%. Any solution for this problem?

    Regards,
    Prerak
  • Hello,

    Could you try:
    1.add some more queues and max-size-buffers=500?
    2.set fakesink sync=true?



    BR
    Margarita

  • Hello,

    I am sorry, I edited my previous post please check it.

    Regards,
    Margarita
  • Hi Margarita,

    why AM5728 does not have support of glvideomixer ?

    Regards,
    Prerak
  • Hello,

    What is the gstreamer version that you are using?
    Unfortunately, I am not the right person to answer this question.
    As I said you could try to use compositor element.
    With gst-inspect-1.0 | grep "mixer" you could check the available elements.

    BR
    Margarita
  • Hi,

    I am using gstreamer-1.6.3 in am5728.
    Atully i have used compositor element, but that does not setisfy my need as cpu utilization is still at 130%.

    I have read that gst-plugin-bad have support of opengl and in that they have glvideomixer element.
    But as i have chaked in yocto, gst-plugin-bad does not have that element.


    Regards,
    Prerak
  • Hello,

    We do not have glvideomixer element as you could check:
    root@am57xx-evm:~# gst-inspect-1.0 glvideomixer
    No such element or plugin 'glvideomixer'

    Did you try to set fakesink sync=true ?

    I will give you and example what I mean when the sync is true. If I use this pipeline:

    gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1' ! fakesink sync=false &

    The CPU load is ~ 98.7:

    1095 root 20 0 34984 14420 4688 S 98.7 0.8 0:22.38 gst-launch+

    But If I use this pipeline:

    gst-launch-1.0 videotestsrc ! 'video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)30/1' ! fakesink sync=true &

    The CPU load is < 45
    1089 root 20 0 34984 14512 4780 S 44.2 0.8 0:07.06 gst-launch+



    BR
    Margarita
  • Hi,

    I have used sync=true after fake sink, but there is no any effect on cpu usage.

    Regards,
    Prerak