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 to get decoded H264 video resolution?

Hello, 

I'm working on vdec_vdis use case on DM8168, DVR_RDK_3.0. I'd like to get the resolution (width/height) of H264 video. However, I try to get it via VDEC and VDIS (swMs), but fail. Is there any way to get the correct value?

// Try VDIS function:

WINDOW_S chnlInfo ;

UInt32 WinId = 0 ;

Vdis_getChnlInfoFromWinId( 0, winId, &chnlInfo );

// Try VDEC function:

VIDEO_CHANNEL_LIST_INFO_S channelListInfo ;

Vdec_getChannelInfo( &channelListInfo );

As above code snap, both them return 1920*1080, but the real resolution is 1280*720...

[m3vpss ] *** [SWMS0] Mosaic Parameters *** 

[m3vpss ]
[m3vpss ] Output FPS: 28
[m3vpss ]
[m3vpss ] Win | Ch | Input | Input | Input | Input | Output | Output | Output | Output | Low Cost | SWMS | Data | Blank |
[m3vpss ] Num | Num | Start X, Y | Width x Height | Pitch Y / C | Memory Type | Start X, Y | Width x Height | Pitch Y / C | Memory Type | ON / OFF | Inst | Format| Frame |
[m3vpss ] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
[m3vpss ] 0 | 0 | 0, 0 | 1280 x 720 | 2048 / 2048 | NON-TILED | 780, 270 | 360 x 540 | 3840 / 0 | NON-TILED | OFF | 0 | 420SP | OFF |

  • There is a bug in Vdis_getChnlInfoFromWinId which is fixed in RDK 4.0.

    Fix is to modify as below

    /dvr_rdk/mcfw/src_bios6/links_m3vpss/swMs/swMsLink_drv.c


    Int32 SwMsLink_drvGetInputChInfoFromWinId(SwMsLink_Obj * pObj,SwMsLink_WinInfo * pCropInfo)
    {
        UInt32  chnl;
        SwMsLink_drvLock(pObj);
        chnl = pObj->layoutParams.winInfo[pCropInfo->winId].channelNum;
        pCropInfo->startX   = pObj->rtChannelInfo[chnl].startX;
        pCropInfo->startY   = pObj->rtChannelInfo[chnl].startY;
        pCropInfo->width    = pObj->rtChannelInfo[chnl].width;
        pCropInfo->height   = pObj->rtChannelInfo[chnl].height;
        if ((FVID2_SF_PROGRESSIVE == pObj->rtChannelInfo[chnl].scanFormat) &&
            pObj->layoutParams.winInfo[pCropInfo->winId].bypass &&
            VPS_VPDMA_MT_NONTILEDMEM == pObj->rtChannelInfo[chnl].memType
            )
        {
            pCropInfo->height   /= 2;
        }
        SwMsLink_drvUnlock(pObj);
        return FVID2_SOK;
    }