[FFmpeg-devel] h264 streaming decode example?

Liu, George yueliu at lab126.com
Sat Dec 7 02:51:16 CET 2013


I'm following doc/examples/decoding_encoding.c to test out basic h264.

Encoding and decoding with mpg works flawlessly.
Encoding with h264 works flawlessly.

However, I couldn't make h264 decoding work.

I just changed the codec to AV_CODEC_ID_H264 from AV_CODEC_ID_MPEG1VIDEO in video_decode_example(), and received the following message while decoding the first frame.
    len = avcodec_decode_video2(avctx, frame, &got_frame, pkt);


2013-12-07 01:47:04: encoder.h264 - DEBUG - avcodec_decode_video2 - start
[h264 @ 0xa695980] Missing reference picture, default is 0
[h264 @ 0xa695980] decode_slice_header error
[h264 @ 0xa695980] reference picture missing during reorder
[h264 @ 0xa695980] Missing reference picture, default is 0
[h264 @ 0xa695980] reference picture missing during reorder
[h264 @ 0xa695980] Missing reference picture, default is 2
[h264 @ 0xa695980] reference picture missing during reorder
[h264 @ 0xa695980] Missing reference picture, default is 4
[h264 @ 0xa695980] error while decoding MB 25 15, bytestream (-11)
[h264 @ 0xa695980] Cannot use next picture in error concealment
[h264 @ 0xa695980] concealing 624 DC, 624 AC, 624 MV errors in P frame
2013-12-07 01:47:04: encoder.h264 - DEBUG - avcodec_decode_video2 - end


I tried to enlarge the INBUF_SIZE, and set frame size in context, it did not help
    c->width = 640;
    c->height = 480;


Any hint?


More information about the ffmpeg-devel mailing list