New submission from Umakant <[email protected]>: I am using libavcodec library to decode mpeg4 video using avcodec_decode_video API. I am able to decode I-Frame successfully but when i give P-Frame to avcodec_decode_video function to it return -1 with Error [mpeg4 @ 0145A980]header damaged. I tried lot to get rid of this error but did not succeed. Please help me out by telling the reason for the same.
I am encoding the video using libavcodec avcodec_encode_video API. I am also able to decode and render same encoded video using other player. I am opening encoder for mpeg4 with following options: (*apContext)->bit_rate = 100000; (*apContext)->profile = 0; /* New */ (*apContext)->pix_fmt = PIX_FMT_YUV420P; (*apContext)->codec_id = CODEC_ID_MPEG4; /* New */ (*apContext)->codec_type = CODEC_TYPE_VIDEO; (*apContext)->width = 176; (*apContext)->height = 144; (*apContext)->time_base.den = 10; (*apContext)->time_base.num = 1; (*apContext)->gop_size = 100; (*apContext)->rc_qsquish = 0; (*apContext)->trellis = 2; (*apContext)->qmax = 25; (*apContext)->rc_max_rate = 100000; // maximum bitrate (*apContext)->rc_buffer_size = 100000; (*apContext)->qmin = 3; (*apContext)->qcompress = 1; //(*apContext)->flags|=CODEC_FLAG_AC_PRED; //(*apContext)->flags|=CODEC_FLAG_H263P_UMV; //(*apContext)->flags|=CODEC_FLAG_4MV; //(*apContext)->flags|=CODEC_FLAG_GMC; //(*apContext)->flags|=CODEC_FLAG_LOOP_FILTER; //(*apContext)->flags|=CODEC_FLAG_H263P_SLICE_STRUCT; (*apContext)->qcompress = 1; (*apContext)->mb_decision = FF_MB_DECISION_RD; (*apContext)->me_cmp = 2; (*apContext)->me_sub_cmp = 2; (*apContext)->me_method = ME_EPZS; (*apContext)->me_range = 0; File 'mpeg4-Issue.pcap' not attached - you can download it from https://roundup.ffmpeg.org/file1014. ---------- assignedto: rbultje files: mpeg4-Issue.pcap messages: 11534 nosy: rbultje priority: normal status: new substatus: new title: Error while decoding P-Frame of mpeg4 data type: bug ________________________________________________ FFmpeg issue tracker <[email protected]> <https://roundup.ffmpeg.org/issue2142> ________________________________________________
