FFmpeg returns negative PTS and DTS for first non key frame

We have some envelope of FFmpeg, that processes the video. The tree first frames of video are: B -> B -> I as shown below:

enter image description here

PTS and DTS returns negative for first frame:

enter image description here

We have some code, that skips the frames that are below some timepoint (0 for first frame). Is it possible to ask FFmpeg to start from first frame and not from first I frame?

1 answer

  • answered 2020-02-18 13:17 Olga Pshenichnikova

    I found that we modified AVContext::strat_time manualy, and set value based on DTS of a first valid video packet. The problem solved, when I set value based on PTS of a first valid packet as a start_time.