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.

TIImgenc1 problems after first frame

Other Parts Discussed in Thread: DM3730, OMAP3530

 

I'm having problems sending multiple frames thru TIImgenc1 element to jpeg encode them.  I've tried this on omap3530 and dm3730 (Overo gumstix and BB-xm), using the current dvsdk.

Here is an example pipeline:

gst-launch -v videotestsrc pattern=snow num-buffers=5 ! TIImgenc1 iColorSpace=UYVY  oColorSpace=YUV420P qValue=75 numOutputBufs=3 genTimeStamps=1 ! fakesink

You will see from the output of fakesink, that the first frame from the jpeg encoder is correct, but all subsequent frames are around 570 bytes.

I've tried turning on debug messages from gst and codec engine, but I can't figure out the cause.

This was also reported here:

https://gforge.ti.com/gf/project/gstreamer_ti/forum/?action=ForumBrowse&forum_id=187&thread_id=3754&_forum_action=ForumMessageBrowse

Any help?

 

 

/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (43468 bytes, timestamp: 0:00:00.000000000, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 0) 0x2a708"
New clock: GstSystemClock
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  575 bytes, timestamp: 0:00:00.033333333, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 0) 0x117020"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  573 bytes, timestamp: 0:00:00.066666666, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 0) 0x1170e0"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  573 bytes, timestamp: 0:00:00.099999999, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 0) 0x1171a0"
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  573 bytes, timestamp: 0:00:00.133333332, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 0) 0x117260"
/
  •  

    Does anyone have any input on this issue?

    Thanks.

  • Hi Chris,

     

    I have the same problem as you.

    Take a look at : http://e2e.ti.com/support/embedded/f/354/p/134076/486099.aspx

    Maybe you will be more lllucky than i am. Let me know if you find a solution !

     

  •  

    I noticed in your example pipeline from the other thread you didn't have numOutputBufs=3.  Without this, my pipeline stalls.  When it is added, the pipeline runs, but outputs garbage after the first frame.

    So the comment about buffers not being freed may relate to that, and be a totally different issue.  I would think a buffer allocation problem would result in nothing coming out of the pipeline rather than bad data?  I need to run again with more debug turned on and attach the output here.

    thanks.

  • Chris,

     

    I investigate our problem with this cmd line :

    CE_DEBUG=3 GST_DEBUG=5 gst-launch videotestsrc -v ! 'video/x                                         
    -raw-yuv, width=320 , height=240, format=(fourcc)UYVY' ! TIImgenc1 engineName=co                                         
    decServer codecName=jpegenc iColorSpace=UYVY oColorSpace=YUV420P qValue=75 numOu                                         
    tputBufs=3 resolution=320x240 frameRate=30 displayBuffer=TRUE genTimeStamps=TRUE                                         
     ! fakesink

    I noticed only this mistake :

    [ColorSpace] Unknown color space format (4) during Ienc1_process...

     

     

  •  

    This patch has corrected my format bug :

    https://gforge.ti.com/gf/project/gstreamer_ti/tracker/?action=TrackerItemEdit&tracker_item_id=1043

    gst-launch -v videotestsrc ! TIImgenc1 engineName=codecServe                                         
    r codecName=jpegenc ! fakesink 

    But i still have the same problem as above :

    Pipeline is PREROLLED ...                                                                                                
    Setting pipeline to PLAYING ...                                                                                          
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < ( 8235 bytes, timestamp: none, duration: n
    one, offset: -1, offset_end: -1, flags: 0) 0x128ce8"                                                                     
    New clock: GstSystemClock                                                                                                
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  575 bytes, timestamp: none, duration: n
    one, offset: -1, offset_end: -1, flags: 0) 0x128db8"                                                                     
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  573 bytes, timestamp: none, duration: n
    one, offset: -1, offset_end: -1, flags: 0) 0x128e88"

    Any advice ???

     

  • I needed to make Mjpeg encoding.

    I resolved this issue by modifing 3 files (I don't why we lost the params config but for now it's resolve our problem, already it's not an optimize solution...) :

    Modifing TIImgenc1 in encode_thread function :

            /*re-set of params because we lost them*/
            imgenc1->hIe = Ienc1_control(imgenc1->hIe,&imgenc1->dynParams);

            /* Invoke the image encoder */
            GST_LOG("invoking the image encoder\n");
            ret             = Ienc1_process(imgenc1->hIe, imgenc1->hInBuf, hDstBuf);

    Adding Ienc1_control function in Ienc1.c in DMAI to re-set params :

    /******************************************************************************
     * Ienc1_control
     ******************************************************************************/
    Ienc1_Handle Ienc1_control(Ienc1_Handle hIe, IMGENC1_DynamicParams *dynParams)
    {
        IMGENC1_Handle       hEncode;
        IMGENC1_Status       encStatus;
        XDAS_Int32           status;

        hEncode = Ienc1_getVisaHandle(hIe);
         /* Set dynamic parameters */
         encStatus.data.buf = NULL;
         encStatus.size = sizeof(IMGENC1_Status);
         status = IMGENC1_control(hEncode, XDM_SETPARAMS, dynParams, &encStatus);

            if (status != IMGENC1_EOK) {
                Dmai_err1("XDM_SETPARAMS failed, status=%d\n", status);
                IMGENC1_delete(hEncode);
                free(hIe);
                return NULL;
            }

        return hIe;
    }

    In Ienc1.h adding declaration:

    extern Ienc1_Handle Ienc1_control(Ienc1_Handle hIe,
                                    IMGENC1_DynamicParams *dynParams);

    I'm working on gstreamer_svn 962 on a DM6467T.

    If someone can give me return about my modification !

  • I forgot to say what you need to recompile DMAI before recompile gstreamer_ti !

    I tried with success the TIImgenc1 with color input : UYVY and YUV420P.

  • I had the same problem on a DM6446 with the dmaienc_mjpeg element from the DDOMPE branch. The fix works there as well, with a slight modification:

    In gstimgenc1.c I added:

      dmaienc->hCodec = Ienc1_control(dmaienc->hCodec,(IMGENC1_DynamicParams*)dmaienc->dynParams);

     and modified Ienc1.c/h according to the post.

    Thanks,

    Jan

  • I had the same problem. I changed dmai and gstreamer-ti code as shown above. It is working well. But when I use "TIImgenc1" in QT application, it stops after first frame. Any idea?
  • Personaly i have not expérience with gstreamer on Qt. If it s work with gstreamer maybe it is a multithread gestion problem or try to use Dmai_debug=2 in the beggining of your pipeline to have more debug info. Mika
  • I can confirm that this fixed the problem for me as well.  I'm using DDOMPE branch of the ti plugin.

    Thanks for posting this!

  • Hi,

    I am using DM3730 with DVSDK 4.02. I want to encode NTSC input into MJPEG using DSP. I tried the above changes as suggested but they did not work for me. I can only see first frame and no JPEG frame afterwards. Following is the output:

    gst-launch-0.10 v4l2src device=/dev/video0 -v !\
     video/x-raw-yuv,format=\(fourcc\)UYVY,framerate=\(fraction\)30000/1001,width=720,height=480 !\
     TIImgenc1 engineName=codecServer codecName=jpegenc iColorSpace=UYVY oColorSpace=YUV420P qValue=75 numOutputBufs=3 genTimeStamps=1 displayBuffer=true !\
     fakesink

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                             
    Pipeline is live and does not need PREROLL ...                                  
    Setting pipeline to PLAYING ...                                                 
    New clock: GstSystemClock                                                       
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                       
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                      
    /GstPipeline:pipeline0/GstTIImgenc1:tiimgenc10.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                        
    [R=====================================W                                      ] [                                      B                                     |]
    /GstPipeline:pipeline0/GstTIImgenc1:tiimgenc10.GstPad:src: caps = video/x-jpeg, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                 
    /GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-jpeg, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                  
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "preroll   ******* "                                                                               
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "event   ******* E (type: 102, GstEventNewsegment, update=(boolean)false, rate=(double)1, applied-rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, start=(gint64)0, stop=(gint64)-1, position=(gint64)0;) 0xf1920"                                               
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (37187 bytes, timestamp: 0:00:00.067413330, duration: 0:00:00.033366666, offset: -1, offset_end: -1, flags: 0) 0x2ab08"                                         
    [                                      R=====================================W] [                                                                            B]
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  575 bytes, timestamp: 0:00:00.100779996, duration: 0:00:00.033366666, offset: -1, offset_end: -1, flags: 0) 0x104808"                                        
    [--------------------------------------W                                     R] [                                      B                                     |]
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  573 bytes, timestamp: 0:00:00.134146662, duration: 0:00:00.033366666, offset: -1, offset_end: -1, flags: 0) 0x1048c8"                                        
    [                                      R=====================================W] [                                                                            B]
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  573 bytes, timestamp: 0:00:00.167513328, duration: 0:00:00.033366666, offset: -1, offset_end: -1, flags: 0) 0x104988"                                        
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------


    Applying all changes, compiling & installing dmai, compiling & installing gstreamer


    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                             
    Pipeline is live and does not need PREROLL ...                                  
    Setting pipeline to PLAYING ...                                                 
    New clock: GstSystemClock                                                       
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                       
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                      
    /GstPipeline:pipeline0/GstTIImgenc1:tiimgenc10.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                        
    [R=====================================W                                      ] [                                      B                                     |]
    /GstPipeline:pipeline0/GstTIImgenc1:tiimgenc10.GstPad:src: caps = video/x-jpeg, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                 
    /GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-jpeg, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                  
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "preroll   ******* "                                                                               
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "event   ******* E (type: 102, GstEventNewsegment, update=(boolean)false, rate=(double)1, applied-rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, start=(gint64)0, stop=(gint64)-1, position=(gint64)0;) 0xf1920"                                               
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (36972 bytes, timestamp: 0:00:00.069549562, duration: 0:00:00.033366666, offset: -1, offset_end: -1, flags: 0) 0x2ab08"                                         
    [                                      R=====================================W] [                                                                            B]
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  575 bytes, timestamp: 0:00:00.102916228, duration: 0:00:00.033366666, offset: -1, offset_end: -1, flags: 0) 0x104808"                                        
    [--------------------------------------W                                     R] [                                      B                                     |]
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  573 bytes, timestamp: 0:00:00.136282894, duration: 0:00:00.033366666, offset: -1, offset_end: -1, flags: 0) 0x1048c8"                                        
    [                                      R=====================================W] [                                                                            B]
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (  573 bytes, timestamp: 0:00:00.169649560, duration: 0:00:00.033366666, offset: -1, offset_end: -1, flags: 0) 0x104988"                                        
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Following is the output when I encode using ARM:
    gst-launch-0.10 v4l2src device=/dev/video0 -v !\
     video/x-raw-yuv,format=\(fourcc\)UYVY,framerate=\(fraction\)30000/1001,width=720,height=480 !\
     jpegenc quality=75 ! fakesink

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                             
    Pipeline is live and does not need PREROLL ...                                  
    Setting pipeline to PLAYING ...                                                 
    New clock: GstSystemClock                                                       
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                       
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                      
    /GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:src: caps = image/jpeg, width=(int)720, height=(int)480, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1                                                                     
    /GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)30000/1001, width=(int)720, height=(int)480                                                                            
    /GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = image/jpeg, width=(int)720, height=(int)480, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1                                                                  
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "preroll   ******* "                                                                               
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "event   ******* E (type: 102, GstEventNewsegment, update=(boolean)false, rate=(double)1, applied-rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, start=(gint64)0, stop=(gint64)-1, position=(gint64)0;) 0xfa520"                                               
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (43304 bytes, timestamp: 0:00:00.075195313, duration: 0:00:00.000000000, offset: 0, offset_end: 1, flags: 0) 0xf62d0"                                           
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (40952 bytes, timestamp: 0:00:00.132659912, duration: 0:00:00.000000000, offset: 1, offset_end: 2, flags: 0) 0xf6380"                                           
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (40836 bytes, timestamp: 0:00:00.183685304, duration: 0:00:00.000000000, offset: 2, offset_end: 3, flags: 0) 0xfe860"                                           
    /GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = "chain   ******* < (41120 bytes, timestamp: 0:00:00.233337404, duration: 0:00:00.000000000, offset: 3, offset_end: 4, flags: 0) 0xfe910"                                           
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------

    However, for better speed I want to use DSP for encoding and not ARM processor. With ARM processor the output frame rate decreases as quality increases due to endcoding delays. Please let me know how to solve this issue.

  • Hi Vivek Jain,

    Try to use DMAI_DEBUG=2 or CE_DEBUG=3 in the begginning of your pipeline (ex: DMAI_DEBUG=2 gst-launch ....) to check if call Ienc1_control and if the SETPARAMS is called to.

    I don't see other issue, only you are not re-setting the codec dynparams after the process call.

    Mika

  • Hi Mike,

    Thank you for your prompt response. The solution worked for me as well. We are using gstreamer svn 962 version and not the one which came with the kit. So, when I compiled and installed gstreamer, all files were installed in gstreamer and gstreamer_demo folders in /opt directory, however, the executable were running from old installation. So, I set the path variables correctly and the only error left was 'cs.x64P not found' for which I created the symbolic link to the actual file and everything worked.

    Thanks,

    Vivek

  • Hi,

    Many times after stopping the gstreamer, when I start again, I get the following error:

    -----------------------

    ERROR: Pipeline doesn't want to pause.
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not get bu ffers from device '/dev/video0'.
    Additional debug info: gstv4l2bufferpool.c(390): gst_v4l2_buffer_pool_new (): /GstPipeline:pipeline0/Gs tV4l2Src:v4l2src0:
    error requesting 2 buffers: Device or resource busy
    Setting pipeline to NULL ...
    Freeing pipeline ...

    ------------------------

    Looks like buffers are not released properly when we stop the gstreamer by presssing crtl+c. (This problem does not arrises when I use ARM, jpegenc to do MJPEG encoding). Please let me know how to solve this issue. I am using the following pipeline:

    gst-launch-0.10 v4l2src device=/dev/video0 -v always-copy=false !\
     video/x-raw-yuv,format=\(fourcc\)UYVY,framerate=\(fraction\)30000/1001,width=720,height=480 !\
     TIImgenc1 engineName=codecServer codecName=jpegenc iColorSpace=UYVY oColorSpace=YUV420P qValue=75 resolution=720x480 numOutputBufs=3 genTimeStamps=1 displayBuffer=true !\
     rtpjpegpay pt=26 ! udpsink host=192.168.1.101 port=5000

  • Hi Vivek,

    You can try to set DMAI_DEBUG=2 in the beginning of your pipeline (DMAI_DEBUG=2 gst-launch .....) to see the memory pools allocation in the init and the "de-allocation" when you stop it. In first, try to use num-buffers= XXX for you v4l2src element to stop it properly and after try with crtl+c. With this you will see if an element doesn't make the de-allocation of your buffers...

    I see that you are using "always-copy = false" so the buffer allocated in the v4l2src element will push a non "dmaitransportbuffer" and the TImgenc1 element will copy it into a "cmem pool" ( try to use always-copy=true to win time) .

    I don't remember if the DM3730 use the "vpif" chip. if it's the case, you should take a look to the ticapturesrc element...

    Mika

  • Hi Mika

    Thanks for the reply. The problem resulted from interrupt signal event  issue and I could resolve the problem by following posts here:

    http://processors.wiki.ti.com/index.php/DSPLink_Signal_Handling_in_Codec_Engine

    http://linux.davincidsp.com/pipermail/davinci-linux-open-source/2009-September/015918.html

    http://linux.davincidsp.com/pipermail/davinci-linux-open-source/2009-September/015923.html

    https://groups.google.com/forum/?fromgroups=#!topic/beagleboard/GmbO8qnVyuo

    Basically disable the signal handler in DSP.

    Vivek

  • I'm having the same problem Vivek had (with a DM3730) and i have a further question...

    with the debug flags enabled, how can i tell that SETPARAMS or Ienc1_control is called? i did a search of the output, and neither thing is mentioned.

    Thanks,

    Woody

  • Hi Woody,

    add a debug line after IMGENC1_CONTROL like this :

    status = IMGENC1_control(hEncode, XDM_SETPARAMS, dynParams, &encStatus);
         Dmai_dbg1("status encode value : %d \n",status);

    (Dmai_dbg1 means you set 1 argument in info, here status for %d)

    recompile DMAI (and gstreamer if you use it) and you will have an output msg when DMAI_DEBUG is set.

    Hope it help.

    Mika

  • Thanks for the help! I called Dmai_dbg1, and IMGENC1_control gets called, and returns IMGENC1_EOK.

    Could it be the sink i'm using (attached to the src pad on TIImgenc1)? I'm using filesink, but i've also used fakesink (with the same result).

    my pipeline looks like this: appsrc->TIImgenc1->filesink

    Thanks again!

    -Woody

  • My problem definately has something to do with my application. If i run the command line listed in the original post, with videotestsrc->TIImgenc1->fakesink, everything works fine. i'm still trying to get my pipeline (in C) to work properly (the appsrc stops signalling after a few frames).

    Is there a place in the TI E2E forums for general gstreamer questions?

    Thanks,

    Woody

  • Hi Woody,

    Try to post in gstreamer-ti forum (see gstreamer-ti project in google) but i don't think you will have an answer.

    if you make : appsrc -> fakesrc silent=false what happens ? Did your pipeline stop ? If yes, appsrc is the problem, else it's in TIImgenc1 (CE_DEBUG could help you)

    I can try to help you if you send me an email @ michael-soares@live.fr with more info(I did some work on gstreamer) .

    I finally add the dmai control command in the encode process call like this :

    Int Ienc1_process(Ienc1_Handle hIe, Buffer_Handle hInBuf, Buffer_Handle hOutBuf,
            IMGENC1_DynamicParams *dynParams)
    {
        BufferGfx_Dimensions    dim;
        IMGENC1_InArgs          inArgs;
        IMGENC1_OutArgs         outArgs;
        XDM1_BufDesc            inBufDesc;
        XDM1_BufDesc            outBufDesc;
        XDAS_Int32              status;
        XDAS_Int8              *inPtr;
        XDAS_Int8              *outPtr;
        UInt32                  offset = 0;
        UInt32                  bpp;
        UInt32                  i;  
        IMGENC1_Status       encStatus;
         /* Set dynamic parameters */

        assert(hIe);

        if (dynParams == NULL) {
            Dmai_err0("Cannot pass null dynamic params\n");
            return Dmai_EFAIL;
        }
        encStatus.data.buf = NULL;
        encStatus.size = sizeof(IMGENC1_Status);
        status = IMGENC1_control(hIe->hEncode, XDM_SETPARAMS, dynParams, &encStatus);
        if (status != IMGENC1_EOK) {
            Dmai_err1("XDM_SETPARAMS failed, status=%d\n", status);
            return Dmai_EFAIL;
        }

    ...

    ...

    ...

        status = IMGENC1_process(hIe->hEncode, &inBufDesc, &outBufDesc, &inArgs,
                                &outArgs);

    ...

    Mika

  • Mika,

    I've made a lot of progress! Turns out i wasn't setting numOutputBufs on the TIImgenc1 element. When i set it to 3, and fixed my cmem pools, it works! at least it seems to...

    I still have one more problem: my pipeline works with filesink and fakesink; i'm now trying to implement appsink. It loads and decodes the first couple frames, but the 'new-buffer' signal never comes from the appsink, so buffers aren't being removed from the output queue.

    Thank you so much for all of your help! I'm going to dig into the appsink documentation to see what is wrong.

    One more thing: It seems like i'm seeing about 5 frames per second encoded (at 2592x1936, 5Megapixel Images). Does that seem right, or is it slow? When i run the sample "encode" pipeline:

    CE_DEBUG=1 gst-launch filesrc location=sample.yuv ! TIImgenc1 codecName=jpegenc engineName=codecServer resolution=2592x1936 iColorSpace=UYVY oColorSpace=YUV420P ! filesink location=sample.jpg

    It says "Execution ended after 6042480 ns"

    Shouldn't i be able to encode at a higher framerate, or is there that much overhead moving buffers around?

    Thanks again,


    Woody

  • Woody,

    I don't know if it's a good framerate because i never tried this kind of resolution.

    You can check with CE_DEBUG how many times takes the encoder to process 1 frame (process_enter / process_exit) and estimate if it's due to encode time (you can't do nothing) or not.

    Mika