[Ffmpeg-devel] Bug in pts computation in compute_pkt_fields() ?
Martin Wache
M.Wache
Tue Mar 20 19:13:32 CET 2007
Wolfram Gloger schrieb:
> Hi,
>
>>> That is probably raw mpeg-ts, right?
>>>
>> No, it is already remuxed to pes.
>
> Ok.
>
>>>> /* handle wrapping */
>>>> if(st->cur_dts != AV_NOPTS_VALUE){
>>>> if(pkt->pts != AV_NOPTS_VALUE)
>>>> pkt->pts= lsb2full(pkt->pts, st->cur_dts, st->pts_wrap_bits);
>>>> if(pkt->dts != AV_NOPTS_VALUE)
>>>> pkt->dts= lsb2full(pkt->dts, st->cur_dts, st->pts_wrap_bits);
>>>> }
>>>>
>>>> The result is negative pts value for the packet. So I guess this is a
>>>> bug in compute_pkt_fields(), or am I doing something wrong?
>>> Please check that st->pts_wrap_bits is set to 60 (and not 33) if the
>>> input stream is mpeg-ts. A long time ago I had a similar problem
>>> which was caused by the transport stream not being detected correctly.
>>>
>> Hmm, you are right, st->pts_wrap_bits is 33 and it should be 60. If I
>> manually set it to 60 it works as it should. How did you fix that problem?
>
> Sorry, I was wrong -- it seems pts_wrap_bits being 33 is correct.
> Can you print all the values
>
> pkt->pts st->cur_dts st->pts_wrap_bits
>
Sure, each pair of lines is one call to compute_pkt_fields(), the first
line is at the start of compute_pkt_fields(), the second at the end:
st->cur_dts 8000000000000000 pkt->pts 8000000000000000 pkt->dts
8000000000000000 33
st->cur_dts 0 pkt->pts 0 pkt->dts 0
st->cur_dts 0 pkt->pts 8000000000000000 pkt->dts 8000000000000000 33
st->cur_dts 870 pkt->pts 0 pkt->dts 0
st->cur_dts 870 pkt->pts 113e0e706 pkt->dts 113e0e706 33
st->cur_dts ffffffff13e0ef76 pkt->pts ffffffff13e0e706 pkt->dts
ffffffff13e0e706
st->cur_dts ffffffff13e0ef76 pkt->pts 8000000000000000 pkt->dts
8000000000000000
33
st->cur_dts ffffffff13e0f7e6 pkt->pts ffffffff13e0ef76 pkt->dts
ffffffff13e0ef76
st->cur_dts ffffffff13e0f7e6 pkt->pts 8000000000000000 pkt->dts
8000000000000000
33
st->cur_dts ffffffff13e10056 pkt->pts ffffffff13e0f7e6 pkt->dts
ffffffff13e0f7e6
st->cur_dts ffffffff13e10056 pkt->pts 8000000000000000 pkt->dts
8000000000000000
33
st->cur_dts ffffffff13e108c6 pkt->pts ffffffff13e10056 pkt->dts
ffffffff13e10056
st->cur_dts ffffffff13e108c6 pkt->pts 8000000000000000 pkt->dts
8000000000000000
33
st->cur_dts ffffffff13e11136 pkt->pts ffffffff13e108c6 pkt->dts
ffffffff13e108c6
st->cur_dts ffffffff13e11136 pkt->pts 8000000000000000 pkt->dts
8000000000000000
33
st->cur_dts ffffffff13e119a6 pkt->pts ffffffff13e11136 pkt->dts
ffffffff13e11136
st->cur_dts ffffffff13e119a6 pkt->pts 8000000000000000 pkt->dts
8000000000000000
33
st->cur_dts ffffffff13e12216 pkt->pts ffffffff13e119a6 pkt->dts
ffffffff13e119a6
st->cur_dts ffffffff13e12216 pkt->pts 113e12216 pkt->dts 113e12216 33
st->cur_dts ffffffff13e12a86 pkt->pts ffffffff13e12216 pkt->dts
ffffffff13e12216
st->cur_dts ffffffff13e12a86 pkt->pts 8000000000000000 pkt->dts
8000000000000000
33
st->cur_dts ffffffff13e132f6 pkt->pts ffffffff13e12a86 pkt->dts
ffffffff13e12a86
I hope this helps, but maybe Mans is right, I do send to pes streams to
ffmpeg, one video and one audio...
Bye,
Martin
More information about the ffmpeg-devel
mailing list