Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Audio sync



Régis Bossut wrote:
> PCR means Program Clock Reference. Packets are sent at regular
> intervals. Between packets, the clock is deduced from these timesyncs
> packets from an internal PLL synchronized on them. This is one
> mechanism. An other one is the DTS (decoding timestamp) which is carried
> on audio and video packets in the MPEG headers. These DTS are generally
> sent in the TS header of the packet starting the beginning of a frame
> (this is the case for DVD MPEG streams, which do not contain a PCR).
> However, some channels do not align beginning of frames at the start of
> a TS packet and DTS is also not sent on every frame (I don't know how
> the DTS is used in that case, the 13818 documents are quite diffficult
> to understand...).
> 
> The question:
> Which clock does the ARM use for audio/video synchronization ? I guess
> it's DTS if present, PCR if not. But I'm not a guru...

The DTS is irrelevant for lip-sync. It is used to control decoding,
because B-frames in the GOP structure are sent out-of-order wrt
to presentation (frames are sent in order for decoding), i.e.
they must be decoded in a different order than they are displayed.

The PCR is sent in the adaptation field of TS packets. This makes it
possible for the multiplexer to insert them at relatively regular
intervals, independent of the PES packet sizes.

Lip-sync is achieved by synchronizing the PTS from the A/V PES packet
header to the STC (which is driven by the PCR).


Now in the case of AV-PES playback like VDR does it, there are no TS
packets and thus no PCR. To work around that, the STC is driven by the
video PTS. In practice this works pretty well.

A more "correct" approach would have been to use MPEG-2 PS instead
of AV-PES. The PS have a SCR (system clock reference) in the pack header
to drive the STC.


Johannes


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index