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.

Gstreamer performance issue on DRA7xx

Hi,


   There is a multimedia data sheet processors.wiki.ti.com/index.php says


  the perfomance can be tested by gst-launch-1.0 videotestsrc num-buffers=250 ! '<capture format>' ! vpe num-input-buffers=5 ! queue ! <ducati encoder> ! queue ! filesink location=xxx


   But after tried it, there is no IVA loading output? So actually the IVA loading is tested or caculated?


   And when I test the resolution 2560x1440 which is bigger than 1080p, there is some problem. 15fps is fine, but 30fps failed. If the performance benchmark is true, why 30fps 2560x1440 failed? Where is the bottlenek?

root@dra7xx-evm:~#  gst-launch-1.0 -e videotestsrc ! 'video/x-raw, format=(string)NV12, height=(int)1440, width=(int)2560, framerate=(fraction)30/1' ! vpe ! ducatih264enc ! filesink location=test.h264
Setting pipeline to PAUSED ...
[ 1558.767731] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0: Could not encode stream.
Additional debug info:
gstducatividenc.c(674): gst_ducati_videnc_handle_frame (): /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
root@dra7xx-evm:~#

gst-launch-1.0 -e videotestsrc ! 'video/x-raw, format=(string)NV12, height=(int)1440, width=(int)2560, framerate=(fraction)15/1' ! vpe ! ducatih264enc ! filesink location=test.h264
Setting pipeline to PAUSED ...
[ 1529.103234] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:00:07.092213618
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...


Best Regards.


   Marvin

  • Hi Marvin, 

                 There are some extra steps to be followed for IVA HD  load to be printed in trace0 logs. The steps are documented in http://opbuwiki.dal.design.ti.com/index.php/GLSDK_tech_support#Ducati_performance_measurement

    I have tested only 1080p and 720p resolutions. I would need more logs to comment on what is going wrong. I have 2 suspicions :

    1. Encoder might be returning error like unsupported resolution. To verify this run the pipeline with --gst-debug=*ducati*:4  This should print extra debug informations.

    2. Some encode parameters like level, bitrate etc needs to be set accordingly for the new resolution.  

    Regards,

    Pooja Prajod

  • Pooja,
    Here is the log:
    root@dra7xx-evm:~# gst-launch-1.0 --gst-debug=*ducati*:4 -e videotestsrc ! 'video/x-raw, format=(string)NV12, height=(int)1440, width=(int)2560, framerate=(fraction)30/1' ! vpe ! ducatih264enc ! filesink location=test.h264
    Setting pipeline to PAUSED ...
    [ 6666.707403] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    0:00:00.120033360 1216 0x12a440 INFO ducati gstducatividenc.c:497:gst_ducati_videnc_allocate_params_default:<ducatih264enc0> started
    Pipeline is PREROLLING ...
    0:00:00.186166632 1216 0x11ef50 ERROR ducati gstducatividenc.c:316:gst_ducati_videnc_configure:<ducatih264enc0> XDM_SETPARAMS err=-1, extendedError=00000001
    0:00:00.186246013 1216 0x11ef50 ERROR ducati gstducati.c:60:gst_ducati_log_extended_error_info: Bit 0 (00000001): unknown
    ERROR: from element /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0: Could not encode stream.
    Additional debug info:
    gstducatividenc.c(674): gst_ducati_videnc_handle_frame (): /GstPipeline:pipeline0/GstDucatiH264Enc:ducatih264enc0
    ERROR: pipeline doesn't want to preroll.
    Setting pipeline to NULL ...
    Freeing pipeline ...
  • Looks like it's a parameter issue. I donot know the exact parmeters for 2560x1440@30fps encoding. You can try setting higher level and bitrate.
  • Hi Marvin,

    For 2560x1440 resolution, default level 40 in ducati encoder plugin results in failure. Set level to 51 as shown in the below pipeline and try

    gst-launch-1.0 --gst-debug=1 videotestsrc ! 'video/x-raw, format=(string)NV12, height=(int)1440, width=(int)2560, framerate=(fraction)30/1' ! vpe ! ducatih264enc 'level=51' ! filesink location=test.h264

  • Ramprasad,

    Thanks a lot for the pipeline, yes it can work for encoding now, but here are two quesiton:

    1. How to make it real time which means encoding 2560x1440 with 30 FPS, I have tried below command line, looks like the execution time cost is not expected.

    gst-launch-1.0 videotestsrc num-buffers=300 ! 'video/x-raw, format=(string)NV12, height=(int)1440, width=(int)2560,framerate=(fraction)30/1' ! vpe ! ducatih264enc 'level=51' ! filesink location=test.h264

    300 frames cost 21 seconds

    gst-launch-1.0 --gst-debug=1 videotestsrc num-buffers=180 ! 'video/x-raw, format=(string)NV12, height=(int)1440, width=(int)2560,framerate=(fraction)30/1' ! vpe ! ducatih264enc 'level=51' ! filesink location=test.h264

    180 frames cost 12.7 seconds.

    raction)30/1' ! vpe ! ducatih264enc 'level=51' ! filesink location=test.h264e=(f
    Setting pipeline to PAUSED ...
    [  270.194478] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    Pipeline is PREROLLING ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Got EOS from element "pipeline0".
    Execution ended after 0:00:21.452363308
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...
    raction)30/1' ! vpe ! ducatih264enc 'level=51' ! filesink location=test.h264e=(f
    Setting pipeline to PAUSED ...
    [  314.863837] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
    Pipeline is PREROLLING ...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Got EOS from element "pipeline0".
    Execution ended after 0:00:12.759375332
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@dra7xx-evm:~#

    2. How to test it with filesrc? Because my customer want to encode their own YUV test sequences, not just videotestsrc.

    Best Regards.

       Marvin

  • Hi Marvin,
    1) I measured time taken to encode a 2560x1440 resolution using gettiemofday with videnc2test application.
    I am seeing 24 to 28ms to get a frame encoded with VIDENC2_process(). So it should be possible to encode 2560x1440 at 30fps.

    With gstreamer, I am also observing ~20s to encode 300 frames. In gst-plugin-ducati/src/gstducatividenc.c also time taken for VIDENC2_process is being measured, with --gst-debug=5 I am seeing this number coming to ~26 - 27ms for few frames.
    So conclusion is encoder would not be bottle-neck here to achieve 30fps

    In gst-plugin-ducati/src/gstducatividenc.c Encoder's input buffer is filled/memcpy with videotestsrc pattern using gst_buffer_fill(). I guess this may also be causing latency.

    2) I am not sure how we can use filesrc instead of videotestsrc for encoding. Will get back to you on this.

    Ramprasad
  • Hi Marvin,
    I could use filesrc and encode a yuv file with below pipeline.

    gst-launch-1.0 --gst-debug=1 filesrc location=input_2560x1440_420SP_150fr.yuv ! videoparse width=2560 height=1440 format=nv12 ! vpe ! ducatih264enc 'level=51' ! filesink location=test.h264

    Can you please try this pipeline?

    Ramprasad
  • Ramprasad,

       Would you please let me know which gst version you have tested? 1.6 or 1.2.3?

    Best Regards.

       Marvin

  • Hi Marvin,

    I executed this pipeline with PSDKLA 3.01 images which has gst1.6

    Is there issue with gst1.2?

    Ramprasad

  • Yes, gst1.2 can not run filesrc with your pipeline. Would you please check it?
  • Hi Marvin,

                  My best guess is that the parser element accepts peer bufferpool in gst 1.6 and not in gst1.2. A code comparison is required to confirm this. I will get back to you on this asap.

    Regards,

    Pooja Prajod

  • Pooja,
    Would I know your investigation result? Would you please guide me to understand the code better, I can not see why gst1. can not work with filesrc.
    Best Regards.
    Marvin
  • Hi Marvin,
    From the code comparisons I did till now, the difference has to be because of the drm allocator which is added in gst1.6. If you look at vpe code, you can see that gst1.6 provides this allocator through allocation query. Such an allocator was not existing in gst1.2. So the peer element cannot allocate buffers using this drm allocator in gst 1.2. Vpe and ducati plugins strictly work with drm buffers.

    Regards,
    Pooja Prajod
  • Hi,Pooja Prajod
    I'm doing experiments about video stitich,So I need to customize the encoding resolution。
    I encountered the same problem,when I set the height=(int)450, width=(int)1600,the encoder pipeline can work success。But when I set the height=(int)450, width=(int)1500,it failed。I have set up the ducatih264enc bitrate=4096 ,level=51。
    the error log:
    Error received from element encode: Could not encode stream.
    Debugging information: gstducatividenc.c(674): gst_ducati_videnc_handle_frame (): /GstPipeline:test-pipeline/GstDucatiH264Enc:encode

    how to solve it,I need your help

    Regards,

    Xu
  • Hi Xu,

          I don't think your issue is same as the one mentioned in this thread. Please create a new thread with the exact pipeline you are trying, description of your setup and the issue you are facing.

    Regards,

    Pooja Prajod