I’m facing the error in the title which crashes my thread.
int decode(AVPacket* pPacket) {
int count = 0;
int response = avcodec_send_packet(_pCodecContext, pPacket);
while(response >= 0) {
AVFrame* pFrame = av_frame_alloc();
response = avcodec_receive_frame(_pCodecContext, pFrame);
This is the general structure of where I’m decoding the video into frames.
I do use seek_frame to change position around avstream to get different frames with this:
avformat_seek_file(_pFormat, -1, INT64_MIN, location, INT64_MAX, AVSEEK_FLAG_BYTE);
avcodec_flush_buffers(_pCodecContext);
I did inspect the packets i’m sending into a codec context, and I am sure I’m not feeding duplicate pts packets to codec context (I have inspected the pts, dts, pos of the packet before sending them to codec context). But this error always comes with av log of “Duplicate POC found in sequence: X” and it’s having problem handling the NAL unit.
Really desperate for an answer for this error and how to avoid it.