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.

problem with video encoder/Gstreamer on L138

Other Parts Discussed in Thread: OMAP-L138

Hallo,

I have OMAP-L138 and I use DVSDK 04.03.00.06.

I tried to run gstreamer to encode NV12 stream generated by videotestsrc:

# gst-launch videotestsrc num-buffers=50 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=(int)720,height=(int)576,framerate=(fraction)25/1' ! queue max-size-buffers=50 max-size-bytes=622080 !  TIVidenc1 codecName=mpeg4enc engineName=codecServer iColorSpace=NV12 resolution=720x576 framerate=25 ! filesink location=movie.m4v -v
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)NV12, color-matrix=(string)sdtv, chroma-site=(string)mpeg2, width=(int)720, height=(int)576, framerate=(fraction)25/1
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)NV12, color-matrix=(string)sdtv, chroma-site=(string)mpeg2, width=(int)720, height=(int)576, framerate=(fraction)25/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)NV12, color-matrix=(string)sdtv, chroma-site=(string)mpeg2, width=(int)720, height=(int)576, framerate=(fraction)25/1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)NV12, color-matrix=(string)sdtv, chroma-site=(string)mpeg2, width=(int)720, height=(int)576, framerate=(fraction)25/1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)NV12, color-matrix=(string)sdtv, chroma-site=(string)mpeg2, width=(int)720, height=(int)576, framerate=(fraction)25/1
/GstPipeline:pipeline0/GstTIVidenc1:tividenc10.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)NV12, color-matrix=(string)sdtv, chroma-site=(string)mpeg2, width=(int)720, height=(int)576, framerate=(fraction)25/1
ERROR: from element /GstPipeline:pipeline0/GstTIVidenc1:tividenc10: failed to encode video buffer

Additional debug info:
gsttividenc1.c(1418): gst_tividenc1_encode (): /GstPipeline:pipeline0/GstTIVidenc1:tividenc10
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
/GstPipeline:pipeline0/GstTIVidenc1:tividenc10.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = NULL
Freeing pipeline ...

if I run with CE_DEBUG=5 I read this:

@3,222,975us: [+1 T:0x4191d490 S:0x4191c714] OM - Memory__getPhysicalAddress> returning physAddr=0xc2000000
@3,223,689us: [+0 T:0x4191d490 S:0x4191c714] OM - Memory_getBufferPhysicalAddress> return (0xc2000000)
@3,224,415us: [+0 T:0x4191d490 S:0x4191c714] OM - Memory_getBufferPhysicalAddress> Enter(virtAddr=0x423fd000, size=0)
@3,225,137us: [+6 T:0x4191d490 S:0x4191c714] OM - Memory_getBufferPhysicalAddress> invalid buffer size provided (0)
@3,228,307us: [+0 T:0x4191d490 S:0x4191c714] OM - Memory_getBufferPhysicalAddress> return (0x0)
@3,229,040us: [+5 T:0x4191d490 S:0x4191c72c] CV - VISA_freeMsg(0x10b590, 0x41028c80): Freeing message with messageId=0x00028a98
@3,229,774us: [+0 T:0x4191d490 S:0x4191c7bc] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Exit (handle=0x10b590, retVal=0xffffffff)
@3,230,500us: [+2 T:0x4191d490 S:0x4191c80c] ti.sdo.dmai - [Venc1] VIDENC1_process() ret -1 inId 0 outID 5 generated 808530228 bytes
@3,231,234us: [+7 T:0x4191d490 S:0x4191c80c] ti.sdo.dmai - [Venc1] VIDENC1_process() failed with error (-1 ext: 0x4072f63c)
ERROR: from element /GstPipeline:pipeline0/GstTIVidenc1:tividenc10: failed to encode video buffer

The red lines are thise that I consider important.

where am I wrong?

best regards

  • Mastupristi,

    Could you please attach the trace when running with CE_DEBUG=2 (not 5)?  Maybe something has
    gone wrong earlier and the full trace log might give more insight.

    Best regards,

        Janet

  • I attach the trace generated by the following command line:

    # CE_DEBUG=2 gst-launch videotestsrc num-buffers=50 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=(int)720,height=(int)576,framerate=(fraction)25/1' ! queue max-size-buffers=50 max-size-bytes=622080 !  TIVidenc1 codecName=mpeg4enc engineName=codecServer iColorSpace=NV12 resolution=720x576 framerate=25 ! filesink location=movie.m4v -v 2>&1 | tee trace_ce_debug2.txt

    I can not find anything else relevant in the trace.

    best regards

    trace_ce_debug2.txt.gz
  • How are you configuring Codec Engine in your Linux side app?  Do you have a remote.cfg file with lines like:

    var Engine = xdc.useModule('ti.sdo.ce.Engine');
    var myEngine = Engine.createFromServer(
        "video1_copy",        // Engine name (as referred to in the C app)
        // path to server exe, relative to its package dir
        serverName,
        "ti.sdo.ce.examples.servers.all_codecs" // server package
    );

    This is just an example and your server would be named differently.  Or are you creating the Engine in a .c file using macros?

    The reason I'm asking, is that I see this in your trace:

    @3,661,827us: [+2 T:0x41852490] CE - Engine_initFromServer> Sending RMS_GETALG command for alg [4]
    @3,662,983us: [+5 T:0x41852490] CE - Engine_initFromServer> Warning: No stub functions were found for VIDDEC2_STUBS. The algorithm that requires these stub functions cannot be run remotely.
    @3,663,707us: [+2 T:0x41852490] CE - Engine_initFromServer> Sending RMS_GETALG command for alg [5]
    @3,664,857us: [+5 T:0x41852490] CE - Engine_initFromServer> Warning: No stub functions were found for VIDENC1_STUBS. The algorithm that requires these stub functions cannot be run remotely.

    So it looks to me like Codec Engine is not configured properly.  You would need the VIDENC1_STUBS and VIDDEC2_STUBS in your Linux app
    if you want to run VIDENC1 and VIDDEC2 algorithms remotely.

    Best regards,

        Janet

  • I have not configured anything.

    I take use the cs.x674 distribuited in DVSDK.

    I hope not to have to rebuild the file for use with gstreamer.

    best regards

    Max

  • Hi Max,

    I installed the dsk, and the config files look fine.  Looking at your trace more carefully, I see that the
    VIDENC1_process() failed, and the extended error code is 0xc000.  Looking in xdais_6_26_01_03/packages/ti/xdais/dm/xdm.h,
    the bits in this error code (10 and 11), indicate the following:

        XDM_INSUFFICIENTDATA = 10,   /**< Bit 10 - Insufficient input data.
                                      *
                                      *   @remarks  This error is typically
                                      *             applicable for
                                      *             decoders. This is set
                                      *             when the input data
                                      *             provided is not
                                      *             sufficient to produce
                                      *             of one frame of data.
                                      *             This can be also be
                                      *             set for encoders when
                                      *             the number of valid
                                      *             samples in the input
                                      *             frame is not
                                      *             sufficient to process
                                      *             a frame.
                                      */
        XDM_CORRUPTEDDATA = 11,      /**< Bit 11 - Data problem/corruption.
                                      *
                                      *   @remarks  This error is typically
                                      *             applicable for
                                      *             decoders.  This is set
                                      *             when the bitstream has
                                      *             an error and not
                                      *             compliant to the
                                      *             standard syntax.
                                      */

    Hopefully someone familiar with this mpeg4 encoder knows why you're getting this error.

    Best regards,

        Janet

  • It seems that starting from UYVY format it can works.

    I start another thread on forum

    http://e2e.ti.com/support/embedded/multimedia_software_codecs/f/356/t/256644.aspx

    I hope tha someone could help me

    best regards