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.

How Can I display video stream from ip camera with mcfw?

Hi:

  I am developing NVR based on dm816x platform.   I have a trouble that  I can't display the stream using mcfw api.Below is my code.Can anyone help me, or how can i display the stream on screen by some channel?

void display_stream(void *frame, int framesize, int chnid)

{
    VCODEC_BITSBUF_LIST_S emptyBuffList;
    memset(&emptyBuffList, 0, sizeof(emptyBuffList));
    VDEC_BUF_REQUEST_S req;

    emptyBuffList.numBufs = 0;
    req.numBufs = 1;
    req.reqType = VDEC_BUFREQTYPE_BUFSIZE;
    int status = 0;

    int i;
    for (i = 0; i < req.numBufs; i++)
    {
        req.u[i].minBufSize = 704 * 576;
    }

    if ((status = Vdec_requestBitstreamBuffer(&req, &emptyBuffList, 0)) != ERROR_NONE) {
        printf("failed to request bitstream buffer: %d\n", status);
        return;
    }

    for (i = 0; i < emptyBuffList.numBufs; i++) {
        emptyBuffList.bitsBuf[i].chnId = chnid;
        emptyBuffList.bitsBuf[i].filledBufSize = frameSize;
        memcpy(emptyBuffList.bitsBuf[i].bufVirtAddr, frame, framesize);
    }
    if (emptyBuffList.numBufs > 0) {
        Vdec_putBitstreamBuffer(&emptyBuffList);
        OSA_waitMsecs(16);

     }
}

  • What is the error you are seeing. Are you not gettign any empty buffers ? Are you getting any warning prints on the console

  • I can get empty stream from the framwork. I fill the empty buffer and put it back to the framwork,  no error message printed on the console. But I can't see anything on the specified channel id.

  • I forgot to say that my function is started after the DVR_StartSystem function in app_manager.c.

    int LIB816x_startSystem(int disp_main, int disp_sub, int bNtsc, int vmode)
    {
        int rv = 0;
        int i;

        VIDEOMOTION_CreatePrm videomotionCreatePrm ;

        videomotionCreatePrm.numCh = MAX_CH;
        videomotionCreatePrm.frameWidth = 704 ;
        videomotionCreatePrm.frameHeight = 576;
        if(bNtsc == CAM_NTSC)
        {
            videomotionCreatePrm.frameHeight = 480;
        }
        DVR_SetRecordingType(gInitSettings.storage.iHddRecylceModeOn);

        rv = VIDEO_motionCreate(&videomotionCreatePrm) ;

        (void) app_playback_init();
        (void) DVR_StartSystem(bNtsc, disp_main, disp_sub, vmode);

       {mycode}

      ...

     

  • I met the same problem with you,  Could you tell me how to solve this problem?????