[Libav-user] Disappearing / missing frames from h264 source

Daan Heemskerk daan.heemskerk at gmail.com
Tue Dec 24 02:32:04 EET 2019


Hi,

I have a problem that has been driving me crazy for a day.

At this moment I can't post source code; for that I have to write a 
small test program tomorrow,


The problem:

===========

I receive packages from a h268 webcam using:

if( av_read_frame(this->pFormatContextIn, pPacket) < 0 ) break;

Normally those packages have an increasing dts and pts with an increment 
of 3600.

Timebase is 1/ 90000 fps is 25 -> So this is perfect.

But at some moments this starts to flip up to the point where the dts 
and pts have an increment of 90000 ( one second ).

I repeatedly call the openH264 decoder but only get one frame.

If I look at the video I encode the time is correct; the movie stalls, 
skips some frames and continues.
( I use the input pts and that means the input pts is correct. )

The problem is where did the frames go ...


Investigations:

=============

Both AVCONV and VLC MEDIA PLAYER play the same stream with almost no 
problem.

I tried both:

avcodec_encode_video2

and the new:

avcodec_send_packet
avcodec_receive_frame

and I have read the source code of avconv.c

If I just copy the packages I also have a correct video stream.

So I miss something at the moment I get the frames using:

avcodec_send_packet
avcodec_receive_frame ( repeated )

I don't even mangle with the pts and dts ... I have a movie of a clock; 
the pts I receive seems perfect.

The dial sometimes just stops for a while and then jumps over the gap.


Does someone know if there is some setting or some small thing that 
would make my frames disappear?


Thank you,

Daan




















More information about the Libav-user mailing list