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.

J784S4XEVM: timosaic don't work with v4l2h265enc

Part Number: J784S4XEVM

Tool/software:

Hi,

We tried to use timosaic element but simple pipeline with v4l2h265enc don't work:

GST_DEBUG=3 gst-launch-1.0                                                                                                      \
videotestsrc num-buffers=12 pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_0   \
videotestsrc num-buffers=12 pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_1   \
videotestsrc num-buffers=12 pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_2   \
videotestsrc num-buffers=12 pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_3   \
timosaic name=mosaic                                                                                                \
sink_0::startx=0 sink_0::starty=0                                                                                   \
sink_1::startx=640 sink_1::starty=480                                                                               \
sink_2::startx=0 sink_2::starty=480                                                                                 \
sink_3::startx=640 sink_3::starty=0 !                                                                               \
v4l2h265enc ! fakesink -v

The element itself works fine if v4l2h265enc is removed from the pipeline, so it look like some integration issues between two H/W accelerated elements.

Can you please check it ?

We are using SDK 10 - > oe-layersetup/configs/processor-sdk-analytics  /processor-sdk-analytics-10.00.00-config.txt

  • Hi Bartosz,

    Can you please use below pipeline

    GST_DEBUG=3 gst-launch-1.0 \
    videotestsrc num-buffers=12 pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_0 \
    videotestsrc num-buffers=12 pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_1 \
    videotestsrc num-buffers=12 pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_2 \
    videotestsrc num-buffers=12 pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_3 \
    tiovxmosaic name=mosaic \
    sink_0::startx=0 sink_0::starty=0 \
    sink_1::startx=640 sink_1::starty=480 \
    sink_2::startx=0 sink_2::starty=480 \
    sink_3::startx=640 sink_3::starty=0 ! \
    v4l2h265enc output-io-mode=5 ! fakesink -v

    tiovxmosaic uses HWA for processing

    Regards
    Rahul T R

  • We cannot use tiovxmosaic as it don't work in our use case. We need to put one image on top of another. With

    tiovxmosaic the end result is incorrect, looks like two images are blended. We need the second image to cover the first one. timosaic gives us correct result. Please see  attached screenshots:

    gst-launch-1.0                                                                                                      \
    videotestsrc num-buffers=2 pattern=smpte ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_0   \
    videotestsrc num-buffers=2 pattern=ball ! video/x-raw,format=NV12, width=320, height=240 ! queue ! mosaic.sink_1   \
    timosaic name=mosaic                                                                                                \
    sink_0::startx=0 sink_0::starty=0                                                                                   \
    sink_1::startx=0 sink_1::starty=0 !                                                                               \
    filesink location=/tmp/mosaic_640x480.yuv




    gst-launch-1.0                                                                                                      \
    videotestsrc num-buffers=2 pattern=smpte ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_0   \
    videotestsrc num-buffers=2 pattern=ball ! video/x-raw,format=NV12, width=320, height=240 ! queue ! mosaic.sink_1   \
    tiovxmosaic name=mosaic                                                                                             \
    sink_0::startx="<0>" sink_0::starty="<0>"                                                                           \
    sink_1::startx="<0>" sink_1::starty="<0>" !                                                                         \
    filesink location=/tmp/ovxmosaic_640x480.yuv

  • Hi Bartosz,

    Please use below pipeline

    GST_DEBUG=3 gst-launch-1.0 \
    videotestsrc pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_0 \
    videotestsrc pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_1 \
    videotestsrc pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_2 \
    videotestsrc pattern=ball ! video/x-raw,format=NV12, width=640, height=480 ! queue ! mosaic.sink_3 \
    timosaic name=mosaic \
    sink_0::startx=0 sink_0::starty=0 \
    sink_1::startx=640 sink_1::starty=480 \
    sink_2::startx=0 sink_2::starty=480 \
    sink_3::startx=640 sink_3::starty=0 ! \
    queue ! tiovxmemalloc ! v4l2h265enc output-io-mode=dmabuf-import ! fakesink -v

    Regards
    Rahul T R

  • Thanks Rahul, adding tiovxmemalloc fixed our pipeline.

    As you mentioned the tiovxmosaic is using HWA for processing and offers better performance, can it be configured to achieve same result as timosaic  eg. put one image on top of another without blending them?

  • Hi Bartosz,

    By default, MSC uses both the instances of MSC
    and the work in parallel, ie is reason for the behavior your are seeing

    We can change it use only one instance of MSC, Please add below property
    to tiovxmosaic target=0. This might fix your issue

    Regards
    Rahul T R

  • Thanks using tiovxmosaic with target=0 or target=1  fixes the issue.
    I noticed that tiovxmosaic uses only VPAC1, on J784S4XEVM there are two instances. Is there HW limitation that tiovxmosaic works only on VPAC1 or is that missing functionality of gstremear module?

  • Hi Bartosz,

    Seems like this is limitation in tiovxmosaic plugin
    This support needs to be added

    Regards
    Rahul T R

  • Hi Rahul,

    At the moment, we do not need tiovxmosaic to work with a second VPAC, but that might change in the future. Is there any timeline for supporting VPAC2?

  • Hi Bartosz,

    I do not have timelines for this
    Its a simple change in the code

    You can modify edgeai-gst-plugins code to use VPAC2
    https://github.com/TexasInstruments/edgeai-gst-plugins/blob/fea12213b449fc1ea117ad5f0016c08f417ab46d/ext/tiovx/gsttiovxmosaic.c#L430

    and recompile on the target using below steps

    edgeai-gst-plugins/README.md at main · TexasInstruments/edgeai-gst-plugins

    Regards
    Rahul T R