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.

DVSDK4 DM368, "fatal bit error" in decode demo

I've based my codec on the DVSDK samples.  In the decoder there is a fatal condition that halts the decode operation and prints out "fatal bit error".  The line of code is this...

/* If no encoded data was used we cannot find the next frame */
if (ret == Dmai_EBITERROR && Buffer_getNumBytesUsed(hInBuf) == 0) {
   ERR("Fatal bit error\n");
    cleanup(THREAD_FAILURE);
 }

In my application I get this error on an occasional basis.  In this particular situation I just reuse the display buffer I provided to the Vdec2_process and ignore the error.  That's fine and the application keeps encoding as it should.

The real question is why am I getting these errors?  I noticed that when I was using a DVD recorded from the TV to generate my test video I could see a situation that generated a lot of these errors.  There is a particular commercial that had a bunch of complete scene changes in rapid succession.  During this I saw a lot of "fatal bit error" printouts and some corruption of the decoded video.  Anyone got any ideas where I should start looking?

John A

  • John,

    When a codec reports and error there is usually a code associated with that error. The codec user's guide usually give more information about what the error code means.

    So, a starting point would be to read the error code and find out what it means.

    if you run the application with DMAI_DEBUG=2, you will get the code printed out

    Please let us know what the error code is

    Thanks
    Cesar

  • It appeared the extendedError code is 0x853.  My interpretation of this is...

    XDM_CORRUPTEDDATA = 11

    IH264DEC_EX_ERR_UNINTENSIONAL_FRAME_LOST (sic) = 0x53

    This is odd because I'm packaging whole frames and sending them with RTP and using the sequence numbers to detect lost frames.  At this point I guess I need to check my encoder to see if there is a possibility of loss at the source.

    John A

     

  • Cesar, I marked your reply as an answer because it got me going in the right direction.  Turned out that I had some under-implemented code in my decoder side wrt RTP packets.  Most of the packets from the encoder go out as "Fragmented Units" because the frame is larger than the MTU of the transport.  However some very small frames come out occasionally and they get transmitted as single packets.  My decoder was dropping those single packets as a result of not processing all packeting types in the RTP handler.

    In my test video it appeared that the corruption was occuring when frames switched quickly, but it was actually a succession of freeze frames (in a commercial).  The frozen frames generated very small encoded frames that fit in a single MTU.  I was dropping those frames in my RTP reader.  Now that it's fixed I am no longer getting the error.

    Thanks,

    John A

  • I am now happening with the same situation with you. 

    I wrote a program to decode rtp video stream from IP camera( 720P H.264 , High Profile 3.1) . Firstly I wrote the program on Dvsdk2 , everything seems OK and the evm board(DM368) could decode the video . Later I adapted the program to Dvsdk4.02 to support 1080P ,  and problems come in .After running some minutes, programe exited abnormal, due to Dmai_EBITERROR.


            /* Decode the video buffer */
            ret = Vdec2_process(hVd2, hInBuf, hDstBuf);

            if (ret < 0) {
                ERR("Failed to decode video buffer\n");
                cleanup(THREAD_FAILURE);
            }

            /* If no encoded data was used we cannot find the next frame */
            if (ret == Dmai_EBITERROR && Buffer_getNumBytesUsed( hInBuf ) == 0) {
                ERR("Fatal bit error\n");
                //PrintHex(hInBuf);
                cleanup(THREAD_FAILURE);
            }

    output with DMAI_DEBUG=2 is following.

    @0x003c062b:[T:0x41411490] ti.sdo.dmai - [Vdec2] VIDDEC2_process() ret -1 inId 5 inUse 0 consumed 0
    @0x003c0739:[T:0x41411490] ti.sdo.dmai - [Vdec2] VIDDEC2_process() non-fatal error 0x853

    I think the network library is right , but puzzled with this situation. :-(

  • After the UBL upgraded to 432MHZ , this error disappeared.

  • hi,zhang,i got the same err as yours,at the very beginning just after i switched the channel, it' turned to be i frime at first. I need you advice.

    Thanks in advances,

    Regards, mike