<p>I'm working with an mpeg stream that uses a IBBP... GOP sequence. The <code>(DTS,PTS)</code> values returned for the first 4 AVPackets are as follows: <code>I=(0,3) B=(1,1) B=(2,2) P=(3,6)</code></p>

<p>The PTS on the I frame looks like it is legit, but then the PTS on the B frames cannot be right, since the B frames shouldn't be displayed before the I frame as their PTS values indicate. I've also tried decoding the packets and using the pts value in the resulting AVFrame, put that PTS is always set to zero.</p>

<p>Is there any way to get an accurate PTS out of ffmpeg? If not, what's the best way to sync audio then?</p>

Ok, scratch my previous confused reply.
For a IBBPBBI movie, you'd expect the PTSes to look like this (in decoding order)
```
```
0, 3, 1, 2, 6, 4, 5, ...
```
```
corresponding to the frames
```
```
I, P, B, B, I, B, B, ...
```
```
So you appear to be missing an I at the start of your sequence but otherwise the timestamps look correct.