DM8168 Video Capture from FPGA using VIN0 and send video out using VOUT0

Hi all,

 I want to capture video data from FPGA using VIN0 ports, performing image compressor and then send back compressing video data to FPGA using VOUTo port.  is it possible?

DM8186                                      FPGA

VOUT0[0..29]  -----------------> VOUT0[0..29]

VIN0[0..23]  <-------------------- VIN0[0..23]

Thanks,

Bonzai

  • Hi,

     

    It is possible, you can treat your compressed data as if it is RGB888 data and capture it, it will be stored as RGB888, is that ok?

     

    Regards,

    Brijesh Jadav

  • In reply to Brijesh Jadav:

    Hi, Brijesh.

     I don't change anything, but it's OK now. I don't know why.

     I want to write the capture data into file.  So I use ipcFramesOutVpssToHostPrm and ipcFramesInHostPrm.

    But it can not receive any data. what's wrong?

     [m3vpss ]  *** CAPTURE Statistics ***
     [m3vpss ] 42661: CAPTURE: Queued to driver = 12, Dequeued from driver = 12
     [m3vpss ] CAPTURE [0] Buf Q Status
     [m3vpss ] Empty Q -> count 0, wrPtr 0, rdPtr 0
     [m3vpss ] Full Q -> count 12, wrPtr 12, rdPtr 0
     [m3vpss ] 
     [m3vpss ]  *** [NSF0] NSF Statistics ***
     [m3vpss ] 42661: NSF: Rcvd from prev = 0, Returned to prev = 0
     [m3vpss ] NSF Out [0] Buf Q Status
     [m3vpss ] Empty Q -> count 0, wrPtr 0, rdPtr 0
     [m3vpss ] Full Q -> count 0, wrPtr 0, rdPtr 0

     

  • In reply to Shary Li:

    Hi,

    Did you check your capture statistics and if it is all correct?

    Regards,

    brijesh

  • In reply to Brijesh Jadav:

    The logs indicate the link after capture link is not getting notification.Pls share .c file of your latest usecase. Do you have an application thread on A8 that does

    Vcap_getFullVideoFrames & Vcap_putEmptyVideoFrames

  • In reply to Brijesh Jadav:

    Hi, I test capture-display, the capture Link is OK.

  • In reply to Badri Narayanan:

    CaptureLink_CreateParams           capturePrm;
        NsfLink_CreateParams               nsfPrm;
        IpcFramesOutLinkRTOS_CreateParams  ipcFramesOutVpssToHostPrm;
        IpcFramesInLinkHLOS_CreateParams   ipcFramesInHostPrm;

        CaptureLink_VipInstParams         *pCaptureInstPrm;
        CaptureLink_OutParams             *pCaptureOutPrm;

        UInt32 vipInstId;
        UInt32 i,j, chId;
        UInt32 numSubChains;

        MULTICH_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams ,ipcFramesOutVpssToHostPrm);
        MULTICH_INIT_STRUCT(IpcFramesInLinkHLOS_CreateParams  ,ipcFramesInHostPrm);
        MULTICH_INIT_STRUCT(NsfLink_CreateParams, nsfPrm);

        MultiCh_detectBoard();

        System_linkControl(
            SYSTEM_LINK_ID_M3VPSS,
            SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES,
            NULL,
            0,
            TRUE
            );

        System_linkControl(
            SYSTEM_LINK_ID_M3VIDEO,
            SYSTEM_COMMON_CMD_SET_CH2IVAHD_MAP_TBL,
            &systemVid_encDecIvaChMapTbl,
            sizeof(SystemVideo_Ivahd2ChMap_Tbl),
            TRUE
            );

        gVcapModuleContext.captureId                 = SYSTEM_LINK_ID_CAPTURE;
        gVcapModuleContext.nsfId[0]                  = SYSTEM_LINK_ID_NSF_0;
        gVcapModuleContext.ipcFramesOutVpssToHostId  = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_1;
        gVcapModuleContext.ipcFramesInHostId         = SYSTEM_HOST_LINK_ID_IPC_FRAMES_IN_0;

        CaptureLink_CreateParams_Init(&capturePrm);

        capturePrm.outQueParams[0].nextLink   = gVcapModuleContext.nsfId[0]; // gVcapModuleContext.ipcFramesOutVpssToHostId;
       // numSubChains                          = 2;
        capturePrm.numVipInst                 = 1;

        capturePrm.tilerEnable                = FALSE;
       // capturePrm.numBufsPerCh               = 10;
       // capturePrm.numExtraBufs               = 6;
        capturePrm.maxBlindAreasPerCh         = 4;

        for(vipInstId=0; vipInstId<capturePrm.numVipInst; vipInstId++)
        {
            pCaptureInstPrm                     = &capturePrm.vipInst[vipInstId];
            pCaptureInstPrm->vipInstId          = (SYSTEM_CAPTURE_INST_VIP0_PORTA + vipInstId)%SYSTEM_CAPTURE_INST_MAX;
            pCaptureInstPrm->videoDecoderId     = SYSTEM_DEVICE_VID_DEC_TVP7002_DRV; 

           pCaptureInstPrm->inDataFormat       = SYSTEM_DF_YUV422P;
            pCaptureInstPrm->standard           = SYSTEM_STD_1080P_60;
            pCaptureInstPrm->numOutput          = 1;

            pCaptureOutPrm                      = &pCaptureInstPrm->outParams[0];
            pCaptureOutPrm->dataFormat          = SYSTEM_DF_YUV422I_YUYV;
            pCaptureOutPrm->scEnable            = FALSE;
            pCaptureOutPrm->scOutWidth          = 0;
            pCaptureOutPrm->scOutHeight         = 0;
            pCaptureOutPrm->outQueId            = 0;
        }

            NsfLink_CreateParams_Init(&nsfPrm);
         nsfPrm.bypassNsf                    = TRUE;
         nsfPrm.inputFrameRate               = 60;
         nsfPrm.outputFrameRate              = 60;
         nsfPrm.tilerEnable                  = FALSE;
         nsfPrm.inQueParams.prevLinkId       = gVcapModuleContext.captureId;
         nsfPrm.inQueParams.prevLinkQueId    = 0;
         nsfPrm.numOutQue                    = 1;
            nsfPrm.outQueParams[0].nextLink     = gVcapModuleContext.ipcFramesOutVpssToHostId;
         nsfPrm.numBufsPerCh                 = 6;

         /*  ipcFrames  */
         ipcFramesOutVpssToHostPrm.baseCreateParams.noNotifyMode                = TRUE; //FALSE;
         ipcFramesOutVpssToHostPrm.baseCreateParams.notifyNextLink              = FALSE; //TRUE;
         ipcFramesOutVpssToHostPrm.baseCreateParams.notifyPrevLink              = TRUE;
         ipcFramesOutVpssToHostPrm.baseCreateParams.inQueParams.prevLinkId      = gVcapModuleContext.nsfId[0]; // gVcapModuleContext.captureId;
         ipcFramesOutVpssToHostPrm.baseCreateParams.inQueParams.prevLinkQueId   = 0;
         ipcFramesOutVpssToHostPrm.baseCreateParams.outQueParams[0].nextLink    = gVcapModuleContext.ipcFramesInHostId;

         ipcFramesInHostPrm.baseCreateParams.noNotifyMode                       = TRUE; //FALSE;
         ipcFramesInHostPrm.baseCreateParams.notifyNextLink                     = FALSE; //TRUE;
         ipcFramesInHostPrm.baseCreateParams.notifyPrevLink                     = FALSE; //TRUE;
            ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkId             = gVcapModuleContext.ipcFramesOutVpssToHostId;
         ipcFramesInHostPrm.baseCreateParams.inQueParams.prevLinkQueId          = 0;
         ipcFramesInHostPrm.baseCreateParams.outQueParams[0].nextLink           = SYSTEM_LINK_ID_INVALID;
         ipcFramesInHostPrm.exportOnlyPhyAddr                                   = TRUE;  //TRUE;

         ipcFramesInHostPrm.cbCtx = &gVcapModuleContext;
         ipcFramesInHostPrm.cbFxn = Vcap_ipcFramesInCbFxn;

         System_linkCreate (gVcapModuleContext.captureId, &capturePrm, sizeof(capturePrm));
          System_linkCreate(gVcapModuleContext.nsfId[0], &nsfPrm, sizeof(nsfPrm));
         System_linkCreate(gVcapModuleContext.ipcFramesOutVpssToHostId, &ipcFramesOutVpssToHostPrm, sizeof(ipcFramesOutVpssToHostPrm));
         System_linkCreate(gVcapModuleContext.ipcFramesInHostId, &ipcFramesInHostPrm, sizeof(ipcFramesInHostPrm));
     }

    The thread is VcapVenc_ipcFramesCreate(usecase) which will get rid of display.

  • In reply to Shary Li:

    You have to add Vcap_start.ALso you have to modify /dvr_rdk/demos/mcfw_api_demos/mcfw_demo/demo_vcap_venc_vdis_ipc_frames_exch.c

    Comment out call to Vdis_putFullVideoFrames & Vdis_getEmptyVideoFrames..Also make sure you are invoking VcapVenc_ipcFramesCreate

  • In reply to Badri Narayanan:

    Hi, it stops  in  [m3video]  Channel:0 inputframerate:30 targetfps:30.        And it seems not receive data.   Can you help me.

    [host] MCFW_IPCBITS:VcapVencVdecVdis_ipcBitsSendFxn:Entered... [m3video]  44348: IPC_IN_M3   : Create in progress !!!
     [m3video]  44348: SYSTEM: Opening ListMP [VPSS-M3_IPC_OUT_0] ...
     [m3video]  44348: SYSTEM: Opening ListMP [VPSS-M3_IPC_IN_0] ...
     [m3video]  44350: IPC_IN_M3   : Create Done !!!
     [m3video]  44351: ENCODE: Create in progress ... !!!
     [m3video]  44428: ENCODE: Creating CH0 of 1920 x 1080, pitch = (1920, 1920) [PROGRESSIVE] [NON-TILED  ], bitrate = 2000 Kbps ...

     [host] IpcBitsInLink_tskMain:Entered
     [host]  3770: IPC_BITS_IN   : Create in progress !!!

     [host]  3770: IPC_BITS_IN   : ListMPOpen start !!!

     [host]  3770: SYSTEM: Opening ListMP [VIDEO-M3_IPC_OUT_28] ...
     3772: SYSTEM: Opening ListMP [VIDEO-M3_IPC_IN_28] ...

     [host]  3773: IPC_BITS_IN   : ListMPOpen done !!!

     [host]  3775: IPC_BITS_IN   : System_linkGetInfo done !!!

     [host]  3775: IPC_BITS_IN   : Create Done !!!
     DEMO: No video detected at CH [0] !!!

     =============
     Run-Time Menu
     =============

     1: Capture Settings
     2: Encode  Settings
     3: Decode  Settings
     4: Display Settings
     5: Audio   Capture / Playback Settings

     6: Audio Capture <TVP5158> & Encode <AAC-LC> demo
     7: Audio encode demo <AAC-LC File In/Out>
     8: Audio decode demo <AAC-LC File In/Out>

     i: Print detailed system information
     s: Core Status: Active/In-active

     e: Stop Demo

     Enter Choice:  [m3video] ENCLINK_H264:HEAPID:0 USED:13808
     [m3video] ENCLINK_H264:HEAPID:3        USED:9535488
     [m3video]  44473: ENCODE: All CH Create ... DONE !!!
     [m3video] ENCLINK:HEAPID:0     USED:13928
     [m3video] ENCLINK:HEAPID:2     USED:16588800
     [m3video] ENCLINK:HEAPID:3     USED:9535488
     [m3video]  44474: ENCODE: Create ... DONE !!!
     [m3video]  Channel:0 inputframerate:60 targetfps:30
     [m3video]  44475: IPC_BITS_OUT   : Create in progress !!!
     [m3video]  44477: IPC_BITS_OUT   : Create Done !!!
     [m3video]  Channel:0 inputframerate:30 targetfps:30

  • In reply to Shary Li:

    In the file you shared the issue is in file mcfw_cap_enc.txt

    capturePrm.outQueParams[0].nextLink = gMultiCh_VcapVencVdisObj.ipcOutVpssId is wrong. CHange it to

    capturePrm.outQueParams[0].nextLink =  gVcapModuleContext.nsfId

    Also make sure you modify VcapVenc_ipcFramesSendRecvFxn to comment out Vdis_putFullVideoFrames & Vdis_getEmptyVideoFrames