Mailing List archive

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

[linux-dvb] video/audio mux and PTS



Hi all,

One question for the dvb developers:

When trying to insert LPCM audio frames into a video stream send to the 
dvb card, several strange things occour (depending on how the stream is 
prepard).

The LPCM frames have been generated from an AC3 audio track of a DVD, 
the video frames come raw from the same DVD. On a DVD apparantly each 
AC3 frame has a PTS, the decoded LPCM data can be larger than 2022 
(2048-packet header). Only teh first frame gets the original PTS of the 
AC3 frame, any additional LPCM frames are therefore stuffed into the 
stream without a PTS. LPCM frames are created as PRIVATE_STREAM1, 
without the 0xBA packet header (PS packet?).

Video frames are used teh same way of the DVD, that is with a 0xBA 
header in front of the 0xE0 header. PTS are only present every second or 
so (every 25th frame).

This leads to stream where almost every audio frame has a PTS, but no 
SCR, and rare PTS in video frames, but each video frame has a SCR.

First question: Is the above describe stream OK and sensible so far?

So, know the mysteries start, if i multiplex the stream so that audio is 
early (audio pts > video pts) or so that audio and video are synchron 
(audio pts == video pts), the video gets jumpy and audio is distorted 
sometimes. The later audio frames are (audio pts < video pts), the 
better the output gets (less jumpy), with a audio latency of about 1/2 
second (pts + 45000), the output is OK.
This makes me belive that audio should always be late by a certain value.

Question: How late should audio be? What are the max and min latencies 
allowed. Is there any rule or formula for this?

ISO/IEC 13818-1, Section: 2.5.2.3 says the input buffer delay is max 1 
second, does this means that the maximum allowed audio frame latency is 
also 1 second? (This is supported by Section D.0.1 Timing Model cite: 
"therefore coded audio and video that represent sound and pictures that 
are to be presented simultaneously may be separated in time within the 
coded bit stream by as much as one second, which is the maximum decoder 
buffer delay that is allowed in the STD model.").


Have fun

   Andreas



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


Home | Main Index | Thread Index