[MPlayer-G2-dev] mpeg container's timing (PTS values)

Arpi arpi at thot.banki.hu
Thu May 8 02:14:05 CEST 2003


Hi,

> Arpi (arpi at thot.banki.hu):
> 
> > The video part is relative easy, but a bit tricky: when a PS packet
> > has a PTS timestamp, that timestamp belongs to the next complete
> > frame.  (not to the one which ends in that packet!)
> 
>   Doesn't it belong to the video frame which starts in that packet?

yes, we say the same but with different words :)
(next complete frame == the frame starts in this packet)

> > The audio is however very tricky.
> 
>   I remember it being a total bitch.

:)

> > It is very inaccurate for mpeg. Now i've found why: in mpeg
> > containers, the audio timestamps behave like the video: they belong to
> > the _next_ complete frame/block.
> 
>   I don't think this is exactly correct.

neither me, this is why sending that mail :)

> > After experimencng with several streams, i've found that ct: value is
> > the time length of an audio frame. Strange, isn't it?
> 
>   I think there is a more logical explination.

I hope so.

> > Do anyone have accurate info about the meaning/calculation of audio
> > PTS for mpeg container?
> 
>   It's been a while, but here is a comment I wrote in movietime:
> 
>     /**
>      * Interesting tidbit.  The PTS value in an A/52 audio frame
>      * is for the audio frame which starts after the pointer
>      * value (bytes p[2] and p[3] of the 4-byte header, byte
>      * p[1] is the number of frames in the pack).  So, I need to
>      * pass this into the A/52 parse code so it can tag the new
>      * PTS at the correct position.
>      */

Sounds interesting.

>   Basically, each pack can contain multiple audio frames, and the header
> tells you which one the PTS belongs to.  It's not necessarily the first
> one.

I need samples, where it isn't (always) the first one :)

>   If it would help, I can go through my code some more and refresh my
> memory.

would be great!


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-G2-dev mailing list