[FFmpeg-user] why wrong start code in "h264_decode_frame" did not report error?

tugouxp 13824125580 at 163.com
Fri Aug 10 15:31:58 EEST 2018


 hi all:
    i add log print in function "h264_decode_frame" in order to get the start code infomation of the input packet bitstream,
and the log is below.  but the result is not expected, for the doucument says each packet should be start with start code "00 00 01" or "00 00 00 01",

if so, why the ffmpeg did not report any error messages to terminal?  is there any mistake of my understanding?


thanks for your kindly support.


958 static int h264_decode_frame(AVCodecContext *avctx, void *data,                                                                                                                                                
 959     ¦   ¦   ¦   ¦   ¦   ¦   ¦int *got_frame, AVPacket *avpkt)
 960 {  
 961     const uint8_t *buf = avpkt->data;
 962     int buf_size       = avpkt->size;
 963     H264Context *h     = avctx->priv_data;
 964     AVFrame *pict      = data;
 965     int buf_index; 
 966     int ret;
 967    
 968     printf("%s line %d, 0x%02x 0x%02x 0x%02x 0x%02x.\n", __func__, __LINE__, buf[0], buf[1], buf[2], buf[3]);




h264_decode_frame line 968, 0x00 0x00 0x0d 0xd0.
h264_decode_frame line 968, 0x00 0x00 0x07 0x69.
h264_decode_frame line 968, 0x00 0x00 0x07 0x7a.
h264_decode_frame line 968, 0x00 0x00 0x11 0x09.
h264_decode_frame line 968, 0x00 0x00 0x0c 0xe0.
h264_decode_frame line 968, 0x00 0x00 0x0d 0x9c.
h264_decode_frame line 968, 0x00 0x00 0x0a 0x0f.
h264_decode_frame line 968, 0x00 0x00 0x08 0xf3.
h264_decode_frame line 968, 0x00 0x00 0x00 0xb1.
h264_decode_frame line 968, 0x00 0x00 0x00 0x4b.
h264_decode_frame line 968, 0x00 0x00 0x02 0xe5.
h264_decode_frame line 968, 0x00 0x00 0x07 0x0a.
h264_decode_frame line 968, 0x00 0x00 0x03 0x25.
h264_decode_frame line 968, 0x00 0x00 0x0e 0x6a.
h264_decode_frame line 968, 0x00 0x00 0x03 0xb7.
h264_decode_frame line 968, 0x00 0x00 0x12 0xd1.
h264_decode_frame line 968, 0x00 0x00 0x04 0x56.
h264_decode_frame line 968, 0x00 0x00 0x06 0x20.
h264_decode_frame line 968, 0x00 0x00 0x14 0xd7.
h264_decode_frame line 968, 0x00 0x00 0x06 0xe8.
h264_decode_frame line 968, 0x00 0x00 0x05 0xb1.
h264_decode_frame line 968, 0x00 0x00 0x18 0xd0.
h264_decode_frame line 968, 0x00 0x00 0x07 0x8b.
h264_decode_frame line 968, 0x00 0x00 0x07 0xe8.
h264_decode_frame line 968, 0x00 0x00 0x15 0x9a.
h264_decode_frame line 968, 0x00 0x00 0x05 0x88.
h264_decode_frame line 968, 0x00 0x00 0x14 0x58.
h264_decode_frame line 968, 0x00 0x00 0x06 0xd4.
h264_decode_frame line 968, 0x00 0x00 0x17 0x7a.
h264_decode_frame line 968, 0x00 0x00 0x08 0x47.
h264_decode_frame line 968, 0x00 0x00 0x07 0xcf.
h264_decode_frame line 968, 0x00 0x00 0x23 0x9d.
h264_decode_frame line 968, 0x00 0x00 0x0c 0x8d.
h264_decode_frame line 968, 0x00 0x00 0x07 0x1a.
h264_decode_frame line 968, 0x00 0x00 0x06 0xc3.
h264_decode_frame line 968, 0x00 0x00 0x28 0xdf.



More information about the ffmpeg-user mailing list