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.

Linux/DRA746: some 264 streamer decode failed

Part Number: DRA746


Tool/software: Linux

Hi Ram, 

I found certain 264 media file (which is ok in pc with VLC application) can not played with ti 264 decoder.

The extendedError of outArgs is 0x2000a00, which consider as IH264VDEC_ERR_MISSINGSLICE XDM_APPLIEDCONCEALMENT XDM_CORRUPTEDDATA.

I attach this file below and Please help me to check it.

Beside, decoder can parse right width and height from stream header.

Best Regards.

  • Hi,

    I have forwarded your question to an expert for comment.

    Regards,
    Yordan
  • HI Gao,
    I analyzed the stream with Elecard stream analyzer, It seems whole stream doesn't have an I/IDR frame. All frames are B frames.
    but our sample application viddec3test doesn't throw any error but nothing is displayed.

    I will check and let you know

    Ram
  • Hi Gao,

    In shared /mp4 file the VCL data was missing. Extracting the elementary stream using ffmpeg, the stream is able to decode with out any error. Attaching the extracted elementary stream.

    test3_check.zip

  • Hi Prashanth,
    I checked test3_check.h264 and found 264 decoder can decode but still returns some errors, such as :
    mOutArgs->extendedError 0xa10, IH264VDEC_ERR_MBDATA XDM_APPLIEDCONCEALMENT XDM_CORRUPTEDDATA

    Whether my ti decoder sdk version is older? The newer sdk maybe ok?

    Best Regards
    Gao
  • Hi Gao, 

    With latest SDK, I am not observing any error for elementary stream and you mp4 stream.

    You can check the codec version with remote proc logs. Execute below command on target, it will show the versions of all codecs integrated with IPUMM

    cat /sys/kernel/debug/remoteproc/remoteproc1/trace0

    Thanks

    Ram

  • Hi Gao,

    hongbo gao said:
    Whether my ti decoder sdk version is older? The newer sdk maybe ok?

    Possible! Can you try the method said by Ram in the above post? Or you can check the Codec version in the Release Notes.

    I did not see any error with latest CODEC release in standalone. Also Vega analyser did not show any error with extracted stream.

    All the latest codec versions are here : https://git.ti.com/ivimm/ipumm/trees/master/extrel/ti/ivahd_codecs/packages/ti/sdo/codecs

  • Hi Prashanth,

    The codec version are below as shows:

    [0][ 0.000] COMMIT-ID : bdba6b5
    [0][ 0.000] CODEC-VER BEGIN:
    [0][ 0.000] H264D-02.00.20.01
    [0][ 0.000] MPEG4D-01.00.15.01
    [0][ 0.000] MPEG2D-01.00.16.01
    [0][ 0.000] VC1D-01.00.02.04
    [0][ 0.000] MJPEGD-01.00.14.01
    [0][ 0.000]
    [0][ 0.000] H264E-02.00.09.01
    [0][ 0.000] MPEG4E-01.00.02.01


    Best Regrads
    Gao.
  • Hi Gao,
    The latest codec versions are as below:

    Decoders:
    1. H264D-02.00.21.01
    2. MPEG4D-01.00.15.01
    3. MPEG2D-01.00.17.01
    4. VC1D-01.00.02.05
    5. MJPEGD-01.00.16.01

    Encoders:
    1. H264E-02.00.09.01
    2. MPEG4E-01.00.02.01

  • Hi Gao,
    For which Frame# do you see this error?

    Can you print the frame number, inputBytes to the codec & bytesConsumed by the codec & share the log.
  • Hi Prashanth,

    Prashanth Kumar15 said:
    Can you print the frame number, inputBytes to the codec & bytesConsumed by the codec & share the log.

    VIDDEC3_process mInCount 1, mInArgs->inputID=0xb5902f28, fd 0x20, mInput 0xb5a04000, size 3035, bytesConsumed 3035, timestamp 0.000, err 0

    From log above, mInCount is the frame number, size is inputBytes to codec and bytesConsumed. And err is the result by codec.

    I attach log named ti_264_decode_fail.zip for you.

    Best Regrads.

    Gaoti_264_decoder_fail.zip

  • Thanks Gao, for the logs.

    Looks like some extended parameter setting is causing this issue. With Base class params it works fine. Please share the param settings. I will suggest you the modification required.

  • Hi Prashanth,

    Thanks for you answer. Params are set below as shows:

    int32_t DecoderH264::initCommonStaticParams()
    {
        // xxx other codec support; viddec3test uses IVIDDEC3_Params
        mParams = (VIDDEC3_Params*)dce_alloc(sizeof(IH264VDEC_Params));
        if( !mParams ) {
            ERROR("DEC Parameter memory allocation failed");
            return -1;
        }
        mParams->size = sizeof(IH264VDEC_Params);
        mParams->maxBitRate      = 10000000;
        mParams->displayDelay    = IVIDDEC3_DISPLAY_DELAY_AUTO;
        mParams->numOutputDataUnits  = 0;
    
        // set the max width and height, as bigger as possible
        mParams->maxWidth            = 4096; //mWidth
        mParams->maxHeight           = 4096; //mHeight
        mParams->maxFrameRate        = 30000;
        mParams->dataEndianness      = XDM_BYTE;
        mParams->forceChromaFormat   = XDM_YUV_420SP;
        mParams->operatingMode       = IVIDEO_DECODE_ONLY;
        mParams->displayBufsMode     = IVIDDEC3_DISPLAYBUFS_EMBEDDED;
        mParams->inputDataMode       = IVIDEO_ENTIREFRAME;
        mParams->metadataType[0]     = IVIDEO_METADATAPLANE_NONE;
        mParams->metadataType[1]     = IVIDEO_METADATAPLANE_NONE;
        mParams->metadataType[2]     = IVIDEO_METADATAPLANE_NONE;
        mParams->outputDataMode      = IVIDEO_ENTIREFRAME;
        mParams->numInputDataUnits   = 0;
        mParams->errorInfoMode       = IVIDEO_ERRORINFO_OFF;
    
        return 0;
    }
    
    int32_t DecoderH264::initSpecificStaticParams()
    {
        ASSERT(mParams);
        mH264Params = (IH264VDEC_Params *) mParams;
        mH264Params->dpbSizeInFrames = IH264VDEC_DPB_NUMFRAMES_AUTO;
        mH264Params->pConstantMemory = 0;
        mH264Params->presetLevelIdc = IH264VDEC_LEVEL41;
        mH264Params->errConcealmentMode = IH264VDEC_APPLY_CONCEALMENT;
        mH264Params->temporalDirModePred = TRUE;
        mH264Params->detectCabacAlignErr = IH264VDEC_DISABLE_CABACALIGNERR_DETECTION;
        mH264Params->bitStreamFormat = IH264VDEC_BYTE_STREAM_FORMAT;
        mH264Params->decodeFrameType = mDecodeIOnly ? IH264VDEC_DECODE_I_ONLY : IH264VDEC_DECODE_ALL;
        DEBUG("mDecodeIOnly %d", mDecodeIOnly);
        return 0;
    }
    
    int32_t DecoderH264::initCommonDynamicParams()
    {
        if (!mDynParams) {
            mDynParams = (IVIDDEC3_DynamicParams*)dce_alloc(sizeof(IH264VDEC_DynamicParams));
            mDynParams->size = sizeof(IH264VDEC_DynamicParams);
            mH264DynParams = (IH264VDEC_DynamicParams *) mDynParams;
    
            mDynParams->displayWidth  = 0;
            mDynParams->frameSkipMode = IVIDEO_NO_SKIP;
            mDynParams->newFrameFlag  = XDAS_TRUE;
        }
    
        // common parameters
        mDynParams->decodeHeader  = mDecoderHeader ? XDM_PARSE_HEADER : XDM_DECODE_AU;
    
        return 0;
    }
    
    int32_t DecoderH264::initSpecificDynamicParams()
    {
        return 0;
    }
    

    First, I set decodeHeader to PARSE_HEADER mode because I want to parse w/h from stream header.

    After I got stream resolution, set decodeHeader to DECODE_AU mode again.

    Besides, I note that these params are work well for other 264 streams.

  • Hi Gao,

    Thanks for the params. All looks fine. Can you set maxWidth & maxHeight below 2048. For this stream, say maxHeight = 1088; maxWidth = 1920. Because, if either
    of maxHeight or maxWidth is greater than 2048 then the minimum width supported is 336. (Refer User Guide FAQs)

    This streams resolution is 176x144.