MPEG-2 PTS and MediaSample TimeStamps when demuxing
- From: "Steve Murrell" <steve@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Jan 2006 17:58:42 GMT
I am hoping someone here can help me with a problem I have had for a few
days now.
I have modified the GDCL parser sample to demux a MPEG-2 PS and it is
working fine except for seeking (A/V is out of sync).
I am trying to understand the correct method of converting the MPEG-2 PTS
values to MediaSample TimeStamps.
The current method I am following (as per the example code) is as follows -
On creation the filter sets REFERENCE_TIME m_tStart = 0;
In CompleteConnect() the parser finds the first Audio PTS in the file and
saves it in m_firstPTS.
In Receive() the parser obtains the PTS of the current audio or video packet
and subtracts m_firstPTS from it
then converts the result to a REFERENCE_TIME value.
m_tStart is then subtracted from it and it is used to set the timestamps on
the outgoing media samples.
I know that after a seek has occured the outgoing timestamps need to start
again from zero.
This is where the trouble starts!
So I have a couple of questions -
[1] Why do you need to modify each PTS value to subtract the initial PTS ?
If the stream starts at zero why is it an issue if say the first Audio
sample is timestamped with say 0.02 seconds?
It is possible that intial video timestamps may be negative, so why is this
not a problem?
[2] What should I do about the m_tStart and m_firstPTS offsets after a seek
?
Many Thanks
Steve
.
- Follow-Ups:
- Re: MPEG-2 PTS and MediaSample TimeStamps when demuxing
- From: Geraint Davies
- Re: MPEG-2 PTS and MediaSample TimeStamps when demuxing
- Prev by Date: Re: Can't choose the language with the WM ASF Reader
- Next by Date: Re: AM_PROPERTY_DVDSUBPIC_HLI
- Previous by thread: how to check the codec is work?
- Next by thread: Re: MPEG-2 PTS and MediaSample TimeStamps when demuxing
- Index(es):
Relevant Pages
|