P
P
Pavel K2016-08-08 22:32:23
C++ / C#
Pavel K, 2016-08-08 22:32:23

AVCodec (ffmpeg) cannot decode slice header when parsing h264 after getting new SPS and PPS, why?

Greetings.
Scrap rtsp, get h264 stream from rtp, collect frames - everything is ok.
I save the frames to a file (*.h264) to make sure that everything is ok - VLC plays quietly (I also tried to convert the file via ffmpeg to AVI - the same is all ok - the whole conversion is without errors)
But if in runtime I decode by frames with help

avcodec_decode_video2(m_decoderContext, m_picture, &got_picture, &m_packet);

decodes normally for the first 10 seconds BEFORE new SPS and PPS arrive (the camera switches to night mode)
as soon as they come from avcodec only errors:

decode_slice_header error
concealing 1497 DC, 1497 AC, 1497 MV errors in P frame

Why is this happening and in what direction to dig?
it seems that avcodec does not process new sps and pps...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel K, 2016-08-09
@PavelK

The problem was in the speed of parsing and the small size of their buffer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question