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.

poor video quality with h.264 platinum encoder on dm365



hi all,

    I meet a problem that video is poor using h.264 platinum encoder on dm365.

   Briefly, my app captures video with v4l2, encodes it using h.264 encoder from ti, and then streams it using a streaming server.  VLC acquires the RTSP and does the decoding, but the decoded video is poor, for obvious distortion sometimes.

   I attach a snap from the video here.

 

Any help is appreciated.

  • Rafael,

    Can you specify encoder parameters static as well as dynamic? Also sharing a clip will be helpful

  • Thanks Adithya,

        my codec settings are:(H.264 platinum encoder 2.00.00.10)

        params->encodingPreset        = XDM_HIGH_QUALITY;
        params->rateControlPreset     = IVIDEO_STORAGE;
        params->maxFrameRate          = 30000 ;
        params->maxBitRate            = 8000000;
        params->inputChromaFormat     = XDM_YUV_420SP;
        params->dataEndianness        = XDM_BYTE;
        params->maxInterFrameInterval = 1;
        params->inputContentType      = IVIDEO_PROGRESSIVE;
        params->reconChromaFormat     = XDM_YUV_420SP;

        eparams->videncParams = *params;
        eparams->profileIdc = 100;
        eparams->levelIdc = 31;
        eparams->entropyMode = 1;
        eparams->transform8x8FlagIntraFrame = 1;
        eparams->transform8x8FlagInterFrame = 0;
        eparams->aspectRatioX = 1;
        eparams->aspectRatioY = 1;
        eparams->pixelRange = 1;

        eparams->timeScale = 60;
        eparams->numUnitsInTicks = 1;
        eparams->enableVUIparams = 1;

        eparams->disableHDVICPeveryFrame = 0;
        eparams->meAlgo = 0;
        eparams->unrestrictedMV = 0;
        eparams->seqScalingFlag = 1;
        eparams->encQuality = 2;

        eparams->enableARM926Tcm = 0;
        eparams->enableDDRbuff = 1;

        edynParams->sliceSize = 0;
        edynParams->airRate = 0;

        edynParams->intraFrameQP = 28;
        edynParams->interPFrameQP = 28;
        edynParams->initQ = -1;
        edynParams->rcQMax = 44;

        edynParams->rcQMin = 8;
        edynParams->rcAlgo = 0;
        edynParams->rcQMinI = 8;
        edynParams->rcQMaxI = 44;

        edynParams->maxDelay = 5000;
        edynParams->intraSliceNum = 0;
        edynParams->lfDisableIdc = 0;

        edynParams->meMultiPart = 0;
        edynParams->enableBufSEI = 0;
        edynParams->enablePicTimSEI = 0;
        edynParams->intraThrQF = 5;
        edynParams->perceptualRC = 1;
        edynParams->idrFrameInterval = 0;
        edynParams->mvSADoutFlag = 0;
        edynParams->resetHDVICPeveryFrame = 0;
        edynParams->enableROI = 0;
        edynParams->metaDataGenerateConsume = 0;

    params & eparams indicates static parameters.

    dynParams & edynParams indicates dynamic parameters.

     

     

     

  • Rafael,

    It does not seem to an issue with the encoder. The quality degradation is observed whenever there is frame loss. As a result of frameloss, decoder/analyzer misses the actual frame to be used for reference and instead uses the previous frame. Say frame 51 is lost, frame 50 is used as reference for frame 52. This causes a sort of trailing artifact which gets corrected at the next I frame.

     

     

  • Thanks Adithya,

         I think so, since if I run h264 encoder alone, the trailing artifact does not exist. But when I run MJPEG encoder , H264 encoder, and DEI algorithm together, all with groupid 1, my h264 decoded video has this kind of problem.

         I try to optimize my app, but it seems some frame loss is unavoidable. Do you have any suggestions that I can look for?

     

  • And the CPU load is around 70% in this case.

  • Rafael,

    Is the frame loss primarily due to ARM load ? Or is is because of network ? If you have some headroom from FPS perpective of the codecs, you can trying tweaking the MATER PRIORITY register and give higher priority to ARM. This will reduce you ARM load at cost of codec performance.

    SPRUFG8C http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=sprufg5a&fileType=pdf

    regards

    Yashwant