Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"invalid, non monotonically increasing dts" error while writing streams to file with ffmpeg

Tags:

ffmpeg

I was finally able to write video stream packets to a file using the function

av_interleaved_write_frame(outputContext, &packet);

But after a short period of time I got this error:

Application provided invalid, non monotonically increasing dts to muxer 
in stream 0: *numberX* >= *numberY*

Does anybody have any idea, what's causing this and how to fix it?

like image 348
NoviceAndNovice Avatar asked Nov 15 '22 02:11

NoviceAndNovice


1 Answers

set packet.pts to a correct value before calling av_interleaved_write_frame() it's the time stamp in which this frame is presented (e.g displayed on the screen)

this value should be strictly increasing for each packet

like image 89
arash kordi Avatar answered Jan 09 '23 01:01

arash kordi