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.

All H.264 encoded videos just can be played at 25 fps

Hi all,

I'm using DM368 (LeopardBoard) and H.264 codec to encode video. Video data to encode is inputted from a file (yuv raw file) or can be captured from the sensor. What happens is that all encoded videos just can be played at 25 fps, even if i change the values on refFrameRate = targetFrameRate. I put maxFrameRate to 450000, and i already tried to encode with refFrameRate = targetFrameRate at 20000, 30000 and at 35000.

Can someone help me with this problem? Any help would be greately appreciated.
Thanks in advance, 

LSousa

  • Hi,

    I hope you are measuring profile number across encoder process call and saying it is running at 25fps. Please send all encoder parameter settings. Specifically check for encQuality, enableDDRbuf params. They should be 2/3 and 0 respectively.

    Thanks,

    Veeranna

  • Hi,

    Veeranna Hanchinal said:

    I hope you are measuring profile number across encoder process call and saying it is running at 25fps. 

    Sorry, i didn't understood what you mean. I am encoding video sequences, and the encoded data is being saved into a file without any container (avi, mp4, etc). If i check the properties of this resulting file, it is indicated 25fps in framerate, and if i play the video with a player like MPC-HC or Movie Player (Ubuntu), the video is played at 25 fps. The video sequence i'm testing is in nv12 format.
    I check encQuality and enableDDRbuf params as you indicated, but i'm still with the same problem. The encoder parameter settings i am using are the following:

    rcAlgo = 1;

    profileIdc = 100;

    initQ = -1;

    rcQMaxI = 44;

    rcQMinI = 8;

    rcQMax = 44;

    rcQMin = 8;

    entropyMode = 0; 

    transform8x8FlagIntraFrame = 0;

    transform8x8FlagInterFrame = 0;

    seqScalingFlag = 0;

    airRate = 0;

    intraFrameInterval = 30;

    rateControlPreset = IVIDEO_USER_DEFINED; 

    encodingPreset = XDM_USER_DEFINED;

    encQuality = 3; 

    targetBitRate = 512000;

    targetFrameRate = 30000;

    refFrameRate = 30000;

    lfDisableIdc = 0;

    maxDelay = 6000;

    sliceSize = 0;

    intraFrameQP = 28;

    interPFrameQP = 28;

    perceptualRC = 0;

    resetHDVICPeveryFrame = 0;

    mvSADoutFlag = 0;

    enableBufSEI = 0;

    idrFrameInterval = 0;

    enableARM926Tcm = 0; 

    meAlgo = 0;

    sliceMode = 0;

    outputDataMode = 1;

    sliceFormat = 1;

    enableVUIparams = 0;

    levelIdc = 51;

    (videnc1_params) size = sizeof(IH264VENC_Params);

    maxHeight = 1920;

    maxWidth = 1920;

    maxFrameRate = 30000;

    maxBitRate = 50000000;

    dataEndianness = XDM_BYTE;

    maxInterFrameInterval=0;

    inputChromaFormat = reconChromaFormat = XDM_YUV_420SP;

    inputContentType = XDM_DEFAULT;

    (videnc1_dynnamicparams) size = sizeof(IH264VENC_DynamicParams);

    inputHeight = 288;

    inputWidth = 352;

    Thanks, 
    LSousa

  • Hi,

    I thought you are talking about framerate interms of speed of encoder. I think Decoder is not getting correct information from bitstream to get framerate. I guess decoder will look for num_unit_ticks and time_scale params from VUI params to calculate the framerate.

    Please refer userguide to enable VUI params. And below e2e thread may give additional information.

    http://e2e.ti.com/support/embedded/multimedia_software_codecs/f/356/p/248238/868819#868819

    Thanks,
    Veeranna
  • Hi Veeranna,

    I could solve my problem with your suggestion. Thank you very much!
    I will share here the params i change in case somebody else have the same problem.

    struct VUIParamBuffer  VUI_Buf;
    enableVUIparams = 4;
    enableBufSEI = 1;
    VUI_Buf.numUnitsInTicks = 1;
    VUI_Buf.timeScale = 60;

    //defaults
    VUI_Buf.aspectRatioInfoPresentFlag = 0;
    VUI_Buf.overscanInfoPresentFlag = 0;
    VUI_Buf.overscanAppropriateFlag = 0;
    VUI_Buf.videoSignalTypePresentFlag = 1;
    VUI_Buf.videoFormat = 2;
    VUI_Buf.pixelRange = 1;
    VUI_Buf.colourDescriptionPresentFlag = 0;
    VUI_Buf.colourPrimaries = 2;
    VUI_Buf.transferCharacteristics = 2;
    VUI_Buf.matrixCoefficients = 2;
    VUI_Buf.timingInfoPresentFlag = 1;
    VUI_Buf.fixedFrameRateFlag = 0;
    VUI_Buf.nalHrdParameterspresentFlag = 1;
    VUI_Buf.picStructPresentFlag = 0;
    VUI_Buf.bitstreamRestrictionFlag =1;

    DynParams.VUI_Buffer = &VUI_Buf;

    In addition, for the first frame, i set TimeStamp param in inArgs struture to 0, and for the subsequent frames, i increment the TimeStamp by units_per_frame (in my case this is 2; see Appendix A from h264_encoder_dm365_userguide documentation for more details).
    With these params, encoded videos now are played at 30 fps.

    Thanks,
    LSousa